After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 707014 - Pressing the Export button in Properties->Details leads to a crash
Pressing the Export button in Properties->Details leads to a crash
Status: RESOLVED FIXED
Product: seahorse
Classification: Applications
Component: general
git master
Other Linux
: Normal critical
: ---
Assigned To: Seahorse Maintainer
Seahorse Maintainer
Depends on:
Blocks:
 
 
Reported: 2013-08-28 20:47 UTC by Aruna Sankaranarayanan
Modified: 2013-11-19 09:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ui: fix pgp/ssh key export (2.47 KB, patch)
2013-11-07 01:50 UTC, Sebastian Keller
none Details | Review
ui: fix pgp/ssh key export (2.46 KB, patch)
2013-11-07 02:08 UTC, Sebastian Keller
none Details | Review
ui: fix pgp/ssh key export (2.58 KB, patch)
2013-11-07 14:12 UTC, Sebastian Keller
committed Details | Review

Description Aruna Sankaranarayanan 2013-08-28 20:47:27 UTC
Steps to reproduce:
Select a GnuPG key.
Right click: Properties->Details.
Press Export button on the right, next to Export Complete Key.

Result:
Seahorse crashes with a segfault.

Expected result:
A Nautilus dialog should be shown with options to save the ASCII keyfile.
Comment 1 Aruna Sankaranarayanan 2013-08-30 14:22:37 UTC
The same bug is true for SSH keys too.

So,
Select an open SSH key
Right click: Properties->Details.
Press the Export Complete Key button.

Result:
Seahorse crashes with a segfault.

Expected result:
Nautilus dialog shown with options to save the keyfile.
Comment 2 Kat 2013-08-30 14:29:45 UTC
I get the same bug when running seahorse in jhbuild.
Comment 3 Pedro Albuquerque 2013-11-07 00:20:10 UTC
I'm having the same problem under openSUSE 13.1 RC2, using GNOME 3.10.1.
I tried to debug it with gdb and I get the following output the moment it crashes:
Program received signal SIGSEGV, Segmentation fault.
seahorse_exportable_prompt (exporters=exporters@entry=0x845e40 = {...}, parent=parent@entry=0xac9070, 
    directory=directory@entry=0x0, chosen_file=chosen_file@entry=0x7fffffffd088, 
    chosen_exporter=chosen_exporter@entry=0x7fffffffd080) at /data/projects/seahorse/common/exportable.vala:202
202	/data/projects/seahorse/common/exportable.vala: No such file or directory.

I hope it helps solving the problem. It seems that it is a missing/misplaced file.
Comment 4 Pedro Albuquerque 2013-11-07 00:41:05 UTC
The problem seems to be in the 202 line of this file: https://git.gnome.org/browse/seahorse/tree/common/exportable.vala?id=3.10.1#n202
Comment 5 Sebastian Keller 2013-11-07 01:50:27 UTC
Created attachment 259150 [details] [review]
ui: fix pgp/ssh key export

I'm not sure if this is the best way to fix this since I don't really know much vala but the patch makes sense to me and fixes the issue.
Comment 6 Sebastian Keller 2013-11-07 02:08:27 UTC
Created attachment 259151 [details] [review]
ui: fix pgp/ssh key export

This time with tabs instead of spaces :)
Comment 7 Sebastian Keller 2013-11-07 14:12:46 UTC
Created attachment 259192 [details] [review]
ui: fix pgp/ssh key export

And this time without memory leaks...
Comment 8 Stef Walter 2013-11-11 14:52:56 UTC
Review of attachment 259192 [details] [review]:

Makes sense. Thanks for catching this. Do you know it's trivial to have the vala code accept NULL for out params? If not, no biggie, please merge anyway.
Comment 9 Sebastian Keller 2013-11-11 15:07:09 UTC
I don't have much experience with vala myself but when I asked in the vala irc channel about this I got the following reply:

<borschty_> is there any way to mark the reference as nullable?
<nemequ> borschty_, not really.  you could resort to using pointers in vala and handling the memory yourself, but that would be an api break


Another (also api breaking) way of fixing this would be to remove the directory argument entirely as it does not seem to be used by any of the callers.

Also I don't have commit access so could you please push the patch if you accept it?
Comment 10 Stef Walter 2013-11-19 09:29:53 UTC
Thanks for the patch.

Attachment 259192 [details] pushed as b8efbb1 - ui: fix pgp/ssh key export