[erlang-questions] try to find the crash report (a challenge)

34 views
Skip to first unread message

Joel Reymont

unread,
Dec 1, 2011, 7:59:42 AM12/1/11
to Erlang Questions
https://github.com/wagerlabs/mod_crash

This is a super-simple httpd plugin module that crashes.

I cannot find the crash report, can you?

Help!

--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------

_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Joel Reymont

unread,
Dec 1, 2011, 8:17:58 AM12/1/11
to Erlang Questions
Could this be a problem with the supervision tree of inets?

Yurii Rashkovskii

unread,
Dec 1, 2011, 8:34:49 AM12/1/11
to erlang-pr...@googlegroups.com, Erlang Questions
The problem is in httpd. httpd_request_handler has this:

    PROCESSED = (catch Module:Function([Data | Args])),

so it will swallow your crash. Besides, the case statement right after that seems to be fairly wrong. It has an all-catch clause NewMFA, and it assumes PROCESSED is a new MFA if it is nothing that matched before. That means, an EXIT tuple will be treated as a new MFA. Unless I'm missing something, this is just wrong.

Joel Reymont

unread,
Dec 1, 2011, 8:36:26 AM12/1/11
to erlang-pr...@googlegroups.com, Erlang Questions
You can get the crash reports in /tmp/error.log (in my case).

This works if the list of httpd modules is set to [mod_log, mod_crash].

There's still nothing shown via regular SASL channels.

--------------------------------------------------------------------------

Ahmed Omar

unread,
Dec 2, 2011, 5:03:28 AM12/2/11
to Joel Reymont, erlang-pr...@googlegroups.com, Erlang Questions
Well, there won't be crash report anywhere because inets does catch the exception in httpd_resonse.erl 

_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions



--
Best Regards,
- Ahmed Omar
Follow me on twitter

Ahmed Omar

unread,
Dec 2, 2011, 5:04:57 AM12/2/11
to Joel Reymont, Erlang Questions
No. It's just that the exception is caught in httpd_response.erl

traverse_modules(ModData,[Module|Rest]) ->
    ?hdrd("traverse modules", [{callback_module, Module}]), 
    case (catch apply(Module, do, [ModData])) of

Ahmed Omar

unread,
Dec 2, 2011, 5:12:39 AM12/2/11
to Joel Reymont, erlang-pr...@googlegroups.com, Erlang Questions
And what you get in error.log is just a formatted message after catching the exception
case (catch apply(Module, do, [ModData])) of
{'EXIT', Reason} ->
   ?hdrd("traverse modules - exit", [{reason, Reason}]), 
   String = 
lists:flatten(
 io_lib:format("traverse exit from apply: ~p:do => ~n~p",
[Module, Reason])),
Reply all
Reply to author
Forward
0 new messages