new stack backtrace

Robert Virding rv@REDACTED
Tue Dec 14 11:09:37 CET 1999


Martin Bjorklund <mbj@REDACTED> writes:
>The new stack backtrace printout on failures is great!  But I just
>spent half an hour trying to find out what was wrong with the
>following function in the module 'bt_conf':
>
>
>init_gws(Node) ->
>    Cf  = bt_cmd:bgetconfig(Node, cluster),
>...
>
>Obviously, I have no calls to config_file:parse_string in
>init_gws/1, as indicated by the backtrace.  But, init_gws calls
>bt_cmd:get_config, which looks like this:
>
>bgetconfig(Node, Type) ->
>    Cmd = cmd("bgetconfig"),
>    ibgetconfig(Cmd ++ " -t " ++ atom_to_list(Type) ++ " " ++
>		atom_to_list(Node)).
>
>ibgetconfig(Cmd) ->
>    Res = os:cmd(Cmd),
>    config_file:parse_string(Res).
>
>
>... and there's the error.
>
>
>The first question is why these last two calls don't show up in the
>stack backtrace?

Easy.  Seeing the call to config_file:parse_string/1 is the LAST CALL in 
ibgetconfig/1 which is the LAST CALL in bgetconfig/2 then the last call 
optimisation removes all traces of bgetconfig/2 and ibgetconfig/1.

Abnd as you know we can't do without the LCO. :-)

	Robert

-- 
Robert Virding                          Tel: +46 (0)8 692 22 12
Bluetail AB                             Email: rv@REDACTED
Hantverkargatan 78                      WWW: http://www.bluetail.com
SE-112 38 Stockholm, SWEDEN
"Folk säger att jag inte bryr mig om någonting, men det skiter jag i".





More information about the erlang-questions mailing list