Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove explicit stack size from api-test #954

Merged
merged 2 commits into from
Mar 7, 2025
Merged

Conversation

saghul
Copy link
Contributor

@saghul saghul commented Mar 7, 2025

Let it overflow.

saghul added 2 commits March 7, 2025 09:55
When compiling with MSVC (that includes ClangCL) it defaults to 1MB,
which means our default of 1MB in the interpreter is too large to detect
actual overflow.

When compiling with MinGW GCC/Clang it defaults to 2MB.

Set it to 8MB like Linux for some consistency.
@saghul saghul marked this pull request as ready for review March 7, 2025 09:08
@saghul saghul requested a review from bnoordhuis March 7, 2025 09:08
@saghul
Copy link
Contributor Author

saghul commented Mar 7, 2025

@bnoordhuis PTAL. This one went deeper than I thought 😅 This should unblock the meson build. Also TIL a good number of things :-)

For future reference: The exit code was -1073741571. Then, I won't deny ChatGPT helped me figure out why that code was relevant: 0xC00000FD in hexadecimal indicates a Stack Overflow Exception (STATUS_STACK_OVERFLOW).

if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8388608")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,8388608")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does changing CMAKE_EXE_LINKER_FLAGS affects downstream projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK it only affects this one, but all targets. Since we likely want this on any exe we create from this project I went with the general flag rather than the target specific one.

@saghul saghul merged commit 857c42b into master Mar 7, 2025
61 checks passed
@saghul saghul deleted the windows-fixstackoverflow branch March 7, 2025 19:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants