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
Qt6 / X11: problem with G...
by
zeljko
[
Today
at 12:56:02 pm]
Any way to exclude terms ...
by
old_DOS_err
[
Today
at 12:40:02 pm]
can't add new treenode
by
Martin_fr
[
Today
at 12:29:25 pm]
Need help converting a C+...
by
Zvoni
[
Today
at 12:21:24 pm]
"F2": possible bug in IDE...
by
jamie
[
Today
at 12:17:28 pm]
How to load read large CS...
by
Xenno
[
Today
at 12:08:44 pm]
$ifdef highlighting
by
Martin_fr
[
Today
at 11:26:52 am]
Lazarus Bugfix Release 4...
by
Martin_fr
[
Today
at 11:11:18 am]
Devin - my new lover (CEF...
by
Nicole
[
Today
at 10:16:35 am]
Why this code is working ...
by
Tommi
[
Today
at 09:53:10 am]
BalloonHint in Trayicons ...
by
CM630
[
Today
at 09:47:18 am]
About ORM framework
by
cdbc
[
Today
at 09:27:58 am]
Need help with compiling ...
by
Thausand
[
Today
at 08:33:29 am]
TMSSQLConnection in MacOS...
by
Zvoni
[
Today
at 08:26:26 am]
[SOLVED] Assembler error ...
by
Thausand
[
Today
at 08:22:45 am]
Recomendations for conver...
by
paweld
[
Today
at 07:44:53 am]
Possible LMAX Disruptor (...
by
Thaddy
[
Today
at 07:39:42 am]
Need help to build FPC fo...
by
dbannon
[
Today
at 04:00:40 am]
fishing problem ;)
by
speter
[
Today
at 03:20:14 am]
Anchoring controls with d...
by
jamie
[
Today
at 02:54:45 am]
Hints in TTrayIcon
by
dbannon
[
Today
at 02:11:20 am]
Just Curious: When has an...
by
Martin_fr
[December 04, 2025, 11:28:44 pm]
Cannot find Online Packag...
by
dseligo
[December 04, 2025, 10:57:42 pm]
Compiled package
by
Ed78z
[December 04, 2025, 10:26:14 pm]
ddebian 12 input err!
by
PascalDragon
[December 04, 2025, 09:39:53 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️) (Read 229 times)
ALLIGATOR
Sr. Member
Posts: 305
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: 366
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: 305
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