HiPE crash with crypto and R14A

Paul Guyot <>
Sat Jun 26 20:05:41 CEST 2010


Hello,

I noticed the following reproduceable crash (segment fault) on R14A with HiPE and crypto 2.0 on both MacOS X 64bits build and FreeBSD 64bits build. It may be related to the fact that crypto now uses NIF.

hipe_crash.erl:
----
-module(hipe_crash).
-export([crash/0]).

crash() ->
    ok = application:start(crypto),
    Stage1 = crypto:sha("test"),
    crypto:sha(Stage1).
----
erlc +native hipe_crash.erl
erl -eval 'hipe_crash:crash()'

Compiling without +native does not yield a crash.

crypto:sha("test") is <<169,74,143,229,204,177,155,166,28,76,8,115,211,145,233,135,152,47,187,211>>, yet the following code does not crash :

    ok = application:start(crypto),
    crypto:sha(<<169,74,143,229,204,177,155,166,28,76,8,115,211,145,233,135,152,47,187,211>>).

Regards,

Paul



More information about the erlang-bugs mailing list