Skip to content

Instantly share code, notes, and snippets.

@josevalim

josevalim/error Secret

Created November 25, 2012 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josevalim/9ae21eb51928d7de5f23 to your computer and use it in GitHub Desktop.
Save josevalim/9ae21eb51928d7de5f23 to your computer and use it in GitHub Desktop.
HiPE compilation fails when using on_load attribute
Erlang R15B02 (erts-5.9.2) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false] [dtrace]
Eshell V5.9.2 (abort with ^G)
1> c(foo, [native]).
<HiPE (v 3.9.2)> EXITED with reason {'trans_fun/2',on_load} @hipe_beam_to_icode:1103
=ERROR REPORT==== 25-Nov-2012::18:48:29 ===
Error in process <0.88.0> with exit value: {{badmatch,{'EXIT',{{hipe_beam_to_icode,1103,{'trans_fun/2',on_load}},[{hipe_beam_to_icode,trans_fun,2,[{file,"hipe_beam_to_icode.erl"},{line,1103}]},{hipe_beam_to_icode,trans_fun,2,[{file,"hipe_beam_to_icode.erl"},{line,253}]},{hipe_beam_to_icode...
foo.erl:none: internal error in native_compile;
crash reason: {{badmatch,
{'EXIT',
{{hipe_beam_to_icode,1103,{'trans_fun/2',on_load}},
[{hipe_beam_to_icode,trans_fun,2,
[{file,"hipe_beam_to_icode.erl"},{line,1103}]},
{hipe_beam_to_icode,trans_fun,2,
[{file,"hipe_beam_to_icode.erl"},{line,253}]},
{hipe_beam_to_icode,trans_mfa_code,5,
[{file,"hipe_beam_to_icode.erl"},{line,124}]},
{hipe_beam_to_icode,trans_beam_function_chunk,2,
[{file,"hipe_beam_to_icode.erl"},{line,109}]},
{hipe_beam_to_icode,'-module/2-lc$^1/1-1-',2,
[{file,"hipe_beam_to_icode.erl"},{line,105}]},
{hipe,get_beam_icode,4,
[{file,"hipe.erl"},{line,597}]},
{hipe,'-run_compiler_1/3-fun-0-',4,
[{file,"hipe.erl"},{line,657}]}]}}},
[{hipe,get_beam_icode,4,[{file,"hipe.erl"},{line,596}]},
{hipe,'-run_compiler_1/3-fun-0-',4,
[{file,"hipe.erl"},{line,657}]}]}
-module(foo).
-on_load(do_nothing/0).
%% Exporting the function doesn't affect the outcome
%% -exports([do_nothing/0]).
do_nothing() -> ok.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment