Forum > macOS / Mac OS X
Lazarus on MacOS reporting stackoverflow
CorBee:
Hi,
I am developing code using Lazarus that uses large dynamic memorybased arrays. These 2D arrays are sized using a standard setlength(name, dimension X, dimension Y) command. When I compile and run this code for Linux/windows there are no errors even with all debug-options activated. When the same code is compiled on a Mac (11.6 MacOS) this leads to stackoverflow errors during the resizing of the arrays. My co-worker (who has a mac) has to change the stacksize (in the compiler settings) from the default 0 to >500Kb. Is this normal behaviour for lazarus ? Do people on a Mac have to declare the stacksize ?
cheers
Cor
Jonas Maebe:
The default stack size on macOS is 8MB. I'm not sure where the default 0 comes from in your case.
That said, stack checking is not something that's used very often on modern operating systems, since most have a dynamically growing stack (and they will give a hardware exception if you try to grow it beyond the reserveed space). So it's possible there's an error in the stack checking functionality on macOS that's not known. Is this on an Intel or M1/M2 Mac?
CorBee:
Hi
Thanks for the fast answer. I have attached a screenshot from the project options. As you can see the compiler directive
for stacksize is normally set to 0. This is working on Linux/Windows.
My co-worker could only get the project working when he changed this setting.
Its according to me not an M1/M2 as he stated before.
cheers
Cor
Jonas Maebe:
I don't think Lazarus does anything special when it's set to 0. If you click on "Show Options" at the bottom of that pane, I think you'll notice it won't actually list a -Cs0 option. Still, the default should indeed work.
CorBee:
unfortunately it does not ... and its unclear why it throws out stackoverflow errors. The code that generates this is not very complex as stated before.
We will keep puzzling ...
Navigation
[0] Message Index
[#] Next page