[erlang-bugs] erl_eval passes invalid argument to try clauses

José Valim <>
Mon Dec 31 16:13:20 CET 2012

According to the Erlang Abstract Format, a catch clause for try expressions
expects three arguments: the kind (which is an error, exit or throw), the
value (which is usually matched against) and a third undocumented argument
which is a cons list.

Taking a quick look around shows that this cons cell contains the
stacktrace and a number:


Which I was able to verify in practice.
This seems to work fine except that erl_eval does not pass a cons cell as
the third argument but only the stacktrace:


In theory, since an Erlang developer cannot specify this third argument
using Erlang syntax, this difference does not actually matter. But in
practice part of the Erlang/OTP stack may actually rely on this third
argument, so I have decided to report this as a bug.

In any case, I would be interested to know the purpose of this third
Is it meant to be internal to the Erlang VM or should it be documented?

Thank you and happy new year!

*José Valim*
Skype: jv.ptec
Founder and Lead Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20121231/aeb4aef5/attachment.html>

More information about the erlang-bugs mailing list