Closed Bug 1507183 Opened 6 years ago Closed 5 years ago

Firefox nightly randomly freezes on panda.tv

Categories

(Core :: Graphics, defect, P2)

defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: sefeng, Unassigned)

References

Details

I run a Firefox Nightly on my home Windows(Win 10, 64bit) machine. 

Panda.tv is a Chinese streaming website. When I was trying to watch some streams during the weekend, it was bad. The browser randomly frozen on panda.tv.

I ended up switching to Chrome because I wanted to watch the streams....
Can you attach a performance profile of the slowness? ( https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Reporting_a_Performance_Problem )
Component: General → Audio/Video: Playback
Flags: needinfo?(sefeng)
Product: Firefox → Core
Hi Gijs,

It would be hard, because the browser freezes randomly and not responding. I don't think I can generate the geckco profiler while it is freezing. 

I will try to attach the Visual Studio debugger to it tonight and see if I can generate something.
Rank: 19
Priority: -- → P2
Sorry for didn't provide any new information for this bug. 

I am still trying to make my home machine to be able to generate some stack trace..and I will provide them once I have them ready. 

One new observation I had was, while the UI was freezing, sometimes if I right clicked the Firefox icon from the task bar to get the menu, and then clicked `Close Window` button, an Confirm Window could pop up and unfrozen the browser.
Yes, on the Core i3 reference laptop this page took exceptionally long to load.
It did eventually finish for me (98 seconds!).

Profile:
https://perfht.ml/2ORE085
(In reply to Andrew Creskey from comment #4)
> Yes, on the Core i3 reference laptop this page took exceptionally long to
> load.
> It did eventually finish for me (98 seconds!).
> 
> Profile:
> https://perfht.ml/2ORE085

I don't see the parent process freezing, which is what comment #0 implies. I *do* see mozilla::layers::CompositorBridgeChild::FlushAsyncPaints in the content process hang/sleep for 50 seconds (!?) when trying to talk to the compositor. That seems wrong. Markus, can you take a look and/or redirect to someone who might know what's up?
Flags: needinfo?(mstange)
(In reply to Sean Feng [:sefeng] from comment #2)
> Hi Gijs,
> 
> It would be hard, because the browser freezes randomly and not responding. I
> don't think I can generate the geckco profiler while it is freezing. 

So, fwiw, it should be possible to generate a profile by starting the profiler before, and finishing once the browser unfreezes...
Thanks for the profile, Andrew. 

I am just a little bit unsure whether this is the same problem or not. 

What I experienced was most of the time the site loaded within an acceptable time, and all of a sudden it started to freeze. 

I don't think I have ever tried to wait 98 seconds though.

Gijs: I see...I'll try to wait longer
(In reply to :Gijs (he/him) from comment #5)
> (In reply to Andrew Creskey from comment #4)
> > Yes, on the Core i3 reference laptop this page took exceptionally long to
> > load.
> > It did eventually finish for me (98 seconds!).
> > 
> > Profile:
> > https://perfht.ml/2ORE085
> 
> I don't see the parent process freezing, which is what comment #0 implies. I
> *do* see mozilla::layers::CompositorBridgeChild::FlushAsyncPaints in the
> content process hang/sleep for 50 seconds (!?) when trying to talk to the
> compositor.

That's waiting for the PaintThread in the content process, and yes, 50 seconds is an unreasonably long time!

Andrew, can you get a new profile with PaintThread (not PaintWorker) in your thread filter?

I tried to reproduce this on the reference machine by loading the panda.tv main page and didn't see any long paints in the profile.
Flags: needinfo?(mstange)
Here's a profile with PaintThread added (this one only janked for 40s):
https://perfht.ml/2OWZbpn

Note that I had to reload about 6 times for this to happen (generally it was loading within a couple of seconds).

Also, I forgot to mention that this site makes use of the Flash plugin (which I haven't yet given it permission to run).

When loading, the browser says it's waiting on an http resource, but I haven't found evidence of that yet.
Should also mention that the reference laptop was paging to disk during the page load (because it's almost always paging to disk...).
According to comment5, we spent lots of time on `mozilla::layers::CompositorBridgeChild::FlushAsyncPaints` which sounds more like a graphic related bug, so move this bug to the right component in order to get more attention.
Component: Audio/Video: Playback → Graphics
Sounds like bug 1508747/

OP, does the window completely freeze? Like clicking on a tab has no visible effect and if you resize the window everything goes black?
See Also: → 1508747
Yeah, the window freezes completely, I can't click anything. And it seems that sometimes the window can be unfrozen if I right click the nightly icon on the taskbar, and then click 'Close window'.
Please provide a copy of the about:support entry
My about:support https://pastebin.com/atkCwAK4
We looked at the profiles from this bug today during The Joy of Profiling (Episode 31).

What we found is that the paint threads are blocked waiting on the Intel driver to do... something... on a different thread. Unfortunately, the GeckoProfiler does not capture the thread in question, as it's outside of Firefox.

The next step here might be to use something like the Windows Concurrency Visualizer[1] here to see what the paint threads are being blocked on. acreskey, if you're able to reproduce this reliably, do you have time to try to get a concurrency visualizer profile captured?

[1]: https://docs.microsoft.com/en-us/visualstudio/profiling/concurrency-visualizer?view=vs-2017
:mconley great work. 
Yes, I can reproduce. I'll have access to that device next week so I'll grab a Windows Concurrency Visualizer profile.
Flags: needinfo?(acreskey)
This is the specific url that I was initially provided with:
https://www.panda.tv/1519427
Although this bug used to reproduce quite easily on my Core-i3 reference laptop I haven't been able to today in ~12 tests (clearing the cache and relaunching the browser after each).
The page is now loading within a second or two for me.

Notes:
-A Windows update and reboot did occur between when I could initially reproduce this
-I tried with and without Concurrency Visualizer attached to the Content Process
acreskey: was the video be able to play within a second or two?

My browser got frozen again when I just browsed the main page of panda.tv, and I got a crash report this time https://pastebin.com/Djs7xBzh

The freezes are just so easy to reproduce on my machine....and I am always having a hard time to generate a profile. This time I tried to generate some profiles when it does not freeze, https://perfht.ml/2L9JZ83 and https://perfht.ml/2L7vOA8. These profiles look very interesting to me. There are lots of event processing delays. I see some function calls like HangMonitorChild in the first profile and dozens of GC/CC in the second profile, they all concerning me.
sefeng:
I've given Flash permission to run and the video on both www.panda.tv and www.panda.tv/1519427 play correctly within a few seconds.
(I'm now on Nighty 2018-12-11).

If it's easy for you to reproduce maybe try capturing a profile w/ the Windows Concurrency Visualizer through Visual Studio?

Even if the browser crashes, you will still have the captured data available accessible from Visual Studio.
(In reply to Sean Feng [:sefeng] from comment #21)
> 
> The freezes are just so easy to reproduce on my machine....and I am always
> having a hard time to generate a profile. This time I tried to generate some
> profiles when it does not freeze, https://perfht.ml/2L9JZ83 and
> https://perfht.ml/2L7vOA8. These profiles look very interesting to me. There
> are lots of event processing delays. I see some function calls like
> HangMonitorChild in the first profile and dozens of GC/CC in the second
> profile, they all concerning me.

All the jank looks to be spent in plugins IPC. Can you try be disabling the youtube flash player, and disallowing the adobe flash player from running?

Sorry for the very late reply.....

Panda TV just entered bankruptcy last week and panda.tv shut down. I don't think there are further actions we can do for this bug.

I think we can close this bug.

Flags: needinfo?(sefeng)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.