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
[Windows] UTF8 encoding w...
by
bstewart
[
Today
at 08:44:15 pm]
Anti "churning" in solita...
by
andersonscinfo
[
Today
at 08:37:14 pm]
Default, Manual Initializ...
by
Okoba
[
Today
at 07:25:07 pm]
[Solved] Exception in TFi...
by
d.oertel
[
Today
at 06:18:05 pm]
Perlin Noise Map With BGR...
by
Dzandaa
[
Today
at 06:17:50 pm]
AdvancedHTTPServer: A Go-...
by
CynicRus
[
Today
at 05:06:13 pm]
Strings in Free Pascal: I...
by
BeniBela
[
Today
at 04:11:28 pm]
Lazreport. Sorting.
by
Thausand
[
Today
at 02:51:00 pm]
IStringList...
by
cdbc
[
Today
at 02:50:47 pm]
Animated Sine Beziers
by
Boleeman
[
Today
at 02:34:32 pm]
PadXml 1.0.0 – Portable A...
by
AlexanderT
[
Today
at 02:04:18 pm]
ThemeServices.OnThemeChan...
by
zeljko
[
Today
at 11:32:11 am]
What's wrong with my appl...
by
Thaddy
[
Today
at 09:49:16 am]
Very simple Style Manager...
by
sgj
[
Today
at 09:29:05 am]
Cross Compile for Dos on ...
by
Thaddy
[
Today
at 09:19:24 am]
Unit decfloat
by
srvaldez
[
Today
at 12:14:43 am]
Access violation during d...
by
Martin_fr
[January 19, 2026, 08:02:11 pm]
Adjacent rectangles not a...
by
jamie
[January 19, 2026, 06:21:09 pm]
Developing FreePascal on ...
by
HKPhysicist
[January 19, 2026, 03:53:13 pm]
Assigning firebird file n...
by
egsuh
[January 19, 2026, 10:18:22 am]
Postgres, ZEOS and Visual...
by
Thaddy
[January 19, 2026, 07:00:03 am]
Feature announcement: Fun...
by
Thaddy
[January 19, 2026, 06:55:15 am]
[SOLVED] Strange behavior...
by
jamie
[January 19, 2026, 12:08:12 am]
AVRPascal – free code edi...
by
ackarwow
[January 18, 2026, 10:18:12 pm]
help implementing frexp
by
srvaldez
[January 18, 2026, 09:25:07 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] FPC 3.2.2/4 problem with the old memory manager (or my code 💁♂️) (Read 298 times)
ALLIGATOR
Sr. Member
Posts: 332
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: 379
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: 332
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