linuxmint / muffin

The window management library for the Cinnamon desktop (libmuffin) and its sample WM binary (muffin)
GNU General Public License v2.0
196 stars 91 forks source link

Segfault when closing fullscreen window #249

Closed ChrisJAllan closed 8 years ago

ChrisJAllan commented 8 years ago

Cinnamon segfaults in libmuffin any time a fullscreen window is closed.

Arch Linux, Cinnamon 3.0.5, Muffin 3.0.4

dmesg: [54293.295134] cinnamon[8712]: segfault at 18 ip 00007efbf78f30a0 sp 00007ffbffffb178 error 4 in libmuffin.so.0.0.0[7efbf7890000+bc000]

trace:

Stack trace of thread 8712:
#0  0x00007efbf78f30a0 meta_window_get_display (libmuffin.so.0)
#1  0x00007efbf78c276b n/a (libmuffin.so.0)
#2  0x00007efbf78b85f9 n/a (libmuffin.so.0)
#3  0x00007efbf7166694 n/a (libclutter-1.0.so.0)
#4  0x00007efbf7167437 n/a (libclutter-1.0.so.0)
#5  0x00007efbf64eedd7 g_main_context_dispatch (libglib-2.0.so.0)
#6  0x00007efbf64ef040 n/a (libglib-2.0.so.0)
#7  0x00007efbf64ef362 g_main_loop_run (libglib-2.0.so.0)
#8  0x00007efbf78da55c meta_run (libmuffin.so.0)
#9  0x000000000040181d n/a (cinnamon)
#10 0x00007efbf5f07741 __libc_start_main (libc.so.6)
#11 0x0000000000401909 n/a (cinnamon)

Edit: Stack trace with fresh git build and debug symbols:

Process 6889 (cinnamon) of user 1000 dumped core.

Stack trace of thread 6889:
#0  0x00007efbf7b7bb80 meta_window_get_display (libmuffin.so)
#1  0x00007efbf7b4c7db meta_window_actor_set_redirected (libmuffin.so)
#2  0x00007efbf7b42b19 meta_pre_paint_func (libmuffin.so)
#3  0x00007efbf7169694 n/a (libclutter-1.0.so.0)
#4  0x00007efbf716a437 n/a (libclutter-1.0.so.0)
#5  0x00007efbf64f1dd7 g_main_context_dispatch (libglib-2.0.so.0)
#6  0x00007efbf64f2040 n/a (libglib-2.0.so.0)
#7  0x00007efbf64f2362 g_main_loop_run (libglib-2.0.so.0)
#8  0x00007efbf7b63eec meta_run (libmuffin.so)
#9  0x000000000040181d n/a (cinnamon)
#10 0x00007efbf5f0a741 __libc_start_main (libc.so.6)
#11 0x0000000000401909 n/a (cinnamon)
JosephMcc commented 8 years ago

Seems ok here. Can you provide an example of an application it's happening with and how you are closing it?

ChrisJAllan commented 8 years ago

It happens with mpv by pressing 'q' and various wine games, but not with anything else I tried (gedit, chromium, native games) and also not when closing with alt-f4. Could it be an application error?

JosephMcc commented 8 years ago

Not sure. I tried it with a couple things and couldn't reproduce it so was just hoping to figure out how.

ac000 commented 8 years ago

Yes, I have been seeing this also under Fedora 23/24 (64bit). For me it happens with mplayer. Currently running cinnamon-3.0.6 & muffin-3.0.5

It doesn't happen consistently. The first time running mplayer after logging into cinnamon it will crash cinnamon, then it can be run several times before crashing it again, until logging out and in again where it will happen on the first run of mplayer.

I haven't seen this with vlc, totem or ffplay.

I'm running on an Intel Baytrail system if that makes any difference.

00:02.0 VGA compatible controller: Intel Corporation Atom Processor Z36xxx/Z37xxx Series Graphics & Display (rev 0e)

$ glxinfo | grep ^OpenGL OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) Bay Trail OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.2 (git-5de088f) OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 3.0 Mesa 11.2.2 (git-5de088f) OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.2.2 (git-5de088f) OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00 OpenGL ES profile extensions:

JosephMcc commented 8 years ago

I tried here with mpv. Start playing something fullscreen the window and then close with 'q'. No problems. This is on Mint 18

gamegard68 commented 8 years ago

I've the same issue with the Tomb Raider game running under LMDE2 Cinnamon 64bit.
The game runs smoothly in full screen but when I exit the game the following segfault appears and cinnamon restarts.

When running again Tomb Raider no segfaults observed anymore only after logout/login of DE.

dmesg: [ 7727.667689] cinnamon[3797]: segfault at 18 ip 00007f9ddd1c8b80 sp 00007ffe01d77eb8 error 4 in libmuffin.so.0.0.0[7f9ddd166000+bc000]

.xsession-errors: TombRaider: crash reporter initialised with path "/home/jdoe/.local/share/feral-interactive/Tomb Raider/crashes" Setting breakpad minidump AppID = 203160 Steam_SetMinidumpSteamID: Caching Steam ID: 76561198074590943 [API loaded no] Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 70: non-double matrix element Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 78: saw unknown, expected number Window manager warning: Treating resize request of legacy application 0x4a0001a (Tomb Raide) as a fullscreen request ERROR: ld.so: object 'libminimum_thread_stack_size_wrapper.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. Total loaded objects: 0Game removed: AppID 203160 "Tomb Raider", ProcID 14080 No cached sticky mapping in ActivateActionSet.Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

(gnome-panel:14202): Gtk-CRITICAL **: gtk_accelerator_parse_with_keycode: assertion 'accelerator != NULL' failed

\ (gnome-panel:14202): WARNING **: Unable to parse mouse modifier '(null)'

** metacity:ERROR:ui/ui.c:604:meta_ui_get_default_window_icon: assertion failed: (default_icon) cinnamon-session[3596]: WARNING: t+5959.91061s: App 'cinnamon.desktop' respawning too quickly cinnamon-session[3596]: CRITICAL: t+5959.91088s: We failed, but the fail whale is dead. Sorry.... cinnamon-session[3596]: WARNING: t+5959.91385s: Application 'cinnamon.desktop' killed by signal 15 cinnamon-session[3596]: WARNING: t+5959.91390s: App 'cinnamon.desktop' respawning too quickly Panel leaving: a new panel shell is starting.

(gnome-panel:14202): EggSMClient-CRITICAL **: egg_sm_client_set_mode: assertion 'global_client == NULL || global_client_mode == EGG_SM_CLIENT_MODE_DISABLED' failed cinnamon-session[3596]: WARNING: t+5960.11237s: App 'cinnamon.desktop' respawning too quickly cinnamon-session[3596]: WARNING: t+5960.11255s: App 'cinnamon.desktop' respawning too quickly Cjs-Message: JS LOG: About to start Cinnamon

inxi -Fxz System: Host: chatool Kernel: 3.16.7-ckt20-2-amd64-bfq x86_64 (64 bit gcc: 4.9.2) Desktop: Cinnamon 3.0.6 (Gtk 3.14.5) Distro: Linux Mint Debian Edition Machine: Mobo: Gigabyte model: Z97-HD3 v: x.x Bios: American Megatrends v: F9 date: 07/31/2015 CPU: Quad core Intel Core i5-4460 (-MCP-) cache: 6144 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 25608 Clock Speeds: 1: 3273 MHz 2: 3357 MHz 3: 3251 MHz 4: 3202 MHz Graphics: Card: NVIDIA GM107 [GeForce GTX 750] bus-ID: 01:00.0 Display Server: X.Org 1.16.4 driver: nvidia Resolution: 1920x1080@60.00hz GLX Renderer: GeForce GTX 750/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 367.27 Direct Rendering: Yes Audio: Card-1 NVIDIA Device 0fbc bus-ID: 01:00.1 Sound: ALSA v: k3.16.7-ckt20-2-amd64-bfq Card-2 Creative Labs SB Audigy driver: snd_emu10k1 port: c000 bus-ID: 05:01.0 Network: Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169 v: 2.3LK-NAPI port: d000 bus-ID: 03:00.0 IF: eth2 state: up speed: 100 Mbps duplex: full mac: Drives: HDD Total Size: 1750.4GB (53.7% used) ID-1: /dev/sdc model: ST3750640NS size: 750.2GB temp: 41C ID-2: /dev/sda model: WDC_WD5000AAKX size: 500.1GB temp: 35C ID-3: /dev/sdb model: WDC_WD5000AAKS size: 500.1GB temp: 33C Partition: ID-1: / size: 36G used: 19G (55%) fs: ext4 dev: /dev/sda1 ID-2: /home size: 58G used: 36G (64%) fs: ext3 dev: /dev/sda6 ID-3: swap-1 size: 8.59GB used: 0.00GB (0%) fs: swap dev: /dev/sda5 Sensors: System Temperatures: cpu: 29.8C mobo: 27.8C gpu: 0.0:31C Fan Speeds (in rpm): cpu: N/A Info: Processes: 191 Uptime: 2:14 Memory: 1774.8/7908.8MB Init: SysVinit runlevel: 2 Gcc sys: 4.9.2 Client: Shell (bash 4.3.301) inxi: 2.1.28

nvidia drivers Tested following nvidia drivers with same result: 352.79, 364.19 and 367.27.

ac000 commented 8 years ago

Here's a more thorough backtrace from the core file in gdb

0 0x00007fe49451f160 in meta_window_get_display (window=0x0)

at core/window.c:11279

1 0x00007fe4944ee76b in meta_window_actor_set_redirected (self=0x561fdb696ec0 [MetaWindowActor], state=state@entry=1) at compositor/meta-window-actor.c:1316

2 0x00007fe4944e45f9 in meta_pre_paint_func (data=0x561fd9453590)

