-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Fix stack pointer retrieval in jl_backtrace_from_here #42585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
2635252
2990b77
6ca4eb5
ac3468d
458cb89
7a338ae
4eb674d
e4a1edd
fcae973
a935c7a
d284a34
b51e198
24c2aa1
03e5129
4fcda37
9270661
778def1
d0cedca
6194475
0a07e32
9e80b08
715c673
de860b2
e37c0d5
3f8868a
4b6a27f
66ff7e9
4c62333
df9d96d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,8 +114,6 @@ static int jl_unw_stepn(bt_cursor_t *cursor, jl_bt_element_t *bt_data, size_t *b | |
from_signal_handler = 0; | ||
continue; | ||
} | ||
if (sp) | ||
sp[n] = thesp; | ||
// For the purposes of looking up debug info for functions, we want | ||
// to harvest addresses for the *call* instruction `call_ip` during | ||
// stack walking. However, this information isn't directly | ||
|
@@ -168,6 +166,8 @@ static int jl_unw_stepn(bt_cursor_t *cursor, jl_bt_element_t *bt_data, size_t *b | |
} | ||
} | ||
bt_entry->uintptr = call_ip; | ||
if (sp) | ||
sp[n] = thesp; | ||
n++; | ||
Comment on lines
168
to
171
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix 2: set All calls to $ git grep 'jl_unw_stepn('
src/stackwalk.c:static int jl_unw_stepn(bt_cursor_t *cursor, jl_bt_element_t *bt_data, size_t *bt_size,
src/stackwalk.c: jl_unw_stepn(&cursor, bt_data, &bt_size, NULL, maxsize, 0, &pgcstack, 1);
src/stackwalk.c: jl_unw_stepn(&cursor, bt_data, &bt_size, NULL, maxsize, skip + 1, &pgcstack, 0);
src/stackwalk.c: have_more_frames = jl_unw_stepn(&cursor, (jl_bt_element_t*)jl_array_data(ip) + offset,
src/stackwalk.c: jl_unw_stepn(&cursor, bt_data, &bt_size, NULL, maxsize, 0, &pgcstack, 1); |
||
} | ||
// NOTE: if we have some pgcstack entries remaining (because the | ||
|
@@ -259,8 +259,8 @@ JL_DLLEXPORT jl_value_t *jl_backtrace_from_here(int returnsp, int skip) | |
jl_array_grow_end(ip, maxincr); | ||
uintptr_t *sp_ptr = NULL; | ||
if (returnsp) { | ||
sp_ptr = (uintptr_t*)jl_array_data(sp) + offset; | ||
jl_array_grow_end(sp, maxincr); | ||
sp_ptr = (uintptr_t*)jl_array_data(sp) + offset; | ||
Comment on lines
261
to
+263
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix 1: Take the pointer after grow, to avoid invalidation. |
||
} | ||
size_t size_incr = 0; | ||
have_more_frames = jl_unw_stepn(&cursor, (jl_bt_element_t*)jl_array_data(ip) + offset, | ||
|
Uh oh!
There was an error while loading. Please reload this page.