[erlang-bugs] Combination of erl flags "+B" and "-smp enable" renders producing crash dumps impossible
Masatake Daimon
daimon@REDACTED
Wed Feb 17 09:10:22 CET 2016
I just found there was a public bug tracker so I created an issue there:
http://bugs.erlang.org/browse/ERL-94
Sorry for the noise to ML.
On 02/17/16 15:08, Masatake Daimon wrote:
> Hello,
>
> I found a bug in OTP 18.2.1 on Linux. When the erl flag "+B" is given,
> and SMP is enabled, erts fails to produce a crash dump but instead kills
> itself with SIGUSR2:
>
>> $ erl -smp enable -noshell -eval 'erlang:halt("Hello").'
>>
>> Crash dump is being written to: erl_crash.dump...done
>> Hello
>> $ echo $?
>> 1
>> $ erl -smp disable +B -noshell -eval 'erlang:halt("Hello").'
>>
>> Crash dump is being written to: erl_crash.dump...done
>> Hello
>> $ rm erl_crash.dump
>> $ erl -smp enable +B -noshell -eval 'erlang:halt("Hello").'
>> User defined signal 2
>> $ echo $?
>> 140
>> $ ls erl_crash.dump
>> ls: erl_crash.dump: No such file or directory
>
> The reason for this behavior is as follows:
> * When the +B flag is given, erl_start() (beam/erl_init.c:2133) skips
> calling init_break_handler().
> * But init_break_handler() (sys/unix/sys.c:970) is the only function
> which registers a signal handler for SIGUSR2.
> * When a crash dump is being produced, erl_crash_dump_v()
> (beam/break.c:694) sends SIGUSR2 to each scheduler thread.
> * Since there is no handler for SIGUSR2, the whole process terminates.
>
> I'm posting the report to the ML instead of submitting a pull request
> because I'm not sure how to fix this properly. This is especially
> problematic for escripts because main() (etc/common/escript.c:459)
> automatically sets the +B flag. I hope someone familiar with these
> things can resolve the problem.
>
> Kind regards,
> Masatake Daimon
--
大門 正岳 <daimon@REDACTED>
More information about the erlang-bugs
mailing list