at compositor/compositor.c:1351

3 0x00007fe490fdb457 in _clutter_run_repaint_functions (flags=flags@entry=CLUTTER_REPAINT_FLAGS_PRE_PAINT) at clutter-main.c:3449

4 0x00007fe490fdc1f7 in clutter_clock_dispatch (master_clock=0x561fd9380b00 [ClutterMasterClockDefault], stages=0x561fd9dbbb20 = {...})

at clutter-master-clock-default.c:437

5 0x00007fe490fdc1f7 in clutter_clock_dispatch (source=source@entry=0x561fd9392920, callback=, user_data=)

at clutter-master-clock-default.c:567

6 0x00007fe48ba17703 in g_main_context_dispatch (context=0x561fd8eb4bb0)

at gmain.c:3154

7 0x00007fe48ba17703 in g_main_context_dispatch (context=context@entry=0x561fd8eb4bb0) at gmain.c:3769

8 0x00007fe48ba17ab0 in g_main_context_iterate (context=0x561fd8eb4bb0, block=block@entry=1, dispatch=dispatch@entry=1, self=) at gmain.c:3840

9 0x00007fe48ba17dd2 in g_main_loop_run (loop=0x561fd8eb5690) at gmain.c:4034

10 0x00007fe4945065dc in meta_run () at core/main.c:542

11 0x0000561fd87d1ba4 in main (argc=, argv=)

at main.c:329

So it looks like the segfault is due to window being null in meta_window_get_display()

Given the proceeding call to meta_window_actor_set_redirected() I'm going to see if I can hit this with org.cinnamon.muffin.unredirect-fullscreen-windows set to false.

ac000 commented 8 years ago

Not so far at least...

ChrisJAllan commented 8 years ago

That seems to work, thanks!

gamegard68 commented 8 years ago

Indeed, setting unredirect-fullscreen-windows to false did the trick. No more segfaults but less fps for Tomb Raider ...

mtwebster commented 8 years ago

There's an obvious fix/patch for this, but I'm still working to reproduce it on my machine here - I'd like to make sure this isn't just some final symptom of something more devious at work.

mtwebster commented 8 years ago

Does this happen strictly when closing a program? Not just un-fullscreening? It sounds like it from the posts but I'd like to be clear.

ChrisJAllan commented 8 years ago

Yes, only when closing.

itzexor commented 8 years ago

Sorry I didn't see this bug report before, I have been testing a fix for this issue since May locally. I have opened a PR for it here (also includes some other fixes) https://github.com/linuxmint/muffin/pull/250

krsoulsby commented 8 years ago

I have installed the latest version of muffin with the above fix implemented and find that cinnamon does not crash after closing a full screen window if the compositing is not disabled for full screens. If compositing is disabled for full screen windows then cinnamon does appear to crash and ask if you want to restart or use fall back mode.

itzexor commented 8 years ago

Can you get a trace? The bug described in this issue should be fixed. If the trace is different, open a new issue please.

JosephMcc commented 8 years ago

I'm going to reopen this for now. The original issue is that Cinnamon crashes when closing full screen windows with "Disable compositing for full screen windows" turned on. According to @krsoulsby he is still seeing the same problem even with the above fix merged.

Even if the root cause is different it's still the same symptoms.

itzexor commented 8 years ago

@krsoulsby Did you compile muffin from git or patch 3.0.5? A version including the fix hasn't been released officially yet.

krsoulsby commented 8 years ago

I compiled muffin from git using the mint-dev-build, I looked in the source code and it looked like the patch was applied, though I might have been mistaken

From my log I get

kernel: [11564.228131] cinnamon[9683]: segfault at 18 ip 00007f2425e94680 sp 00007ffeaa20d818 error 4 in libmuffin.so.0.0.0[7f2425e35000+b9000]

when closing the full screen window. There has been a change, I used to get a crash if compositing was disabled or not. Now I only get the crash with compositing on full screen windows disabled.

krsoulsby commented 8 years ago

Apologies, I may have mislead you. Just recompiled the latest git version and tested with no problems but noticed the update manager now wants to update Muffin to 3.0.5+sarah replacing the 3.0.5 version built by mint-dev-build. I may have updated this with out realising the difference previously and lost the git version. Have temporally stopped update manager updating muffin in the short term

itzexor commented 8 years ago

No problem. If the issue persists with the locally compiled version, follow these steps here provided by @mtwebster to get a full backtrace that can help us track down the issue.

https://github.com/linuxmint/Cinnamon/issues/4932#issuecomment-170778051

The debug symbols may not match, though, since you're using a locally compiled version. If that is the case you may need to also generate a cinnamon-dbg package rather than installing the repo version.

gamegard68 commented 8 years ago

Successfully verified fix. After exiting Tomb Raider when unredirect-fullscreen-windows is set to true no more segfaults or crashes are observed. Thank you guys and open source !

aFoxNamedMorris commented 7 years ago

It's happening for me with Mint 18 specifically with programs running in Wine.