Open Bug 1755865 Opened 3 years ago Updated 3 years ago

Firefox 97 deadlocks when attempting to display a desktop notification

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 97
defect

Tracking

()

UNCONFIRMED

People

(Reporter: triffid.hunter, Unassigned)

References

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36

Steps to reproduce:

Just use firefox normally

Actual results:

After a while, firefox deadlocks. Its windows do not redraw and do not respond to user input, and the parent firefox process hits 100% (single thread) CPU usage.

There are a couple of areas on my desktop where it looks like a pop-over window is present but hasn't been drawn in - if I move other windows through the area, it displays whatever was there when firefox deadlocked (usually part of Firefox's tab bar and address/toolbar). These areas are about the size of a desktop notification window. One is in the top left of my screen, the other is near the task manager on my panel.

Since I've recently enabled desktop notifications for slack.com, they may be coming from Slack - but this is an assumption on my part since I'm not sure how to check what those windows are supposed to be when firefox is completely hung.

Gmail and a couple of other sites seem to have no problems issuing desktop notifications - ie gmail's desktop notifications do not cause firefox to deadlock.

I attached with strace to try and see what was happening, but it seems like all the firefox processes are just slinging IPC messages back and forth as fast as they can.

I also attached with gdb to check the backtrace, but apparently it's mostly libxul.so and my libxul apparently has no symbols.

I'll include the backtrace here anyway in case it's of any use;

(gdb) bt
#0 0x00007f14a36712c0 in () at /lib64/libc.so.6
#1 0x00007f14a1703be3 in g_datalist_get_data () at /usr/lib64/libglib-2.0.so.0
#2 0x00007f149d826277 in () at /usr/lib64/firefox/libxul.so
#3 0x00007f149d83932e in () at /usr/lib64/firefox/libxul.so
#4 0x00007f149d83921f in () at /usr/lib64/firefox/libxul.so
#5 0x00007f149d8412d2 in () at /usr/lib64/firefox/libxul.so
#6 0x00007f14a1818648 in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0
#7 0x00007f14a182a0fa in () at /usr/lib64/libgobject-2.0.so.0
#8 0x00007f14a1830557 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#9 0x00007f14a1830ac7 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#10 0x00007f14a232b9eb in gtk_widget_unrealize () at /usr/lib64/libgtk-3.so.0
#11 0x00007f14a232e308 in () at /usr/lib64/libgtk-3.so.0
#12 0x00007f14a2341758 in () at /usr/lib64/libgtk-3.so.0
#13 0x00007f14a181e939 in g_object_run_dispose () at /usr/lib64/libgobject-2.0.so.0
#14 0x00007f149d825c68 in () at /usr/lib64/firefox/libxul.so
#15 0x00007f149e52ae72 in () at /usr/lib64/firefox/libxul.so
#16 0x00007f149e5383a2 in () at /usr/lib64/firefox/libxul.so
#17 0x00007f149bff99f0 in () at /usr/lib64/firefox/libxul.so
#18 0x00007f149bffcd93 in () at /usr/lib64/firefox/libxul.so
#19 0x00007f149b2e269e in () at /usr/lib64/firefox/libxul.so
#20 0x00007f149b2cd8f0 in () at /usr/lib64/firefox/libxul.so
#21 0x00007f149b2ccc97 in () at /usr/lib64/firefox/libxul.so
#22 0x00007f149b2cce8f in () at /usr/lib64/firefox/libxul.so
#23 0x00007f149b2e3a22 in () at /usr/lib64/firefox/libxul.so
#24 0x00007f149b2d84c4 in () at /usr/lib64/firefox/libxul.so
#25 0x00007f149b2dc716 in () at /usr/lib64/firefox/libxul.so
#26 0x00007f149b71ea38 in () at /usr/lib64/firefox/libxul.so
#27 0x00007f149b6dd517 in () at /usr/lib64/firefox/libxul.so
#28 0x00007f149d7fdb69 in () at /usr/lib64/firefox/libxul.so
#29 0x00007f149e7dff12 in () at /usr/lib64/firefox/libxul.so
#30 0x00007f149e894739 in () at /usr/lib64/firefox/libxul.so
#31 0x00007f149e8950fe in () at /usr/lib64/firefox/libxul.so
#32 0x00007f149e895435 in () at /usr/lib64/firefox/libxul.so
#33 0x000055b398602f76 in ()
#34 0x00007f14a35457fd in __libc_start_main () at /lib64/libc.so.6
#35 0x000055b398602a6a in _start ()

If there's any specific debugging steps that would be helpful, let me know.

PS: using Gentoo Linux's www-client/firefox-97.0 package.

Expected results:

Firefox should not deadlock when attempting to display desktop notifications

Posting from chrome since Firefox is being crashy, my Firefox user agent is: Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0

There was an update from my package manager to firefox-97.0.1 but these exact same symptoms just happened again.

I posted the strace log at http://triffid-hunter.no-ip.info/20220218T154731_firefox_lockup.strace.txt if anyone's curious, it's ~8MB of logs from about 5 seconds of capture.

backtrace from gdb looks like:

