Fix CI test segfault: clamp stack ulimit before odin test
Root cause found via gdb backtrace on the runner (thread::pool_init crashed from main -> testing runner): the CI container sets `ulimit -s unlimited`, so getrlimit(RLIMIT_STACK) returns RLIM_INFINITY. core:thread passes that to pthread_attr_setstacksize, pthread_create fails, and thread.create() returns nil, which core:testing's pool_init dereferences without a nil check. Reproduced and confirmed fixed in an ubuntu:24.04 container with the same Odin build. `just test` now clamps the stack limit before running odin test. Also removes the gdb diagnostic step added to debug this. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0776e8e4b9
commit
06f4e9ed11
3 files changed
+6
-13
No files matched your search
@@ -28,6 +28,11 @@ check:
|
||||
# Run the test suite (single-threaded: the tests share the memory game's global state)
|
||||
test:
|
||||
mkdir -p {{build_dir}}
|
||||
# If the stack rlimit is "unlimited" (RLIM_INFINITY, as some CI/container hosts set it),
|
||||
# Odin's core:thread passes that straight to pthread_attr_setstacksize, pthread_create
|
||||
# then fails, and thread.create() returns nil - which core:testing's pool_init
|
||||
# dereferences unconditionally, segfaulting the whole test binary. Clamp it.
|
||||
ulimit -s 8192
|
||||
odin test tests -vet -define:ODIN_TEST_THREADS=1 -out:{{build_dir}}/tests
|
||||
|
||||
# Optimized native build into build/<os>/, with the assets it needs at runtime
|
||||
|
||||
Reference in new issue
Block a user