Closed Bug 1493227 Opened 6 years ago Closed 6 years ago

Gecko signal handlers conflict with the Oculus Mobile runtime

Categories

(GeckoView :: General, enhancement, P1)

enhancement

Tracking

(geckoview62 wontfix, firefox63 wontfix, firefox64 fixed)

RESOLVED FIXED
mozilla64
Tracking Status
geckoview62 --- wontfix
firefox63 --- wontfix
firefox64 --- fixed

People

(Reporter: rbarker, Assigned: rbarker)

Details

(Whiteboard: [geckoview:fxr:p1])

Attachments

(1 file)

The signal handlers in both the Gecko crash reporter and the GeckoProfile code conflict with the Oculus Mobile runtime and cause crashes and freezes if not initialized before the Oculus Runtime[1]. It was possible to work around the GeckoProfile issue by calling putenv(strdup("MOZ_DISABLE_SIG_HANDLER=1"); before initializing Gecko. But there is no way to control when the crash reporter signal handler gets registered. It would good if Gecko's signal handlers could be made to work with the Oculus Mobile Runtime so the order does not matter. Oculus is using the SIGILL signal to trap certain button presses on the VR controller. This appears to be what is causing the conflict.


[1] https://github.com/MozillaReality/FirefoxReality/issues/564
Whiteboard: [geckoview:fxr:p1]
Add env var MOZ_DISABLE_EXCEPTION_HANDLER_SIGILL so that the crash
reporter will not register a handler for SIGILL when the env var is set.
This is needed to work around a conflict with the Oculus Mobile runtime
that uses the SIGILL signal to trap the back button on the controller.
Assignee: nobody → rbarker
I was really curious about how this situation came to be, and this seems to be the answer:
https://forums.oculusvr.com/developer/discussion/comment/608470/#Comment_608470

This doesn't exactly thrill me, but I guess you don't have many options here.
It doesn't thrill me either. This was the only solution I could find. If some one with more knowledge around signal handlers has a better idea they would like us to try, I would be more than happy to give it a shot. I'm also hampered by the fact that crash reporting can't be built on a Mac so I have to push to try to build an AAR to test with.
Huh... so what happens when rust code crashes through an illegal instruction (which afaik is what happens on panic), and a) the crash reporter signal handler is not there and b) oculus runtime's signal handler catches it. ?!?
Here is the Firefox Reality issue for context: https://github.com/MozillaReality/FirefoxReality/issues/564

The tl;dr is that there is a race between Gecko and Oculus Mobile runtime. If Gecko registers first, SIGILL doesn't cause any problems, but if Gecko registers second, we get an application freeze when the controller back button is pressed.
When you say "doesn't cause any problems" though, it would be good to verify that, for example, a panic happening in Rust code still gets caught by our exception handler and not swallowed by the Oculus handler.
Correct. The bigger issue for Firefox Reality is it shipped with no crash reporting at all so we are totally blind right now. Oculus has been reluctant to engage on issues. So not freezing when the back button is pressed is what I meant by no issues. Even working around this issue there are still more with regards to crash reporting that need to be sorted out: https://bugzilla.mozilla.org/show_bug.cgi?id=1493232

I'm just trying to get something into the product so we have at least an inkling of what is going on, even if it is only partial coverage. I already had to set MOZ_DISABLE_SIG_HANDLER=1 to prevent the sig hanlder in the profile lock from crashing on Oculus. I would much prefer a solution that does not require me to turn anything off, but some coverage is better than none at this point.
Comment on attachment 9011573 [details]
Bug 1493227 - Add environment variable to prevent crash reporter from handling SIGILL r=ted

Gabriele Svelto [:gsvelto] has approved the revision.
Attachment #9011573 - Flags: review+
Pushed by rbarker@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a835077cdb63
Add environment variable to prevent crash reporter from handling SIGILL r=gsvelto
https://hg.mozilla.org/mozilla-central/rev/a835077cdb63
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
63=wontfix because FxR ships GV 64.
QA Contact: nchen
Assignee: rbarker → nobody
Assignee: nobody → rbarker
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 64 → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: