Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
FPC development
(Moderators:
FPK
,
Tomas Hajny
) »
[SOLVED] FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️)
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
FPGMAP accepts duplicates...
by
Thaddy
[
Today
at 09:58:00 am]
Connecting to AzureSQL
by
Thaddy
[
Today
at 09:53:46 am]
Scripts to generate ofici...
by
valdir.marcos
[
Today
at 09:40:33 am]
Transparent form
by
Pe3s
[
Today
at 08:47:26 am]
Can I get the position an...
by
CM630
[
Today
at 07:59:53 am]
HTTP2 Support
by
Amir61
[
Today
at 07:58:14 am]
How to compare floating p...
by
Khrys
[
Today
at 07:21:17 am]
Lazarus and FreePascal on...
by
shayneoneill
[
Today
at 05:51:48 am]
Error: -macosx_version_mi...
by
shayneoneill
[
Today
at 05:49:02 am]
SYnEdit lose cursor
by
eldonfsr
[
Today
at 03:31:46 am]
FPC Unleashed (inline var...
by
flowCRANE
[
Today
at 02:05:38 am]
IDE: Property editor does...
by
Raskaton
[
Today
at 01:24:59 am]
How to view the TODO list...
by
n7800
[May 12, 2026, 10:41:05 pm]
Hint tools gives wrong hi...
by
wp
[May 12, 2026, 10:29:45 pm]
Stack overflow detection
by
n7800
[May 12, 2026, 10:23:25 pm]
Qt does not position form...
by
systemgvp
[May 12, 2026, 09:56:34 pm]
Gtk3 widgetset - call for...
by
zeljko
[May 12, 2026, 09:44:13 pm]
Windows 10 x64 Kernel Dri...
by
PascalDragon
[May 12, 2026, 09:07:06 pm]
Feature announcement: Fun...
by
PascalDragon
[May 12, 2026, 08:57:47 pm]
How can I suppress except...
by
PascalDragon
[May 12, 2026, 08:34:40 pm]
TA Chart Axes visibility ...
by
wp
[May 12, 2026, 08:22:28 pm]
USB-C PD logger KM003C
by
DonAlfredo
[May 12, 2026, 07:42:44 pm]
TR-DOS Audio Suite
by
Gigatron
[May 12, 2026, 06:26:53 pm]
show me the parameters ce...
by
Nicole
[May 12, 2026, 05:42:40 pm]
TToolbutton: Dropdown men...
by
apeoperaio
[May 12, 2026, 03:11:30 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️) (Read 491 times)
ALLIGATOR
Sr. Member
Posts: 413
I use FPC [main] 💪🐯💪
[SOLVED] FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️)
«
on:
November 27, 2025, 06:29:28 am »
FPC 3.2.2 & 3.2.4 x64 Windows
Code: Pascal
[Select]
[+]
[-]
program
app
;
begin
for
argc
:
=
9
to
9
do
GetMem
(
1
)
;
end
.
Code: Pascal
[Select]
[+]
[-]
Access violation reading from address
$FFFFFFFFFFFFFFFF
«
Last Edit: November 27, 2025, 07:39:05 am by ALLIGATOR
»
Logged
I may seem rude - please don't take it personally
Khrys
Sr. Member
Posts: 435
Re: FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️)
«
Reply #1 on:
November 27, 2025, 06:58:24 am »
I don't know what else you'd expect to happen when carelessly manipulating the argument count like that
Take a look at
InternalExit
in
system.inc
, called on program shutdown:
Code: Pascal
[Select]
[+]
[-]
{$if (defined(MSWINDOWS) and not defined(win16)) or defined(OS2)}
{ finally release the heap if possible, especially
important for DLLs.
Reset the array to nil, and finally also argv itself to
avoid double freeing problem in case this function gets called twice. }
if
assigned
(
argv
)
then
begin
for
i
:
=
0
to
argc
-
1
do
if
assigned
(
argv
[
i
]
)
then
begin
sysfreemem
(
argv
[
i
]
)
;
argv
[
i
]
:
=
nil
;
end
;
sysfreemem
(
argv
)
;
argv
:
=
nil
;
end
;
{$endif}
Logged
ALLIGATOR
Sr. Member
Posts: 413
I use FPC [main] 💪🐯💪
[SOLVED] Re: FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️)
«
Reply #2 on:
November 27, 2025, 07:38:47 am »
Well, well!
In my defense, I will say that I don't have debug symbols for version 3.2.2/3.2.4, so I couldn't diagnose it properly. And on FPC [main], the behavior did not repeat itself.
Thank you)
Logged
I may seem rude - please don't take it personally
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
FPC development
(Moderators:
FPK
,
Tomas Hajny
) »
[SOLVED] FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️)
TinyPortal
© 2005-2018