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

Jean-Sébastien Pédron <>
Thu Feb 15 23:56:49 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

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.

In my testsuite, I was using `cover' and could reproduce the segfault
with the attached files:

  .
  |-- faulty.erl
  `-- src
      `-- source.erl

`faulty' uses `cover' to compile files in the `src/' directory, then
forces a crash by calling an undefined function. Here is an example:

dumbbell$ erlc -Wall faulty.erl
dumbbell$ erl -noshell -eval "faulty:go(), init:stop()."
{"init terminating in
do_boot",{undef,[{lists,foobar,[]},{faulty,go,0},{erl_eval,do_apply,5},
{erl_eval,exprs,5},{init,start_it,1},{init,start_em,1}]}}
Segmentation fault (core dumped)

This was tested on R11B-2 and R11B-3 on FreeBSD and Linux with the same
results.

By increasing the buffer length, it "fixes" the crash but I guess this
isn't the best solution.

Regards,

- --
Jean-Sébastien Pédron
http://www.dumbbell.fr/

PGP Key: http://www.dumbbell.fr/pgp/pubkey.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF1OUwa+xGJsFYOlMRAuixAJ9Jbsh+MpXdQPH09h+OOmjd5JZO2wCfcgnY
mQBdusXDVfL+Cn3NW5vQFOQ=
=+sx2
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: source.erl
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070215/dc016904/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: faulty.erl
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070215/dc016904/attachment-0001.ksh>


More information about the erlang-questions mailing list