Skip to content

Commit

Permalink
Test the current thread's frame in heap snapshot
Browse files Browse the repository at this point in the history
Fixes a bug that can in the best case cause a SEGV (which is how I
discovered it), and in the worst case lead to missing data in the
report.
  • Loading branch information
jnthn committed Feb 12, 2018
1 parent 004680a commit cf523c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/profiler/heapsnapshot.c
Expand Up @@ -513,7 +513,8 @@ static void process_workitems(MVMThreadContext *tc, MVMHeapSnapshotState *ss) {
case MVM_SNAPSHOT_COL_KIND_THREAD_ROOTS: {
MVMThreadContext *thread_tc = (MVMThreadContext *)item.target;
MVM_gc_root_add_tc_roots_to_worklist(thread_tc, NULL, ss);
if (thread_tc->cur_frame && !MVM_FRAME_IS_ON_CALLSTACK(thread_tc, tc->cur_frame))
if (thread_tc->cur_frame &&
!MVM_FRAME_IS_ON_CALLSTACK(thread_tc, thread_tc->cur_frame))
add_reference_const_cstr(tc, ss, "Current frame",
get_frame_idx(tc, ss, thread_tc->cur_frame));
break;
Expand Down

0 comments on commit cf523c8

Please sign in to comment.