Hi,
This post is related to Seg Fault OTP 24.1.3 · Issue #9385 · erlang/otp · GitHub on the OTP repo. I posted the question, and am trying to reproduce the issue with OTP 26.2.5 at present, but am still searching for the root cause.
I have gone through the commits to erl_gc.c between tags OTP-24.1.3 and OTP-26.2.5, and cannot seem to find the commit that has fixed the problem, if it has been fixed at all (my OTP 26.2.5 test is still on-going)
Has anyone come across this issue, or know what the root cause is/was?
Here is a snippet of the core dump:
Core was generated by `/usr/lib/erlang/erts-12.1.3/bin/beam.smp -C multi_time_warp -K true -A 30 -- -r'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 do_minor (p=p@entry=0x70a9e168, live_hf_end=live_hf_end@entry=0x6c433368, mature=mature@entry=0x6c40ede0 "\200", mature_size=mature_size@entry=556, new_sz=<optimized out>, objv=<optimized out>,
objv@entry=0x7457ec88, nobj=nobj@entry=1) at beam/erl_gc.c:1545
--Type <RET> for more, q to quit, c to continue without paging--
1545 in beam/erl_gc.c
[Current thread is 1 (LWP 1310)]
And this is the line of code in question: otp/erts/emulator/beam/erl_gc.c at OTP-24.1.3 · erlang/otp · GitHub, and here is snippet for quick viewing (line with ptr = boxed_val(gval); )
for ( ; g_sz--; g_ptr++) {
gval = *g_ptr;
switch (primary_tag(gval)) {
case TAG_PRIMARY_BOXED: {
ptr = boxed_val(gval);
val = *ptr;
if (IS_MOVED_BOXED(val)) {
ASSERT(is_boxed(val));
*g_ptr = val;
} else if (ErtsInArea(ptr, mature, mature_size)) {
move_boxed(ptr,val,&old_htop,g_ptr);
} else if (ErtsInYoungGen(gval, ptr, oh, oh_size)) {
move_boxed(ptr,val,&n_htop,g_ptr);
}
break;
}
case TAG_PRIMARY_LIST: {
ptr = list_val(gval);
val = *ptr;
if (IS_MOVED_CONS(val)) { /* Moved */
*g_ptr = ptr[1];
} else if (ErtsInArea(ptr, mature, mature_size)) {
move_cons(ptr,val,&old_htop,g_ptr);
} else if (ErtsInYoungGen(gval, ptr, oh, oh_size)) {
move_cons(ptr,val,&n_htop,g_ptr);
}
break;
}
default:
break;
}
}
PS:
This issue has come out of Compile regular beam.smp and output symbols to file - BEAM Forum / BEAM Chat / Discussions - Erlang Forums, but I decided to keep them separate, as the Compile regular beam.smp and output symbols to file - BEAM Forum / BEAM Chat / Discussions - Erlang Forums is more about getting the debug information rather than fixing the specific bug.