Unity Web Player with anti-aliasing gives kernel panic in Firefox on OS X.

RESOLVED WONTFIX

Status

()

Core
Plug-ins
P2
normal
RESOLVED WONTFIX
5 years ago
9 months ago

People

(Reporter: Kuba Cupisz, Unassigned)

Tracking

({regression})

20 Branch
x86
Mac OS X
regression
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

5 years ago
Created attachment 744133 [details]
FirefoxUnityWebplayer.zip

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130326150557

Steps to reproduce:

Summary:
Unity Web Player content that uses anti-aliasing gives kernel panic in Firefox on OS X.
All the attachments are provided in FirefoxUnityWebplayer.zip.

Steps to Reproduce:
Install the current Unity Web Player from: http://unity3d.com/webplayer/
Unzip KernelPanicWebplayer.zip, open KernelPanicWebplayer/index.html in Firefox.
Right click the content and choose "Go Fullscreen". When in fullscreen hit "ESC" to exit fullscreen.
	In most cases (see below) just right clicking the web player and waiting a second without further actions locks up the machine.


Actual results:

The machine freezes, kernel panic report is generated.

MacBookPro5,3 (GeForce 9600M GT) 10.7.5/11G63
Firefox 8.0.1 failure when exiting fullscreen
Firefox 12.0 failure a second after right clicking the webplayer and the context menu appearing
Firefox 20.0 failure a second after right clicking the webplayer and the context menu appearing

MacBookPro10,1 (GeForce GT 650M) 10.8.3/12D78
Firefox 8.0.1 no failure
Firefox 20.0 failure a second after right clicking the webplayer and the context menu appearing


Expected results:

No freeze.

I realize that fixing kernel panic issues is most likely out of your hands. I created a bug for Apple, but wanted to make you aware of the issue and perhaps we could have a conversation about possible workarounds.

BTW the issue doesn't manifest itself in Safari nor Chrome.
Is there a problem report for this? Does it contain any possibly useful information?

Steven, do you have an idea on further steps here?
Priority: -- → P2
This really does sound like an Apple bug, possibly having to do with their video drivers.  And since it happens in fullscreen mode (where Firefox's involvement is minimal), the bug is likely triggered by something in the Unity plugin.  (Note that plugins often sniff which browser they're running it, and change their behavior accordingly.)

It'd be interesting to have a crash stack -- if that's possible with a kernel panic.  But I doubt there's much we can do -- especially considering how far back these crashes happen on one of Kuba's machines.

Georg, if you have a machine that matches the specs for one of Kuba's machines, you might try to reproduce the problem.  I won't have time for this myself until next week at the earliest.

Kuba, can you test with earlier versions of the Unity plugin?  This bug very likely doesn't happen with them.  (And this being a new Unity bug would explain why it hasn't been reported before.)

Another thing you can try, Kuba, is to change Firefox's user-agent string to match some other browser's (say Safari, Chrome or Opera).  You can set Firefox's user-agent string by creating a "general.useragent.override" string value in about:config (restart FF after making this change).  You can read any browser's user-agent string by visiting http://browserspy.dk/browser.php.

These days most plugins' browser sniffing is too sophisticated to be fooled by changing the browser's user-agent string.  But it's worth a try.

Comment 3

5 years ago
Another option for Unity is to stop implementing your own full-screen support and instead use pluginElement.mozRequestFullScreen (via NPAPI) to have Firefox setup fullscreen for you. If this doesn't trigger the crash then it might be the best way forward. We've been asking Adobe to consider the same thing for Flash.

Otherwise I'm not sure there's much we can do, since we don't control painting of fullscreen at all.
(Reporter)

Comment 4

5 years ago
The most important thing is that in newer Firefox versions the kernel panic happens _without_ entering fullscreen at all. It's enough to right-click the Unity content for the context menu to show up and wait for a second. Please see the description above again.

We have tried in older Unity versions (3.5) and it reproduces there as well.
We don't check the user-agent string anywhere. Back in the day (QuickDraw based rendering) we had some workarounds based on the bundle ID of the process, but we don't seem to have any of that anymore.
(Reporter)

Comment 5

