rjanja / desktop-capture

Screenshot and screencasting tools for Cinnamon.
40 stars 11 forks source link

Cinnamon crashes while trying to capture screenshot #46

Closed antifriz closed 7 years ago

antifriz commented 8 years ago

After an update to Desktop Capture v1.05 when I am trying to capture screenshot, Cinnamon (v2.8.5) crashes with this log:

Dec 03 22:59:33 zvijer kernel: cinnamon[4759]: segfault at 0 ip 00007ff70cefc11d sp 00007fff2c3070d8 error 4 in libc-2.22.so[7ff70ce62000+19b000]
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: Traceback (most recent call last):
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: File "/usr/bin/cinnamon-launcher", line 36, in <module>
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: os.execvp(FALLBACK_COMMAND, (FALLBACK_COMMAND,) + FALLBACK_ARGS)
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: File "/usr/lib/python2.7/os.py", line 346, in execvp
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: _execvpe(file, args)
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: File "/usr/lib/python2.7/os.py", line 382, in _execvpe
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: func(fullname, *argrest)
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: OSError: [Errno 2] No such file or directory
Dec 03 22:59:33 zvijer /usr/lib/gdm/gdm-x-session[4433]: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
Dec 03 22:59:34 zvijer systemd-coredump[4778]: Process 4759 (cinnamon) of user 1000 dumped core.

Stack trace of thread 4759:
#0  0x00007ff70cefc11d __strstr_sse2_unaligned (libc.so.6)
#1  0x00007ff70eafc971 cinnamon_screen_grabber_grab (libcinnamon.so)
#2  0x00007ff70eafbf45 n/a (libcinnamon.so)
#3  0x00007ff70eafbffb n/a (libcinnamon.so)
#4  0x00007ff70d741015 g_closure_invoke (libgobject-2.0.so.0)
#5  0x00007ff70d753304 n/a (libgobject-2.0.so.0)
#6  0x00007ff70d75bdfc g_signal_emit_valist (libgobject-2.0.so.0)
#7  0x00007ff70d75c12f g_signal_emit (libgobject-2.0.so.0)
#8  0x00007ff70e09760b clutter_actor_continue_paint (libclutter-1.0.so.0)
#9  0x00007ff70e09d76b n/a (libclutter-1.0.so.0)
#10 0x00007ff70e0f3d0b n/a (libclutter-1.0.so.0)
#11 0x00007ff70e086339 n/a (libclutter-1.0.so.0)
#12 0x00007ff70e0f2537 n/a (libclutter-1.0.so.0)
#13 0x00007ff70e0dc289 n/a (libclutter-1.0.so.0)
#14 0x00007ff70d46cdc7 g_main_context_dispatch (libglib-2.0.so.0)
#15 0x00007ff70d46d020 n/a (libglib-2.0.so.0)
#16 0x00007ff70d46d342 g_main_loop_run (libglib-2.0.so.0)
#17 0x00007ff70e850068 meta_run (libmuffin.so.0)
#18 0x00000000004017da main (cinnamon)
#19 0x00007ff70ce82610 __libc_start_main (libc.so.6)
#20 0x00000000004018b9 n/a (cinnamon)

Stack trace of thread 4766:
#0  0x00007ff70cf46cf9 syscall (libc.so.6)
#1  0x00007ff70d4b187a g_cond_wait_until (libglib-2.0.so.0)
#2  0x00007ff70d441a69 n/a (libglib-2.0.so.0)
#3  0x00007ff70d494086 n/a (libglib-2.0.so.0)
#4  0x00007ff70d493715 n/a (libglib-2.0.so.0)
#5  0x00007ff70d20d4a4 start_thread (libpthread.so.0)
#6  0x00007ff70cf4b13d __clone (libc.so.6)

Stack trace of thread 4763:
#0  0x00007ff70d21307f pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1  0x00007ff70417d4a0 PR_WaitCondVar (libnspr4.so)
#2  0x00007ff70c640324 n/a (libmozjs-24.so)
#3  0x00007ff704182d6b n/a (libnspr4.so)
#4  0x00007ff70d20d4a4 start_thread (libpthread.so.0)
#5  0x00007ff70cf4b13d __clone (libc.so.6)

