Open alfreb opened 5 months ago
Some additional references:
strdup
from init_libc
: https://github.com/includeos/IncludeOS/blob/v0.16.0-release/src/platform/x86_pc/init_libc.cpp#L106strdup
implementation: https://github.com/includeos/IncludeOS/blob/v0.16.0-release/src/crt/string.c#L23This may be resolved with #2273
The best repro case was found with https://github.com/includeos/IncludeOS/pull/2251, preserved until fixed in https://github.com/alfreb/IncludeOS/tree/memory-ghost-repro . On that branch, starting at commit e81fb7c7da96b8cae8b43d406b6d868b7d09b66e reproduce with
( Requires https://github.com/includeos/vmrunner )
Backtrace was fetched from gdb after building musl with debug symbols, and seeing the same issue:
The call to
strdup
in init_libc causes a crash in libc during malloc. Our heap should be ready at that time, since this is afterinit_heap
.Possible culprit:
enframe
asserts: https://git.musl-libc.org/cgit/musl/tree/src/malloc/mallocng/meta.h?h=v1.2.4#n205a_crash
https://git.musl-libc.org/cgit/musl/tree/src/exit/abort.c?h=v1.2.5#n27, after some system calls.alloc_group
calls enframe: https://git.musl-libc.org/cgit/musl/tree/src/malloc/mallocng/malloc.c#n267alloc_group
entry: https://git.musl-libc.org/cgit/musl/tree/src/malloc/mallocng/malloc.c#n174Note that I think this bug is also present on master, possibly the main reason for master not booting at the moment.
Things I've tried