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
Can we wallgraden this, p...
by
Gustavo 'Gus' Carreno
[
Today
at 01:37:28 am]
Lazarus for Windows on aa...
by
Tourniquet
[
Today
at 01:26:41 am]
Status of FPC 3.4.0 or FP...
by
Martin_fr
[
Today
at 01:03:54 am]
it2play - IT/S3M module r...
by
hukka
[
Today
at 01:02:01 am]
Debian removes FPC/Lazaru...
by
dbannon
[
Today
at 12:57:16 am]
Rolling releases Lazarus[...
by
dbannon
[
Today
at 12:44:27 am]
GridPrinter requirements ...
by
sfeinst
[
Today
at 12:39:07 am]
Here's how to show colour...
by
Pallzi
[
Today
at 12:13:38 am]
Lazarus programs look ugl...
by
the_magik_mushroom
[February 07, 2026, 11:54:12 pm]
LCL Web Native with D2Bri...
by
xinyiman
[February 07, 2026, 10:43:41 pm]
Recommendations for wasm3...
by
PascalDragon
[February 07, 2026, 10:38:15 pm]
Migrating SK1 Project to ...
by
jamie
[February 07, 2026, 09:13:45 pm]
[SOLVED] The main screen ...
by
Hansvb
[February 07, 2026, 06:50:52 pm]
Transparent Form: Some Th...
by
LV
[February 07, 2026, 05:53:43 pm]
[SOLVED] Don't find the U...
by
Hartmut
[February 07, 2026, 05:23:36 pm]
[Closed]FPC error when us...
by
marcov
[February 07, 2026, 04:19:50 pm]
Sidmon Player Library
by
Gigatron
[February 07, 2026, 02:56:58 pm]
Lazaris IDE v4.4 - extrem...
by
backprop
[February 07, 2026, 02:16:58 pm]
Who is absent from year 2...
by
backprop
[February 07, 2026, 01:52:41 pm]
[RESOLVED] Log in to web ...
by
rvk
[February 07, 2026, 01:26:35 pm]
Help with diabetes projec...
by
slicke
[February 07, 2026, 12:13:28 pm]
FPC and Lazarus coding st...
by
Martin_fr
[February 07, 2026, 09:21:46 am]
Free Pascal for a small e...
by
cdbc
[February 07, 2026, 07:06:42 am]
FPCUnit returns 2 error l...
by
n7800
[February 07, 2026, 02:43:55 am]
Defaults for features
by
Martin_fr
[February 07, 2026, 02:07:48 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️) (Read 323 times)
ALLIGATOR
Sr. Member
Posts: 362
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: 390
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: 362
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