fix: segfault in panic when statically compiled

Co-authored-by: RoadToLP <ilya.titoff2013@yandex.ru>
This commit is contained in:
PavelBlinnikov
2024-10-12 21:02:07 +03:00
committed by Christoffer Lerno
parent e6c9cfed42
commit 6a2957faf7
2 changed files with 2 additions and 1 deletions

View File

@@ -61,7 +61,7 @@ def BacktraceFn = fn CInt(void** buffer, CInt size);
fn CInt backtrace(void** buffer, CInt size)
{
if (size < 1) return 0;
void* handle = libc::dlopen("libc.so.6", libc::RTLD_LAZY);
void* handle = libc::dlopen("libc.so.6", libc::RTLD_LAZY|libc::RTLD_NODELETE);
if (handle)
{
BacktraceFn backtrace_fn = libc::dlsym(handle, "backtrace");