Stack trace of thread 4762:
#0  0x00007ff70cf4218d poll (libc.so.6)
#1  0x00007ff70d46cfbc n/a (libglib-2.0.so.0)
#2  0x00007ff70d46d0cc g_main_context_iteration (libglib-2.0.so.0)
#3  0x00007ff6f9bc925d n/a (libdconfsettings.so)
#4  0x00007ff70d493715 n/a (libglib-2.0.so.0)
#5  0x00007ff70d20d4a4 start_thread (libpthread.so.0)
#6  0x00007ff70cf4b13d __clone (libc.so.6)

Stack trace of thread 4761:
#0  0x00007ff70cf4218d poll (libc.so.6)
#1  0x00007ff70d46cfbc n/a (libglib-2.0.so.0)
#2  0x00007ff70d46d342 g_main_loop_run (libglib-2.0.so.0)
#3  0x00007ff70da63236 n/a (libgio-2.0.so.0)
#4  0x00007ff70d493715 n/a (libglib-2.0.so.0)
#5  0x00007ff70d20d4a4 start_thread (libpthread.so.0)
#6  0x00007ff70cf4b13d __clone (libc.so.6)

Stack trace of thread 4760:
#0  0x00007ff70cf4218d poll (libc.so.6)
#1  0x00007ff70d46cfbc n/a (libglib-2.0.so.0)
#2  0x00007ff70d46d0cc g_main_context_iteration (libglib-2.0.so.0)
#3  0x00007ff70d46d109 n/a (libglib-2.0.so.0)
#4  0x00007ff70d493715 n/a (libglib-2.0.so.0)
#5  0x00007ff70d20d4a4 start_thread (libpthread.so.0)
#6  0x00007ff70cf4b13d __clone (libc.so.6)

Stack trace of thread 4764:
#0  0x00007ff70d21307f pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
#1  0x00007ff70417d4a0 PR_WaitCondVar (libnspr4.so)
#2  0x00007ff70c6b36ae n/a (libmozjs-24.so)
#3  0x00007ff704182d6b n/a (libnspr4.so)
#4  0x00007ff70d20d4a4 start_thread (libpthread.so.0)
#5  0x00007ff70cf4b13d __clone (libc.so.6)
rjanja commented 8 years ago

Hi, thank you for the report, I will be looking into this today.

ghost commented 8 years ago

I'm having the same issue:

Jan 29 19:51:19 XXXXXXXXXXXXXXXXXXXXXXXXX systemd-coredump[1929]: Process 1826 (cinnamon) of user 1000 dumped core.

                                                                  Stack trace of thread 1826:
                                                                  #0  0x00007fac91329e7d __strstr_sse2_unaligned (libc.so.6)
                                                                  #1  0x00007fac9adbd2c1 cinnamon_screen_grabber_grab (libcinnamon.so)
                                                                  #2  0x00007fac9adbc895 do_grab_screenshot.isra.2 (libcinnamon.so)
                                                                  #3  0x00007fac9adbcb32 grab_area_screenshot (libcinnamon.so)
                                                                  #4  0x00007fac91ba87a5 g_closure_invoke (libgobject-2.0.so.0)
                                                                  #5  0x00007fac91bbaaf4 signal_emit_unlocked_R (libgobject-2.0.so.0)
                                                                  #6  0x00007fac91bc3530 g_signal_emit_valist (libgobject-2.0.so.0)
                                                                  #7  0x00007fac91bc38ff g_signal_emit (libgobject-2.0.so.0)
                                                                  #8  0x00007fac972e06cb clutter_actor_continue_paint (libclutter-1.0.so.0)
                                                                  #9  0x00007fac972e682b clutter_actor_paint.part.41 (libclutter-1.0.so.0)
                                                                  #10 0x00007fac9733ce2b _clutter_stage_do_paint (libclutter-1.0.so.0)
                                                                  #11 0x00007fac972cf419 clutter_stage_cogl_redraw (libclutter-1.0.so.0)
                                                                  #12 0x00007fac9733b657 _clutter_stage_do_update (libclutter-1.0.so.0)
                                                                  #13 0x00007fac97325389 clutter_clock_dispatch (libclutter-1.0.so.0)
                                                                  #14 0x00007fac918a9e3a g_main_context_dispatch (libglib-2.0.so.0)
                                                                  #15 0x00007fac918aa1d0 g_main_context_iterate.isra.29 (libglib-2.0.so.0)
                                                                  #16 0x00007fac918aa4f2 g_main_loop_run (libglib-2.0.so.0)
                                                                  #17 0x00007fac9a90d648 meta_run (libmuffin.so.0)
                                                                  #18 0x0000555e56a3ed0b main (cinnamon)
                                                                  #19 0x00007fac912a2580 __libc_start_main (libc.so.6)
                                                                  #20 0x0000555e56a3edf9 _start (cinnamon)

                                                                  Stack trace of thread 1828:
                                                                  #0  0x00007fac91378fdd poll (libc.so.6)
                                                                  #1  0x00007fac918aa16c g_main_context_iterate.isra.29 (libglib-2.0.so.0)
                                                                  #2  0x00007fac918aa4f2 g_main_loop_run (libglib-2.0.so.0)
                                                                  #3  0x00007fac92321336 gdbus_shared_thread_func (libgio-2.0.so.0)
                                                                  #4  0x00007fac918d0835 g_thread_proxy (libglib-2.0.so.0)
                                                                  #5  0x00007fac9164a60a start_thread (libpthread.so.0)
                                                                  #6  0x00007fac91384a4d __clone (libc.so.6)

                                                                  Stack trace of thread 1829:
                                                                  #0  0x00007fac91378fdd poll (libc.so.6)
                                                                  #1  0x00007fac918aa16c g_main_context_iterate.isra.29 (libglib-2.0.so.0)
                                                                  #2  0x00007fac918aa27c g_main_context_iteration (libglib-2.0.so.0)
                                                                  #3  0x00007fac775f92ad dconf_gdbus_worker_thread (libdconfsettings.so)
                                                                  #4  0x00007fac918d0835 g_thread_proxy (libglib-2.0.so.0)
                                                                  #5  0x00007fac9164a60a start_thread (libpthread.so.0)
                                                                  #6  0x00007fac91384a4d __clone (libc.so.6)

                                                                  Stack trace of thread 1831:
                                                                  #0  0x00007fac9164fb10 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                                                                  #1  0x00007fac8f41dcf0 PR_WaitCondVar (libnspr4.so)
                                                                  #2  0x00007fac9a121046 _ZN2js22SourceCompressorThread16compressorThreadEPv (libmozjs-24.so)
                                                                  #3  0x00007fac8f4235cb _pt_root (libnspr4.so)
                                                                  #4  0x00007fac9164a60a start_thread (libpthread.so.0)
                                                                  #5  0x00007fac91384a4d __clone (libc.so.6)

                                                                  Stack trace of thread 1827:
                                                                  #0  0x00007fac91378fdd poll (libc.so.6)
                                                                  #1  0x00007fac918aa16c g_main_context_iterate.isra.29 (libglib-2.0.so.0)
                                                                  #2  0x00007fac918aa27c g_main_context_iteration (libglib-2.0.so.0)
                                                                  #3  0x00007fac918aa2b9 glib_worker_main (libglib-2.0.so.0)
                                                                  #4  0x00007fac918d0835 g_thread_proxy (libglib-2.0.so.0)
                                                                  #5  0x00007fac9164a60a start_thread (libpthread.so.0)
                                                                  #6  0x00007fac91384a4d __clone (libc.so.6)

                                                                  Stack trace of thread 1830:
                                                                  #0  0x00007fac9164fb10 pthread_cond_wait@@GLIBC_2.3.2 (libpthread.so.0)
                                                                  #1  0x00007fac8f41dcf0 PR_WaitCondVar (libnspr4.so)
                                                                  #2  0x00007fac9a0ad69e _ZN2js14GCHelperThread10threadLoopEv (libmozjs-24.so)
                                                                  #3  0x00007fac8f4235cb _pt_root (libnspr4.so)
                                                                  #4  0x00007fac9164a60a start_thread (libpthread.so.0)
                                                                  #5  0x00007fac91384a4d __clone (libc.so.6)

                                                                  Stack trace of thread 1928:
                                                                  #0  0x00007fac9137ec59 syscall (libc.so.6)
                                                                  #1  0x00007fac918ee99a g_cond_wait_until (libglib-2.0.so.0)
                                                                  #2  0x00007fac9187ec09 g_async_queue_pop_intern_unlocked (libglib-2.0.so.0)
                                                                  #3  0x00007fac9187f22b g_async_queue_timeout_pop (libglib-2.0.so.0)
                                                                  #4  0x00007fac918d128a g_thread_pool_thread_proxy (libglib-2.0.so.0)
                                                                  #5  0x00007fac918d0835 g_thread_proxy (libglib-2.0.so.0)
                                                                  #6  0x00007fac9164a60a start_thread (libpthread.so.0)
                                                                  #7  0x00007fac91384a4d __clone (libc.so.6)
Jan 29 19:51:17 XXXXXXXXXXXXXXXXXXXXXXXXX audit[1826]: ANOM_ABEND auid=1000 uid=1000 gid=1000 ses=1 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=1826 comm="cinnamon" exe="/usr/bin/cinnamon" sig=11
Jan 29 19:51:17 XXXXXXXXXXXXXXXXXXXXXXXXX kernel: cinnamon[1826]: segfault at 0 ip 00007fac91329e7d sp 00007ffcbbf1c748 error 4 in libc-2.22.so[7fac91282000+1b7000
rjanja commented 8 years ago

Thanks for the report. Can you give me your Cinnamon version, and which screenshot and video capture tool you're currently trying to use via this applet?

rjanja commented 8 years ago

It would also help if you could include the snippet of ~/.cinnamon/glass.log leading up to the crash. There should be some Desktop Capture specific details in there that will help me track this down. Note this file is only created if "Log LookingGlass output" is enabled under Cinnamon's Preferences -> General tab.

antifriz commented 8 years ago
info t=2016-01-30T17:49:58.852Z Cinnamon.AppSystem.get_default() started in 31 ms
info t=2016-01-30T17:49:58.855Z loading default theme
info t=2016-01-30T17:49:58.911Z PlacesManager: Updating devices
info t=2016-01-30T17:49:58.925Z loaded at Sat Jan 30 2016 18:49:58 GMT+0100 (CET)
info t=2016-01-30T17:49:59.207Z Loaded applet menu@cinnamon.org in 281 ms
info t=2016-01-30T17:49:59.222Z Role locked: panellauncher
info t=2016-01-30T17:49:59.222Z Loaded applet panel-launchers@cinnamon.org in 14 ms
info t=2016-01-30T17:49:59.228Z Role locked: notifications
info t=2016-01-30T17:49:59.230Z Loaded applet notifications@cinnamon.org in 7 ms
info t=2016-01-30T17:49:59.245Z Loaded applet user@cinnamon.org in 14 ms
info t=2016-01-30T17:49:59.252Z Loaded applet removable-drives@cinnamon.org in 6 ms
info t=2016-01-30T17:49:59.276Z Loaded applet keyboard@cinnamon.org in 23 ms
info t=2016-01-30T17:49:59.331Z Loaded applet network@cinnamon.org in 54 ms
info t=2016-01-30T17:49:59.354Z Loaded applet sound@cinnamon.org in 22 ms
info t=2016-01-30T17:49:59.366Z Loaded applet power@cinnamon.org in 11 ms
info t=2016-01-30T17:49:59.372Z Loaded applet systray@cinnamon.org in 6 ms
info t=2016-01-30T17:49:59.386Z Loaded applet calendar@cinnamon.org in 13 ms
info t=2016-01-30T17:49:59.400Z capture@rjanja: Using AppletSettings
info t=2016-01-30T17:49:59.477Z Loaded applet capture@rjanja in 90 ms
info t=2016-01-30T17:49:59.477Z AppletManager.init() started in 552 ms
info t=2016-01-30T17:49:59.478Z Cinnamon took 668 ms to start
info t=2016-01-30T17:49:59.839Z Adding systray: unknown (20x20px)
info t=2016-01-30T17:49:59.841Z Hiding systray: network

this is mine ~/.cinnamon/glass.log

rjanja commented 8 years ago

Thanks @antifriz, that's the start-up. When you go to make a capture, assuming it will crash again, it should have more entries in it that may point to the problem.

antifriz commented 8 years ago

it just adds this line to log: info t=2016-01-30T17:55:24.102Z Initializing screenshot tool

rjanja commented 8 years ago

Ok, thanks @antifriz. That's the built-in screenshot grabber. I'll take another look at it. Appreciate your feedback and patience.

rjanja commented 8 years ago

@antifriz can you please try using the default screenshot tool that comes with Cinnamon and let me know if it works? It is in the menu under Accessories -> Screenshot

antifriz commented 8 years ago

@rjanja the default one works fine

rjanja commented 8 years ago

Oh jeez. The default tool should be using Cinnamon's capture backend similarly to how this applet uses it. In your initial report you said "after an upgrade to 1.05" - was the previous version working for you? Did you also do a system update?

I will put together another version that logs more verbosely, and hope that you'll have the patience to upgrade the applet and try it, and send those logs my way.

antifriz commented 8 years ago

@rjanja I did a system update. This had already happened a few months ago and was fixed by system and/or desktop-capture update. But from this report till now neither update fixed this issue. I will try new version and send you logs.

Also, looking again at logs, probably dumb idea but could this be a python-version-related issue?

rjanja commented 8 years ago

It isn't likely a python issue. My guess is that it's related to desktop environment and display libraries. I haven't been able to cause a segfault here.

I'll put together a new version and let you know when it is ready. It'll be 1.06. Though it won't change anything it may shed some light on where it's failing, if it's within the communication between applet and Cinnamon.

rjanja commented 8 years ago

Hi @antifriz, I've been looking into this more and am fairly certain it is not an applet problem. The default screenshot tool in Accessories does not use the built-in Cinnamon screenshot code after all, but native X libraries instead.

The log entry you shared with me happens right before we ask Cinnamon to take the screenshot, and at that point it's out of the control of the Desktop Capture applet. So this may imply there's a problem with your video drivers or a bug in Cinnamon itself.

I've been reviewing the Cinnamon source that handles these screenshots and have found at least one problem which prevents us from giving you a simple command you can verify this with, which is disappointing because I'd like to be 100% sure it's not an applet problem. I'll be working on a fix for that one, but even so it won't resolve the crashing you're seeing, only allow you to trigger it outside of this applet.

What video driver, and video card are you using? I would suggest checking those drivers are up to date. I would also highlight the fact that you are using GDM, from which MDM was forked. In the Cinnamon world, the Mint-developed forks should be used together for the best, most stable results. If you are running GDM because you also use Gnome Shell, then that is understandable, but you might try the Mint fork.

rjanja commented 8 years ago

I've submitted a patch to the dev team for the somewhat unrelated issue I mentioned above.

I've also found a way for you to verify if the problem is with Cinnamon or this applet. Please replace the path in this command with a path to an image which doesn't exist on your system, and see if it is created. dbus-send --print-reply --type=method_call --dest=org.Cinnamon /org/Cinnamon org.Cinnamon.Eval string:"const CinnamonGi = imports.gi.Cinnamon; let ss = new CinnamonGi.Screenshot(); ss.screenshot(true, '/home/radams/Pictures/okitworks.png', function(){})"

Most likely this will exhibit the same problem, i.e. crash your Cinnamon, so save your docs before. On my system it results in an okitworks.png being created and containing a full screen capture.

antifriz commented 8 years ago

Hi @rjanja, sorry for delay, i tried the upper command (and I replaced the path with my custom path and crash happened again. It seems it's Cinnamon related.

What video driver, and video card are you using?

 $ cat /proc/driver/nvidia/version                                                                                                                                    
NVRM version: NVIDIA UNIX x86_64 Kernel Module  358.16  Mon Nov 16 19:25:55 PST 2015
GCC version:  gcc version 5.2.0 (GCC) 
$ lspci | grep "NVIDIA"                                                                                                                                              
08:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 840M] (rev a2)

Also to mention, I use Arch with Cinnamon.

ghost commented 8 years ago

The command you posted above also crashes Cinnamon on my system, however I am using boring old i915:

lshw -class video *-display
description: VGA compatible controller product: Haswell-ULT Integrated Graphics Controller vendor: Intel Corporation physical id: 2 bus info: pci@0000:00:02.0 version: 0b width: 64 bits clock: 33MHz capabilities: msi pm vga_controller bus_master cap_list rom configuration: driver=i915 latency=0 resources: irq:46 memory:e0000000-e03fffff memory:c0000000-dfffffff ioport:3000(size=64)

zerog2k commented 8 years ago

also having this crashing. Seems that it was working ok a few months ago with Fedora 21. Upgraded (inplace) to Fedora 23 a few weeks back.

$ sudo lshw -class video *-display
description: VGA compatible controller product: G98 [Quadro NVS 295] vendor: NVIDIA Corporation physical id: 0 bus info: pci@0000:01:00.0 version: a1 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress vga_controller bus_master cap_list rom configuration: driver=nouveau latency=0 resources: irq:28 memory:f1000000-f1ffffff memory:f8000000-fbffffff memory:f2000000-f3ffffff ioport:1100(size=128) $

rjanja commented 8 years ago

@zerog2k have you tried using the nvidia driver instead of nouveau?

I'm pretty sure this is a video driver or Cinnamon problem. While I'd like to help track it down I'm not sure there's much I can do.

amyers2301 commented 8 years ago

I too am having the issue. The default screenshot works fine but the applet crashes Cinnamon. Running Fedora 23.

leigh123linux commented 7 years ago

Fixed in cinnamon-3.2.0

https://github.com/linuxmint/Cinnamon/pull/5777