Skip to content

Commit

Permalink
fix: segfault in panic when statically compiled
Browse files Browse the repository at this point in the history
Co-authored-by: RoadToLP <[email protected]>
  • Loading branch information
2 people authored and lerno committed Oct 12, 2024
1 parent e6c9cfe commit 6a2957f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/std/libc/os/posix.c3
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const int RTLD_LAZY = 0x1;
const int RTLD_NOW = 0x2;
const int RTLD_LOCAL = 0x4;
const int RTLD_GLOBAL = 0x8;
const int RTLD_NODELETE = 0x1000;

def Pid_t = int;
def Uid_t = uint;
Expand Down
2 changes: 1 addition & 1 deletion lib/std/os/posix/process.c3
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 6a2957f

Please sign in to comment.