(gdb) bt
#0 0x00007feec5bd64d5 in g_pointer_bit_lock () at /usr/lib64/libglib-2.0.so.0
#1 0x00007feec5be5ba3 in g_datalist_get_data () at /usr/lib64/libglib-2.0.so.0
#2 0x00007feec1d14567 in () at /usr/lib64/firefox/libxul.so
#3 0x00007feec1d2762e in () at /usr/lib64/firefox/libxul.so
#4 0x00007feec1d2751f in () at /usr/lib64/firefox/libxul.so
#5 0x00007feec1d2f5e2 in () at /usr/lib64/firefox/libxul.so
#6 0x00007feec5cfa648 in g_closure_invoke () at /usr/lib64/libgobject-2.0.so.0
#7 0x00007feec5d0c0fa in () at /usr/lib64/libgobject-2.0.so.0
#8 0x00007feec5d12557 in g_signal_emit_valist () at /usr/lib64/libgobject-2.0.so.0
#9 0x00007feec5d12ac7 in g_signal_emit () at /usr/lib64/libgobject-2.0.so.0
#10 0x00007feec682b9eb in gtk_widget_unrealize () at /usr/lib64/libgtk-3.so.0
#11 0x00007feec682e308 in () at /usr/lib64/libgtk-3.so.0
#12 0x00007feec6841758 in () at /usr/lib64/libgtk-3.so.0
#13 0x00007feec5d00939 in g_object_run_dispose () at /usr/lib64/libgobject-2.0.so.0
#14 0x00007feec1d13f58 in () at /usr/lib64/firefox/libxul.so
#15 0x00007feec2a19212 in () at /usr/lib64/firefox/libxul.so
#16 0x00007feec2a26742 in () at /usr/lib64/firefox/libxul.so
#17 0x00007feec04e7cf0 in () at /usr/lib64/firefox/libxul.so
#18 0x00007feec04eb093 in () at /usr/lib64/firefox/libxul.so
#19 0x00007feebf7d099e in () at /usr/lib64/firefox/libxul.so
#20 0x00007feebf7bbbf0 in () at /usr/lib64/firefox/libxul.so
#21 0x00007feebf7baf97 in () at /usr/lib64/firefox/libxul.so
#22 0x00007feebf7bb18f in () at /usr/lib64/firefox/libxul.so
#23 0x00007feebf7d1d22 in () at /usr/lib64/firefox/libxul.so
#24 0x00007feebf7c67c4 in () at /usr/lib64/firefox/libxul.so
#25 0x00007feebf7caa16 in () at /usr/lib64/firefox/libxul.so
#26 0x00007feebfc0cd38 in () at /usr/lib64/firefox/libxul.so
#27 0x00007feebfbcb817 in () at /usr/lib64/firefox/libxul.so
#28 0x00007feec1cebe59 in () at /usr/lib64/firefox/libxul.so
#29 0x00007feec2cce2b2 in () at /usr/lib64/firefox/libxul.so
#30 0x00007feec2d82ad9 in () at /usr/lib64/firefox/libxul.so
#31 0x00007feec2d8349e in () at /usr/lib64/firefox/libxul.so
#32 0x00007feec2d837d5 in () at /usr/lib64/firefox/libxul.so
#33 0x0000557c41423fb6 in ()
#34 0x00007feec7a327fd in __libc_start_main () at /lib64/libc.so.6
#35 0x0000557c41423aaa in _start ()

This crash was happening quite regularly for a while - and in fact happened again about 20 minutes after I posted this bug.

I disabled desktop notifications for a few sites, and the crash hasn't happened since - so I'm reasonably certain that (as suggested earlier) it's something to do with desktop notifications and is probably a regression since I didn't see anything remotely like this issue in firefox 91 or 95.

No more crashes since my last post, seems like disabling desktop notifications has worked around the issue for now - but not solved it, desktop notifications should not cause the whole browser to deadlock in the first place.

I could not reproduce the deadlock on my Ubuntu 20.04 machine using the latest Nightly 99.0a1.
Moving this to Widget:Gtk component so that someone from our dev team can take a look over it - if this is not the right component, please move it to a more suitable one.
Also, please see Bug 1747369.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
See Also: → 1747369
Priority: -- → P3

I had a look at 1747369 and there are significant similarities but also some differences :-

  • In my case, firefox seems to lock up indefinitely (I waited over an hour during one test) rather than just 5-10s stalls

  • Notifications don't make sounds (possibly because I muted the relevant tabs, sound on youtube et al works fine).

  • I'm using ALSA rather than any sound daemon (pipewire/pulse/etc), and the lockups don't coincide with any other program interacting with the sound subsystem.

  • I'm using kwin (KDE)

Unfortunately, checking the profiler from within firefox is unlikely to help since it goes into a complete deadlock with no graphics redraw or user input occurring until I force-kill it - is the recorded profile saved in a file somewhere that I could post after I crash the browser?

If you use perf like this it should allow you to get a nice view of where time is being spent. Alternatively, kill the firefox process with kill -SEGV <pid>, and that should launch the crash reporter. Then go to about:crashes, and paste the ID / URL here.

Thanks!

Flags: needinfo?(triffid.hunter)

OK thanks for the debug steps, guess I'm re-enabling desktop notifications and waiting for it to die - unfortunately can't give a timeline, my notifications tend to be much quieter on weekends.

(bug 1736949 introduced bug 1744882)

See Also: → 1744882
Flags: needinfo?(triffid.hunter)

I checked 1744882 - my Firefox doesn't deadlock when closing windows, only when (presumably) attempting to display desktop notifications

I tried kill -SEGV but didn't get any crash reporter, and about:crashes says "Hmm. That address doesn’t look right. Please check that the URL is correct and try again."

(In reply to Triffid Hunter from comment #14)

I tried kill -SEGV but didn't get any crash reporter, and about:crashes says "Hmm. That address doesn’t look right. Please check that the URL is correct and try again."

Ah, so you have a custom build of Firefox with the crash reporter disabled. Can you try an official build from https://www.mozilla.org/en-US/firefox/new/ or https://nightly.mozilla.org and see if it reproduces?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: