<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 9, 2016 at 10:14 AM, Michael Catanzaro <span dir="ltr">&lt;<a href="mailto:mcatanzaro@igalia.com" target="_blank">mcatanzaro@igalia.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
The GTK+ port currently has an interesting web process crash on exit:<br>
<br>
pure virtual method called<br>
terminate called without an active exception<br>
<br>
I found the easiest way to debug it was to rebuild with a terminate<br>
handler set:<br>
<br>
    std::set_terminate([] {<br>
        CRASH();<br>
    });<br>
<br>
Even if such issues are very rare, I think it makes sense to set this<br>
up always, since a simple backtrace is a lot better than nothing in<br>
such cases. Are there any objections to always setting this terminate<br>
handler? For my debugging today, I put it in<br>
WebKit::ChildProcess::<wbr>initialize, which seems like a decent place, but<br>
maybe not the best place. Are there any other suggestions for where to<br>
put this code? I presume this would be desired for all ports, but we<br>
could certainly do it somewhere platform-specific if that&#39;s not the<br>
case.<br></blockquote><div><br></div><div>I don&#39;t think it&#39;s a great idea because:</div><div><ul><li>The state of the stack when std::terminate is called is implementation defined (it could be unwound, unwound partially, or not unwound at all).</li><li>std::terminate can be called from atexit or at_quick_exit which means that global state can be partially broken.</li><li>CRASH sometimes behaves in a manner which will cause signals to be generated, and installSignalHandlersForFatalErrors registers signal handlers (which sometimes calls dumpBacktraceSignalHandler which then calls exit, leading us back to atexit).</li></ul><div>The chance for undefined behavior, weirdly circular call graphs, exploitable behavior, or all three, seems pretty high here and very dependent on configuration at compile-time.</div></div><div><br></div><div>JF</div>







</div></div></div>