[erlang-questions] Segmentation fault in tests

Sverker Eriksson sverker.eriksson@REDACTED
Mon Mar 18 11:29:54 CET 2013


Manuel A. Rubio "Bombadil" wrote:
> Hi,
>
> I'm using exmpp for development, and eunit for tests. When I need to 
> launch tests, I write several times:
>
> application:start(exmpp),
> ...
> application:stop(exmpp).
>
> In some cases this throws an "Segmentation fault" and stop erlang VM. 
> I try this code in the shell:
>
> [ begin application:start(exmpp), aplication:stop(exmpp), ok end || X 
> <- lists:seq(1,100) ].
>
> And the code fails, not always, but very often... I think could be a 
> problem with unload and load the code when the port isn't unloaded 
> completly... any suggestion?
>
Looking at exmpp I see that it contains a linked-in driver. I would 
consider that as prime suspect.

Enable core dump generation:

[bash]> ulimit -c unlimited

Run test to generate core dump file.
Look at core dump:

 > gdb /path/to/otp-release/erts-x.y.z/beam.smp -c core.xxx

(gdb) backtrace
:
:


/Sverker, Erlang/OTP Ericsson





More information about the erlang-questions mailing list