[erlang-questions] Segmentation fault when writing erl_crash.dump

Christopher Faulet <>
Mon Feb 19 22:34:27 CET 2007


Jean-Sébastien Pédron a écrit :
> While working on a testsuite, erl crashed and beam segfaulted during
> erl_crash.dump write.
> 
> After some searches, the problem comes from the function
> `dump_externally' in erts/emulator/beam/erl_process_dump.c. It gives to
> the function `erts_to_external_format' a 1024-bytes buffer but one of
> the terms doesn't fit into this.
> 
[...]
> 
> By increasing the buffer length, it "fixes" the crash but I guess this
> isn't the best solution.

Hi,

I agree with you, a dynamic allocation for this buffer might be a
better solution.

By exploring the code, especially the file
"erts/emulator/beam/external.c" where the bug seems to appear, I found
the function "encode_size_struct" that could solve the problem.

So I did these simple patches to fix this for R11B-2 and R11B-3. They
are working on FreeBSD and Linux as well.

Regards,
-- 
Christopher Faulet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erl_process_dump_R11B-2.patch
Type: text/x-patch
Size: 721 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070219/b31c1df6/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erl_process_dump_R11B-3.patch
Type: text/x-patch
Size: 721 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070219/b31c1df6/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070219/b31c1df6/attachment-0002.bin>


More information about the erlang-questions mailing list