GNOME Bugzilla – Bug 447387
panel keeps crashing
Last modified: 2007-06-18 19:40:30 UTC
Just finished updating to latest Ubuntu gutsy (devel branch) and now the panel keeps crashing, and restarting and crashing. Very annoying indeed. Here is the backtrace: Program received signal SIGSEGV, Segmentation fault.
+ Trace 140834
Thread NaN (LWP 12858)
It sounds as if you have a mix of old and new libwnck there. Does it still happen after a reboot? What is your version of gnome-panel and libwnck?
gnome-panel: 2.19.3-0ubuntu1 libwnck-common: 2.19.3.1-0ubuntu1 libwnck18: 2.19.2-0ubuntu1 libwnck22: 2.19.3.1-0ubuntu1 $ lsof -p 4523 | grep wnck gnome-pan 4523 brian mem REG 254,14 199252 278913 /usr/lib/libwnck-1.so.22.0.0 $ dpkg -S /usr/lib/libwnck-1.so.22.0.0 libwnck22: /usr/lib/libwnck-1.so.22.0.0 So, it appears that I am using gnome-panel 2.19.3 and libwnck 2.19.3.1.
It might mean previously_active_window is not valid. Can you create a new libwnck package with a small change? In libwnck/screen.c, search for emit_active_window_changed() and change screen->priv->previously_active_window to NULL. Also, what is the window manager you are using? And are you using sloppy focus (don't know if it's relevant yet, but it's always good to know ;-))?
Created attachment 90071 [details] [review] Possible solution Ah, I might have found something. Can you also try this patch? I can't reproduce the crash, so I can't test whether it fixes the issue or not.
OK. Patch added. Stack trace of resulting crash: Program received signal SIGSEGV, Segmentation fault.
+ Trace 141571
Thread NaN (LWP 25548)
Damn. Guess I forgot to install the new libwnck22-dbgsym library. Just installed it. I will run again and wait for another crash.
Oh wow. That happened a lot quicker than I thought it would: Program received signal SIGSEGV, Segmentation fault.
+ Trace 141572
Thread NaN (LWP 23285)
BTW: gdb is still sitting there at the prompt if there is anything you want me to query it about. It's just occurred to me that I did not do an unoptimized build. I will try to dig up the instructions for doing that on Ubuntu/Debian with dpkg-buildpackage and install those [d]debs tomorrow. Happy to query gdb for you in the meanwhile though if you like.
I can trivially reproduce this bug. gnome-panel crashes for me everytime I close a window. I get a similar gdb backtrace and am running an up to date gutsy as well. Let me know if there is any information I can provide.
(In reply to comment #6) > BTW: gdb is still sitting there at the prompt if there is anything you want me > to query it about. It's just occurred to me that I did not do an unoptimized > build. I will try to dig up the instructions for doing that on Ubuntu/Debian > with dpkg-buildpackage and install those [d]debs tomorrow. Happy to query gdb > for you in the meanwhile though if you like. I'd love to know if, when the crash happens, screen->priv->previously_active_window is NULL in emit_active_window_changed(). I'm trying to investigate here too, but I still can't reproduce :/
Created attachment 90157 [details] [review] Debugging patch Alternatively, can you try the following patch which prints some stuff in the terminal, and copy the output in a comment?
When changing window focus I get update active window: 0x84bfa70 1 update active window: 0x84bfa70 1 update active window: (nil) 0 update active window: (nil) 0 update active window: 0x894d430 1 update active window: 0x894d430 1 On closing window I got update client list: 0x8596b90 1 update active window: (nil) 0 update active window: 0x8596b90 0 Segmentation fault (core dumped) SOmetimes it goes into a close open crash loop with update active window: (nil) 0 Floating point exception (core dumped) In GDB now update client list: 0x8952070 1 update active window: (nil) 0 update active window: 0x8952070 0 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1226950448 (LWP 19788)] 0xb76dacd8 in g_type_check_is_value_type () from /usr/lib/libgobject-2.0.so.0 (gdb) I'm also ocasionally seeing (gnome-panel:18364): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.13.4/gobject/gsignal.c:2180: invalid unclassed object pointer for value type `WnckWindow'
Ah, that's interesting. It means we're firing an event with some invalid data. I must be missing something obvious since I don't see how this can be invalid, but well... Are you using metacity, or another window manager (maybe compiz/beryl)?
(In reply to comment #11) > Are you using metacity, or another window manager (maybe compiz/beryl)? metacity Anything else I can do to help?
Created attachment 90195 [details] [review] Debugging patch, with even more output That's really really weird: I'm on gutsy too, with metacity and I don't see this. Are you running any special application that is dealing with window management (devil's pie, for example)? Does it really happen each time you close a window? Also, this part was interesting: update client list: 0x8596b90 1 update active window: (nil) 0 update active window: 0x8596b90 0 It means that, when you close a window, we enter update_active_window() twice. I can see why this happens, but it shouldn't do anything the second time. Can you apply this new debugging patch, and then run the panel (alternatively, you can use one of the test-* programs available in the libwnck source, which lets you not install the new libwnck package...). I'd like to have the output when you: + run the program + open a new window + close the new window Since it should crash for you, there won't be a lot of output. Sorry for debugging this way :/ It's hard to understand what's happening since I can't reproduce the crash.
(In reply to comment #13) > Created an attachment (id=90195) [edit] > Debugging patch, with even more output $ gnome-panel ** (gnome-panel:13214): WARNING **: No toplevel on which to load object '00000001' ** (gnome-panel:13214): WARNING **: No toplevel on which to load object '00000002' Key /apps/panel/objects/0t1038596772ut224898u1001p2461r472800895k3221219260/launcher_location is not set, cannot load launcher Key /apps/panel/objects/3t1038803671ut664979u1001p4418r180955943k3221219228/launcher_location is not set, cannot load launcher Key /apps/panel/objects/0t1039084875ut584117u1001p14204r2049903244k3221219228/launcher_location is not set, cannot load launcher Key /apps/panel/objects/0t1039480294ut877608u1001p8691r1475752596k3221219244/launcher_location is not set, cannot load launcher Key /apps/panel/objects/2t1038799177ut408040u1001p4418r826989620k3221219228/launcher_location is not set, cannot load launcher Key /apps/panel/objects/1t1038799002ut139886u1001p4418r1604123788k3221219228/launcher_location is not set, cannot load launcher Key /apps/panel/objects/0t1038798990ut222372u1001p4418r1722311443k3221219228/launcher_location is not set, cannot load launcher update_client_list: opening 0x850b8d0 update_client_list: opening 0x84dfe60 update_client_list: opening 0x85093a0 update_client_list: opening 0x850a2a0 update_client_list: opening 0x850b730 update_client_list: opening 0x8458a00 update_client_list: opening 0x8490f50 update_client_list: opening 0x850a330 update_client_list: opening 0x8491960 update_client_list: opening 0x8458810 update_client_list: opening 0x850b820 update_client_list: opening 0x84592c0 update_client_list: opening 0x8490fb0 update_client_list: opening 0x850b9a0 update_client_list: opening 0x84e4da0 update_client_list: opening 0x850a270 update_client_list: opening 0x84dfd00 update_client_list: opening 0x84e3360 update_client_list: opening 0x84f5e70 update_client_list: opening 0x8520190 update_client_list: opening 0x84ebb70 update_client_list: opening 0x851bd70 update_client_list: opening 0x85198d0 update_active_window: new active 0x8490fb0 (xid = 29360695), old active (nil) update_active_window: setting paw to (nil) update_active_window: setting aw to 0x8490fb0 update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) (gnome-panel:13214): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -9 and height 48 update_client_list: opening 0x84eba90 update_client_list: opening 0x84f5590 update_client_list: opening 0x843ac50 update_client_list: opening 0x8520330 update_client_list: opening 0x84e1fb0 update_client_list: opening 0x85f0420 update_client_list: opening 0x85f0200 update_client_list: opening 0x85f0510 update_client_list: opening 0x85f0350 update_active_window: new active 0x8490fb0 (xid = 29360695), old active (nil) update_active_window: setting paw to (nil) update_active_window: setting aw to 0x8490fb0 update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) update_active_window: new active 0x851bd70 (xid = 127926276), old active 0x8490fb0 update_active_window: setting paw to 0x8490fb0 update_active_window: setting aw to 0x851bd70 update_active_window: previously_active_window = 0x8490fb0 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x851bd70 (xid = 127926276), old active 0x8490fb0 update_active_window: setting paw to 0x8490fb0 update_active_window: setting aw to 0x851bd70 update_active_window: previously_active_window = 0x8490fb0 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x8491960 (xid = 29360373), old active 0x851bd70 update_active_window: setting paw to 0x851bd70 update_active_window: setting aw to 0x8491960 update_active_window: previously_active_window = 0x851bd70 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x8491960 (xid = 29360373), old active 0x851bd70 update_active_window: setting paw to 0x851bd70 update_active_window: setting aw to 0x8491960 update_active_window: previously_active_window = 0x851bd70 (WNCK_IS_WINDOW = 1) update_active_window: new active (nil) (xid = 0), old active 0x8491960 update_active_window: setting paw to 0x8491960 update_active_window: setting aw to (nil) update_active_window: previously_active_window = 0x8491960 (WNCK_IS_WINDOW = 1) update_active_window: new active (nil) (xid = 0), old active 0x8491960 update_active_window: setting paw to 0x8491960 update_active_window: setting aw to (nil) update_active_window: previously_active_window = 0x8491960 (WNCK_IS_WINDOW = 1) update_active_window: new active (nil) (xid = 0), old active (nil) update_active_window: new active (nil) (xid = 0), old active (nil) update_active_window: new active 0x85f0420 (xid = 67108984), old active (nil) update_active_window: setting paw to (nil) update_active_window: setting aw to 0x85f0420 update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) update_active_window: new active 0x85f0420 (xid = 67108984), old active (nil) update_active_window: setting paw to (nil) update_active_window: setting aw to 0x85f0420 update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) update_active_window: new active 0x85f0420 (xid = 67108984), old active 0x85f0420 update_active_window: new active 0x85f0420 (xid = 67108984), old active 0x85f0420 update_active_window: new active 0x85f0420 (xid = 67108984), old active 0x85f0420 update_client_list: opening 0x86dbf40 update_active_window: new active 0x86dbf40 (xid = 80999044), old active 0x85f0420 update_active_window: setting paw to 0x85f0420 update_active_window: setting aw to 0x86dbf40 update_active_window: previously_active_window = 0x85f0420 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x86dbf40 (xid = 80999044), old active 0x85f0420 update_active_window: setting paw to 0x85f0420 update_active_window: setting aw to 0x86dbf40 update_active_window: previously_active_window = 0x85f0420 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x85f0420 (xid = 67108984), old active 0x86dbf40 update_active_window: setting paw to 0x86dbf40 update_active_window: setting aw to 0x85f0420 update_active_window: previously_active_window = 0x86dbf40 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x85f0420 (xid = 67108984), old active 0x86dbf40 update_active_window: setting paw to 0x86dbf40 update_active_window: setting aw to 0x85f0420 update_active_window: previously_active_window = 0x86dbf40 (WNCK_IS_WINDOW = 1) update_active_window: new active (nil) (xid = 0), old active 0x85f0420 update_active_window: setting paw to 0x85f0420 update_active_window: setting aw to (nil) update_active_window: previously_active_window = 0x85f0420 (WNCK_IS_WINDOW = 1) update_active_window: new active (nil) (xid = 0), old active 0x85f0420 update_active_window: setting paw to 0x85f0420 update_active_window: setting aw to (nil) update_active_window: previously_active_window = 0x85f0420 (WNCK_IS_WINDOW = 1) update_active_window: new active (nil) (xid = 0), old active (nil) update_active_window: new active (nil) (xid = 0), old active (nil) update_active_window: new active 0x86dbf40 (xid = 80999044), old active (nil) update_active_window: setting paw to (nil) update_active_window: setting aw to 0x86dbf40 update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) update_active_window: new active 0x86dbf40 (xid = 80999044), old active (nil) update_active_window: setting paw to (nil) update_active_window: setting aw to 0x86dbf40 update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) update_active_window: new active 0x86dbf40 (xid = 80999044), old active 0x86dbf40 update_active_window: new active 0x86dbf40 (xid = 80999044), old active 0x86dbf40 update_active_window: new active 0x84ebb70 (xid = 111149089), old active 0x86dbf40 update_active_window: setting paw to 0x86dbf40 update_active_window: setting aw to 0x84ebb70 update_active_window: previously_active_window = 0x86dbf40 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x84ebb70 (xid = 111149089), old active 0x86dbf40 update_active_window: setting paw to 0x86dbf40 update_active_window: setting aw to 0x84ebb70 update_active_window: previously_active_window = 0x86dbf40 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x86dbf40 (xid = 80999044), old active 0x84ebb70 update_active_window: setting paw to 0x84ebb70 update_active_window: setting aw to 0x86dbf40 update_active_window: previously_active_window = 0x84ebb70 (WNCK_IS_WINDOW = 1) update_active_window: new active 0x86dbf40 (xid = 80999044), old active 0x84ebb70 update_active_window: setting paw to 0x84ebb70 update_active_window: setting aw to 0x86dbf40 update_active_window: previously_active_window = 0x84ebb70 (WNCK_IS_WINDOW = 1) update_client_list: closing 0x86dbf40 update_client_list (closing aw): setting paw to 0x86dbf40 (will be invalid soon) update_client_list (closing aw): setting aw to NULL update_client_list: previously_active_window = 0x86dbf40 (WNCK_IS_WINDOW = 1) update_client_list (fix soonish invalidity): setting paw to NULL update_active_window: new active 0x84ebb70 (xid = 111149089), old active (nil) update_active_window: setting paw to (nil) update_active_window: setting aw to 0x84ebb70 update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) update_active_window: new active 0x84ebb70 (xid = 111149089), old active 0x86dbf40 update_active_window: setting paw to 0x86dbf40 update_active_window: setting aw to 0x84ebb70 update_active_window: previously_active_window = 0x86dbf40 (WNCK_IS_WINDOW = 0) Segmentation fault (core dumped)
Interesting. (In reply to comment #14) > update_active_window: new active 0x84ebb70 (xid = 111149089), old active (nil) > update_active_window: setting paw to (nil) > update_active_window: setting aw to 0x84ebb70 Here we set screen->priv->active_window to 0x84ebb70 and... > update_active_window: previously_active_window = (nil) (WNCK_IS_WINDOW = 0) > update_active_window: new active 0x84ebb70 (xid = 111149089), old active > 0x86dbf40 ... here, screen->priv->active_window is 0x86dbf40. Is there any chance you're running a multihead setup? If you don't know, just do the same thing, with the patch I'll attach in a few seconds.
Created attachment 90202 [details] [review] Debugging patch, with screen information
(In reply to comment #15) > > Is there any chance you're running a multihead setup? Yep, 100% chance. :-) > If you don't know, just > do the same thing, with the patch I'll attach in a few seconds. Do you still want the output with this patch or does my 100% confirmation suffice?
(In reply to comment #17) > (In reply to comment #15) > > > > Is there any chance you're running a multihead setup? > > Yep, 100% chance. :-) Ah, good, I think I know what happens, then :-) > > If you don't know, just > > do the same thing, with the patch I'll attach in a few seconds. > > Do you still want the output with this patch or does my 100% confirmation > suffice? No, it should be okay. I'll attach a new patch later today, and it should fix the bug. Testing will be necessary, of course ;-)
(In reply to comment #15) > Is there any chance you're running a multihead setup? If you don't know, just > do the same thing, with the patch I'll attach in a few seconds. I'm running multihead too. Was going to mention it but forgot :)
Created attachment 90209 [details] [review] Patch fixing the bug This should fix the bug. The problem is that the active window/previously active window is saved for each screen, while the setting is shared for all screens (this might not be always true, but that's what happens right now). So we end up with an invalid previously active window that has already been destroyed for a screen. Can you test the patch and tell me if it works?
I never moved the bug to libwnck, but I really should have. Anyway, hopefully the patch is okay and we'll close the bug soon :-)
(In reply to comment #20) > Created an attachment (id=90209) [edit] > Patch fixing the bug Seems to work so far. Have closed windows and no crash. Yay.
Cool. I've committed the patch, and it'll be in 2.19.4 (which I'll release within the next hour).