[erlang-questions] How to interpret lambda stacktrace?

52 views
Skip to first unread message

Maxim Treskin

unread,
Feb 16, 2010, 11:33:55 PM2/16/10
to erlang-q...@erlang.org
Hello

Sometime I have writing code with nested lambda-functions and
list-comprehensions.
If this code contains, I have such stacktraces in crash report:

exception exit: {function_clause,
[{asg_alt,'-amm_handle_ev/3-fun-5-',
[undefined,#Fun<asg_alt.15.120311847>,
pass]},
{asg_alt,'-amm_handle_ev/3-lc$^3/1-3-',2},
{asg_alt,'-amm_handle_ev/3-lc$^3/1-3-',2},
{asg_alt,amm_handle_ev,3},
{asg_pd,state_ready,2},
{gen_fsm,handle_msg,7},
{proc_lib,init_p_do_apply,3}]}

Is there any way to understand which of lambda crashes? So, when
function contains '-lc$' I can say that this is list-comprehension
function, '/3' - arity of top function, but what means '^3/1-3-' and
'-fun-5-' ? Is this values has some relation with order of its
definition or not?

Thank you

--
Maxim Treskin

________________________________________________________________
erlang-questions (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-questio...@erlang.org

Robert Virding

unread,
Feb 17, 2010, 10:49:21 AM2/17/10
to Maxim Treskin, erlang-q...@erlang.org
The first part of the name, -amm_handle_ev/3- in your case is the
function name/arity in which the fun or comprehension is defined.
Then:

- for a fun this is followed by -fun- and the index of the fun within
the defining function. So "-fun-5-" means the fifth fun within the
function, as a whole.

- for a comprehension it is "-lc$^" and the index of the comprehension
within the module. It can be either "lc", "blc" or "lbc" depending on
type of comprehension. The "$^" has no significance as such.

These are basically just funny names which are most likely unique. Two
important points:

- NO this naming is not defined anywhere, it is purely internal.
- NO there is no guarantee that it won't be changed in the future.

So use it for info but be warned.

Robert

Maxim Treskin

unread,
Feb 17, 2010, 11:04:42 AM2/17/10
to Robert Virding, erlang-q...@erlang.org
Thank you very much, Robert!
Reply all
Reply to author
Forward
0 new messages