Re: [hatari-devel] windows build failing on cirrus-ci

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 24.4.2024 20.03, Christian Zietz wrote:
Nicolas Pomarède schrieb:

Yes, the problem is in the new function "loadSymFile"

I don't know if this is supported in a more recent version of visual C
than the one used in cirrus-ci,

I am always very cautions about variable length arrays, anyway. Like any local variable, they are allocated on the stack; but with a VLA one can only cross one's fingers to hope that it fits without causing a stack exhaustion.

AFAIK all the modern OSes have virtual memory and automatically grow the stack as needed (in main thread, and Hatari code is not threaded).

I.e. if (main thread) stack runs out, either process has ran out of (64-bit) address space, or machine it's running, is out of RAM+swap and anything at all will fail.

(On Linux, threads have nowadays I think at least 8MB of stack by default, unless process changes it, but as stated Hatari code is not threaded, although some library functionality used by it may thread.)


See https://wiki.sei.cmu.edu/confluence/display/c/ARR32-C.+Ensure+size+arguments+for+variable+length+arrays+are+in+a+valid+range

... which incidentally also happens to mention: "Variable length arrays are not supported by Microsoft compilers." This is confirmed by https://learn.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=msvc-170: "Variable length array (VLA) support isn't planned. VLAs provide attack vectors [...]".

Ok, I've changed it to PATH_MAX array.


	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/