~sircmpwn/hare#935: 
debug::backtrace doesn't work with +libc binaries

Originally reported at https://lists.sr.ht/~sircmpwn/hare-users/%3CCADa827F-ogRFG5pGo5byn8FLAui-xtMhHUUX8j9MKbjYYCEOnA@mail.gmail.com%3E

Turns out that it happens independently of -lx11, whenever a C library is pulled in.

The segfault happens during stack frame walking, when attempting to walk past the outermost frame. My guess is that we assume too much about what the outermost frame says about its (nonexistent) parent, and that assumption is not correct when the outermost frame is set up by libc.

Status
RESOLVED FIXED
Submitter
~turminal
Assigned to
No-one
Submitted
9 months ago
Updated
9 months ago
Labels
+libc bug stdlib

~sircmpwn 9 months ago

The problem is that the outermost frame is not a frame pointer at all because it enters code which was generated without frame pointers, to the fp register is just used as a temporary. If it were zero it would signal the termination of the stack frame, but since it's a temporary it's just garbage, so we dereference garbage and crash.

~sircmpwn REPORTED FIXED 9 months ago

Drew DeVault referenced this ticket in commit f2b6348.

~sircmpwn 9 months ago

Drew DeVault referenced this ticket in commit 72ad406.

~torresjrjr 9 months ago

Drew DeVault referenced this ticket in commit 72ad406.

Register here or Log in to comment, or comment via email.