You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fire a mozbrowsererror event if pipeline/frame panics #10334
As far as #10334, one way to handle this might be to have a global privileged "parent window". Windows corresponding to browser.html and those using that API have this. On Servo's side we store a global once-initialized static channel to its script task, and in the panic handler if we find such a channel and sending messages to the window works (use try_send() instead of send()), send a message to the script task with panic details. This triggers an event on the bhtml Window.
The alternative is to have each iframe mozbrowser get a special custom panic handler that bubbles it up. However, panics may not always be in the per-iframe threads, and if something else panics then there's not much we can do about it.
Looking at this perhaps we have to use the latter option, since we need to be able to associate a panic with a specific <iframe>
@paulrouget For telemetry and stuff, would it be okay if the bhtml window itself could have a mozbrowsererror fired on it (not just its iframes)? This way, we can attempt to catch crashes in individual iframe threads, and if the panic is elsewhere, try to tell bhtml about it directly so that it can (attempt to) report to telemetry.
Could it be a mozbrowsererror instead (fired on the Window instead of the iframe)? I don't like exposing a possible exploit vector through a non-mozbrowser interface.
(Yes, it will only trigger on Browser windows, but I like having that second step there too)
#10641 adds a panic channel that can be used by any thread (not just a pipeline thread) to report panics. Next up: add the backtrace to that channel, get all threads to report panics, and hook up to mozbrowsererror.
@paulrouget what do you want me to do in the case of multiple panics? Just send the first one? Just send the first one for each pipeline? These things usually travel in packs, since panics cascade.
@paulrouget I added description and report fields to the mozbrowsererror details, intended to contain a human-readable and a machine-readable representation of the error. Do these seem sensible to you? Care to bikeshed the names?
Activity
paulrouget commentedon Apr 1, 2016
And maybe attach the back trace or add some more details to the event to allow browserhtml to report the crash.
asajeffrey commentedon Apr 1, 2016
@paulrouget should that be
type = "fatal"ortype = "fatal(crash)". https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowsererror has"fatal(crash)"but I think "(crash)" is just meant as a comment, not as part of thetypestring.asajeffrey commentedon Apr 1, 2016
At the moment, our binding to mozbrowsererror doesn't allow us to specify the type (https://github.com/servo/servo/blob/master/components/script_traits/lib.rs#L418). We'd need to extend
MozBrowserEventto provide type information.@paulrouget How important is the type? Should we just emit a mozbrowsererror with no type info for now?
asajeffrey commentedon Apr 1, 2016
Also @paulrouget, should there be any other info in the event? For example, would including the stack trace in the detail be useful?
jdm commentedon Apr 1, 2016
@asajeffrey The type is not important to maintain. We extend them as necessary.
paulrouget commentedon Apr 2, 2016
"fatal"
Not that important, but it's pretty easy to support: we should create a new event type in BrowserElement.webidl;
Absolutely. You can add an extra field to the webidl for that.
Manishearth commentedon Apr 5, 2016
From #10329 (comment)
Looking at this perhaps we have to use the latter option, since we need to be able to associate a panic with a specific
<iframe>Manishearth commentedon Apr 5, 2016
@paulrouget For telemetry and stuff, would it be okay if the bhtml window itself could have a mozbrowsererror fired on it (not just its iframes)? This way, we can attempt to catch crashes in individual iframe threads, and if the panic is elsewhere, try to tell bhtml about it directly so that it can (attempt to) report to telemetry.
paulrouget commentedon Apr 5, 2016
@Manishearth Do we need to have a special event for that? Could we use this instead: https://html.spec.whatwg.org/multipage/webappapis.html#handler-onerror. Because we try to make mozbrowser events map contentDocument events.
mozbrowserloadendisonloadfor example.Regardless of the name of the event, it should be fired only if 1) the mozbrowser pref is on, 2) only to the very top level pipeline.
Manishearth commentedon Apr 5, 2016
Could it be a mozbrowsererror instead (fired on the
Windowinstead of the iframe)? I don't like exposing a possible exploit vector through a non-mozbrowser interface.(Yes, it will only trigger on Browser windows, but I like having that second step there too)
paulrouget commentedon Apr 5, 2016
Sure. To avoid confusion, could we name it
mozbrowsererror_unknownoriginor something like that?Manishearth commentedon Apr 5, 2016
sgtm
24 remaining items
paulrouget commentedon Apr 15, 2016
It doesn't really matter.
mozbrowsererror,mozbrowsererror_unknownorigin, or anything else. The target will be different, so we can differentiate.asajeffrey commentedon Apr 15, 2016
#10641 adds a panic channel that can be used by any thread (not just a pipeline thread) to report panics. Next up: add the backtrace to that channel, get all threads to report panics, and hook up to mozbrowsererror.
Auto merge of #10551 - asajeffrey:trigger-mozbrowsererror-event, r=jdm
Auto merge of #10641 - asajeffrey:dedicated-panic-channel, r=Manishearth
Auto merge of #10641 - asajeffrey:dedicated-panic-channel, r=Manishearth
asajeffrey commentedon Apr 23, 2016
@paulrouget what do you want me to do in the case of multiple panics? Just send the first one? Just send the first one for each pipeline? These things usually travel in packs, since panics cascade.
asajeffrey commentedon Apr 25, 2016
#10824 sends the panic reason and backtrace to the constellation, for error reporting.
#10837 adds the fields to mozbrowsererror events for forwarding this information.
Once both have landed, we can report panics to the browser chrome.
asajeffrey commentedon Apr 25, 2016
@paulrouget I added
descriptionandreportfields to themozbrowsererrordetails, intended to contain a human-readable and a machine-readable representation of the error. Do these seem sensible to you? Care to bikeshed the names?asajeffrey commentedon Apr 26, 2016
#10862 allows us to test this, by making sure the root pipeline survives, even when randomly killing pipelines.
Auto merge of #10824 - asajeffrey:communicate-backtrace-on-panic, r=M…
Auto merge of #10862 - asajeffrey:only-the-chrome-survives, r=SimonSapin
asajeffrey commentedon Apr 28, 2016
#10898 only keeps the root pipeline alive when
dom.mozbrowser.enabledis true.Auto merge of #10837 - asajeffrey:add-mozbrowsererror-details, r=Mani…
Auto merge of #10931 - asajeffrey:send-panic-backtrace-to-mozbrowser,…