[erlang-bugs] A funny bug

Anthony Ramine <>
Thu Aug 1 22:29:19 CEST 2013


Hello,

It's not that you should not use prim_eval in this particular manner, you should not use prim_eval at all. This is probably not the only primitive that can make the VM segfault.

That being said, when I implemented that patch the function didn't call a given closure but an hard-coded remote function in prim_eval; maybe we should put that back?

Regards,

-- 
Anthony Ramine

Le 1 août 2013 à 20:06, Tony Rogvall a écrit :

> I was inspecting the new, and long awaited for, fix of 'receive' in erl_eval.
> 
> I could not help myself to wonder what would happened if:
> 
> 5> self() ! x, prim_eval:'receive'(fun(X) -> receive Y -> Y end end, 1000). 
> 
> Bus error: 10
> 
> I know you should not use prim_eval in this manner, but I tend to ignore recommendations.
> But this construct should probably not crash the VM.
> 
> /Tony
> 
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs



More information about the erlang-bugs mailing list