5 years ago
We also noticed that the plugin container process had NSSupportsAutomaticGraphicsSwitching set to true (as per http://developer.apple.com/library/mac/#qa/qa1734/_index.html#//apple_ref/doc/uid/DTS40010791). Setting the value of that key to NO or removing it completely didn't get rid of the issue though.
Keywords: regression, regressionwindow-wanted
(In reply to Kuba Cupisz from comment #4)
> The most important thing is that in newer Firefox versions the kernel panic
> happens _without_ entering fullscreen at all.

It would be interesting to find out when this started to happen.
If you'd want to help finding that out, there is a tool for finding the regression window:
http://mozilla.github.io/mozregression/
> kernel panic report is generated

Kuba, what (exactly) does this mean?

Is it something you see in the console log?

If possible, please paste in a copy here.
Created attachment 744630 [details]
Kernel panic report MacBookPro10,1
Created attachment 744632 [details]
MacBookPro5,3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Looking into the zip file, they also contain the kernel panic reports. I attached them for easier viewing.
Those crashes are, unsurprisingly, in the graphics driver, with nothing else really standing out to me.

Benwa, did the graphics team have any bad experiences with those adapters already?
(Reporter)

Comment 11

5 years ago
Kernel panic:
The machine restarts, shows a "Your computer restarted because of a problem. Press a key or wait a few seconds to continue starting up." message (http://images.techhive.com/images/article/2013/02/kernel-panic-ml_300-100024406-medium.png). After starting up the System Diagnostic Reports area in the Console.app has one more file with a title in form Kernel_DATE-TIME_MACHINENAME.panic. Also, what Georg said.

@Georg: I will try mozregression.
Kuba and Georg:  Does it make any difference if you turn off Preferences : Advanced : General : Use hardware acceleration when available?
Kuba:  Are there any graphics-related Unity plugin settings that might make a difference here?
Created attachment 744647 [details]
Macmini3,1

I also hit this with Macmini3,1 (same driver as the MacBookPro10,1 report).
(In reply to Steven Michaud from comment #12)
> Kuba and Georg:  Does it make any difference if you turn off Preferences :
> Advanced : General : Use hardware acceleration when available?

No.
(Reporter)

Comment 16

5 years ago
I narrowed it down on MacBookPro10,1 (since here it didn't crash in old Firefox and does now) to:
$ mozregression --good=2011-07-14 --bad=2011-07-15


Last good nightly: 2011-07-14
First bad nightly: 2011-07-15

Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?startdate=2011-07-14&enddate=2011-07-15
(Reporter)

Comment 17

5 years ago
@Steven: if we disable multisampling it doesn't happen. Webplayers for you to try:
http://files.unity3d.com/jcupisz/firefoxkernelpanic/ - kernel panic
http://files.unity3d.com/jcupisz/firefoxkernelpanic_noaa/ - no AA, everything's ok
(Reporter)

Comment 18

5 years ago
(In reply to Steven Michaud from comment #12)
> Kuba and Georg:  Does it make any difference if you turn off Preferences :
> Advanced : General : Use hardware acceleration when available?

Nope.
(In reply to Kuba Cupisz from comment #16)
> Pushlog:
> http://hg.mozilla.org/mozilla-central/pushloghtml?startdate=2011-07-
> 14&enddate=2011-07-15

Likely suspect: bug 648484 for the electrolysis/remote layer changes.
Bug 648484 seems to be Windows-only.  It might have some cross-platform side effects, though -- like timing changes, for example.

Here's something that'd be worth doing, but would be a lot of work:

Add logging just before and after every single NPAPI call into the Unity plugin and vice versa (from the Unity plugin into FF).  This should narrow down our search for the code that's triggering the kernel panic.  I strongly suspect we'll find that the kernel panic is triggered from Unity plugin code.
(In reply to Kuba Cupisz from comment #16)
> Last good nightly: 2011-07-14
> First bad nightly: 2011-07-15
I just crashed the 2011-07-14 nightly

Comment 22

5 years ago
(In reply to Steven Michaud from comment #20)
> Here's something that'd be worth doing, but would be a lot of work:
> 
> Add logging just before and after every single NPAPI call into the Unity
> plugin and vice versa (from the Unity plugin into FF).  This should narrow
> down our search for the code that's triggering the kernel panic.  I strongly
> suspect we'll find that the kernel panic is triggered from Unity plugin code.

I've just done this. A trace shows that the Unity plugin makes a blocking call to show the context menu:

NPN_PopUpContextMenu(instance, (NPMenu*)handler->m_Menu);	

As best as I can tell, this call does not return back to the Unity plugin prior to the kernel panic.

Unfortunately, it's infeasible to simply skip this line. Do you have any advice on other possible workarounds?
(In reply to Paul Silaghi [QA] from comment #21)
> (In reply to Kuba Cupisz from comment #16)
> > Last good nightly: 2011-07-14
> > First bad nightly: 2011-07-15
> I just crashed the 2011-07-14 nightly
I'll try to find another range
Right click on the testcase screen/caching setup => Mac crashes (panic mode) on FF 4.0.1.
So I guess it's not a FF regression.
Keywords: regressionwindow-wanted
(In reply to comment #22)

You appear to be telling us that the kernel panic is triggered from Firefox code.

Please attach a copy of the patch with which you tested.
(In reply to comment #23 and comment #24)

The regression range Kuba found was only for one of his machines (the MacBookPro10,1).  So the hope was it might provide a clue, though we knew it couldn't tell the whole story.
(Following up comment #25)

Now that I think about it, you must have tested from the Unity plugin side.

We also need to test from the Firefox side.  In other words, we also need to add logging to Firefox before and after every single NPAPI call into the Unity plugin and vice versa (from the Unity plugin into FF).
Whoever can reproduce this:

Was there anything interesting in the console log just before the kernel panic?
(Reporter)

Comment 29

5 years ago
(In reply to Steven Michaud from comment #26)
> (In reply to comment #23 and comment #24)
> 
> The regression range Kuba found was only for one of his machines (the
> MacBookPro10,1).  So the hope was it might provide a clue, though we knew it
> couldn't tell the whole story.

Exactly.
> Was there anything interesting in the console log just before the kernel panic?

In one of the system logs, rather.  (The system keeps copies of those, which you can look at after you've rebooted.)

Comment 31

5 years ago
(In reply to Steven Michaud from comment #30)
> > Was there anything interesting in the console log just before the kernel panic?
> 
> In one of the system logs, rather.  (The system keeps copies of those, which
> you can look at after you've rebooted.)

Just gave this a quick shot; no, there's nothing particularly interesting before the panic:

05/03/2013 4:13:57.978 PM com.apple.ShareKitHelper[30446]: --warning: [ShareKit-XPC] Received XPC_ERROR_CONNECTION_INVALID
05/03/2013 4:13:57.978 PM com.apple.ShareKitHelper[30446]: --warning: [ShareKit-XPC] connectionWithClientInterrupted
05/03/2013 4:13:57.979 PM com.apple.ShareKitHelper[30446]: --warning: [ShareKit] Cancel UI for running services with Client PID: 30275
05/03/2013 4:14:44.000 PM bootlog[0]: BOOT_TIME 1367590484 0
(In reply to Kuba Cupisz from comment #29)
> (In reply to Steven Michaud from comment #26)
> > (In reply to comment #23 and comment #24)
> > 
> > The regression range Kuba found was only for one of his machines (the
> > MacBookPro10,1).  So the hope was it might provide a clue, though we knew it
> > couldn't tell the whole story.
> 
> Exactly.

So did this happen with older Unity Web Player builds too?
I haven't heard this being reported before, so i wonder if it's triggered by a change to the graphics drivers or in Unity.
(Reporter)

Comment 33

5 years ago
(In reply to Georg Fritzsche [:gfritzsche] from comment #32)
> So did this happen with older Unity Web Player builds too?
> I haven't heard this being reported before, so i wonder if it's triggered by
> a change to the graphics drivers or in Unity.

It happens in Unity 3.5 which was released in February 2012.
I'm marking this bug as WONTFIX per bug #1269807.

For more information see - https://blog.mozilla.org/futurereleases/2015/10/08/npapi-plugins-in-firefox/
Status: NEW → RESOLVED
Last Resolved: 9 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.