Skip to content

0.5.2 --- an image's main thread has a thread's stack on Windows - #32

Merged
Sunrisepeak merged 2 commits into
mainfrom
openkal-0.24.3
Nov 7, 2026
Merged

Sunrisepeak merged 2 commits into
mainfrom
openkal-0.24.3

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

An image is entered on okrun's main thread. On Windows that thread's stack is the executable's reservation, the linker's default 1 MiB (measured in the PE header of the released okrun.exe), while openkal-windows gives every other thread at least 8 MiB and Linux and macOS give the main thread 8 MiB. clangd.okb with --sync indexes the MSVC headers on its main thread and ended in STATUS_STACK_OVERFLOW (0xC00000FD) on windows-2022, where the native clangd passes (mcppls-clangd image e2e).

  • tools/mcpp.toml: on Windows the tools link with --stack,8650752 (8 MiB + 256 KiB, a thread's default and openkal-windows' guard slack).
  • examples/stack: an image that recurses through 6 MiB of frames on its main thread; CI runs it on the four hosts.
  • 0.5.2 for the archive's packages.

Verified locally: the cross-built okrun.exe reserves 8650752 bytes; under wine the stack image prints its line with the new okrun.exe and dies silently with the 0.5.1 one; okrun on Linux runs it.

Co-authored-by: speak-agent 248744407+speak-agent@users.noreply.github.com

Sunrisepeak and others added 2 commits November 7, 2026 17:59
An image is entered on okrun's main thread, whose stack on Windows is the
executable's reservation, the linker's 1 MiB; clangd.okb indexing the MSVC
headers on its main thread ended in STATUS_STACK_OVERFLOW. okrun.exe now
reserves 8 MiB + 256 KiB, a thread's default under openkal-windows. The stack
example recurses through 6 MiB on the main thread on every system.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
lld-link on the MSVC ABI takes /STACK, the MinGW driver --stack.

Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
@Sunrisepeak
Sunrisepeak merged commit ba1f2a3 into main Nov 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant