Launching a second instance of Shutter if one instance is already open causes a crash

Bug #731874 reported by Photon on 2011-03-09
54
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Shutter
Medium
Mario Kemper (Romario)

Bug Description

When Shutter is already open the use of Print or Alt+Print crashes it with following output:

Speicherzugriffsfehler

If using the shortcuts when Shutter isn't open everything works fine.

Rev. 1064 on Arch Linux

Full output attached.

Photon (michael-kogan) wrote :
description: updated

This does not happen when running Ubuntu, but I have seen those crashes during development. Could you please try different capture modes and check if Shutter crashes in all cases? See 'man shutter' for all available capture modes.

Seems to appear with all modes (selecting different modes in Preferences>Keyboard and then trying Alt+Print).

summary: - Using PrintScreen when Shuter is already open causes a crash
+ Using PrintScreen when Shutter is already open causes a crash
Photon (michael-kogan) wrote :

Using libunique 1.1.6 and perl-gtk2-unique 0.05.

Changed in shutter:
assignee: nobody → Mario Kemper (Romario) (mario-kemper)
importance: Undecided → Low
milestone: none → 0.88.x
status: New → Confirmed
Photon (michael-kogan) wrote :

I thought, you might be interested in the output of the new instance launched with another instance being open, the relevant lines are

WARNING **: Error while sending message: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus) at /usr/bin/shutter line 320, <DATA> line 19.

INFO: There is already another instance of Shutter running!

Also, the problem is not related to the PrintScreen shortcut, it appears also when both instances are launched from the terminal via "/usr/bin/shutter --full".

summary: - Using PrintScreen when Shutter is already open causes a crash
+ Launching a second instance of Shutter if one instance is already open
+ causes a crash
tags: added: instances
removed: shortkeys
bericp1 (bericp1) wrote :

Affects me too on Arch, all packages related to shutter up to date. Any other way to bind shortcut keys without running the shutter command again?

Changed in shutter:
milestone: upload → capture
patryk (pbratkowski) wrote :

Also have that problem running aur/shutter 0.90.1-1 and aur/shutter-bzr 1253-2

Using the bzr revision, if I change line 333 from
$app->send_message( $cmdid, text => '' );
to
$app->send_message( $cmdid, text => 'a' );

it no longer crashes when running shutter --full in another window. It appears that $message->get_text causes the segfault when text is set to an empty string.

It still crashes when using shutter --window, because on line 330, $extra is defined, but set to ''.

Sorry, I won't debug the whole thing but this should get you started in the right direction.

Sparhawk (sparhawkthesecond) wrote :

I see this bug too, but I just wanted to mention that if I start the first Shutter instance up in a terminal, it tells me that there was a "Segmentation fault (core dumped)". I'm not really sure where to find this dump though. I'm happy to debug more if you can tell me where to look.

Sparhawk (sparhawkthesecond) wrote :

Shutter has been accepted into the official Arch repos, and I've created a bug report on the Arch tracker. Please add any useful information and vote there.
https://bugs.archlinux.org/task/41357

Changed in shutter:
importance: Low → Medium
milestone: capture → 0.92
status: Confirmed → Fix Committed
Changed in shutter:
status: Fix Committed → Fix Released
Sparhawk (sparhawkthesecond) wrote :

I can confirm that this bug is fixed in Arch Linux. Thanks for sorting that out. Cheers.

Sparhawk (sparhawkthesecond) wrote :

Correction: this is fixed for new instances launched with `shutter --full`, but shutter still crashes if the new instance is launched with `shutter --select` or `shutter --window`. (This has been confirmed here: https://bugs.archlinux.org/task/41357#comment126225 )

Photon (michael-kogan) wrote :

I can also confirm the fix to be only partial. Also, running Shutter without any options leads to a crash.

Changed in shutter:
status: Fix Released → In Progress
Changed in shutter:
milestone: 0.92 → misc
Aleksej (aleksejrs) wrote :

Started happening to me recently (days to months) on Debian testing with Shutter 0.93.1 Rev.1278. No switches, --select, --section, or --full.

I don't know Perl nor GTK2 but I have fixed it for myself. The problem is that for some reason GTK2 is unable to parse received message containing an empty string which leads to segmentation fault. The ugly but working solution is to send a message with some unique text which should be replaced again to empty string after the message has been received, to simulate the same behaviour.

Sparhawk (sparhawkthesecond) wrote :

Thank you Wojciech! I can confirm that this patch fixes the bug on my system. I tested both `shutter --select` and `shutter --window`, and shutter no longer segfaults. Thanks for the fix!

Photon (michael-kogan) wrote :

Ii also confirm the fix and included it into Arch's Shutter package.

@michael-kogan you may also want to check out this:

https://github.com/Pastafarianist/shutter/commit/380c313840dd223e5b6c35720a79c338780f42d6

This is also a fix for the same issue, but a cleaner one, IMO.

Photon (michael-kogan) wrote :

Cool, I will have a look asap! In the mean time: I was thinking of creating a fork implementing all the patches currently available here on Launchpad. The only problem is that I don't even know Perl, so I wouldn't be able to review them. Maybe you are interested in applying the patches in your forked repo? I collected most of them in Shutter's AUR package: https://aur.archlinux.org/packages/shutter/

Photon (michael-kogan) wrote :

Tested it now (and included into the package), it works flawlessly, now there are no crashes even if you launch the second instance without any options. Thanks for the patch!

Photon (michael-kogan) wrote :

Applied patch fixing this in rev.1284.

Changed in shutter:
status: In Progress → Fix Committed
Photon (michael-kogan) on 2017-08-14
Changed in shutter:
milestone: misc → 0.94
Photon (michael-kogan) on 2017-08-16
Changed in shutter:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers