GNOME Bugzilla – Bug 707014
Pressing the Export button in Properties->Details leads to a crash
Last modified: 2013-11-19 09:29:59 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.
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.
I get the same bug when running seahorse in jhbuild.
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.
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
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.
Created attachment 259151 [details] [review] ui: fix pgp/ssh key export This time with tabs instead of spaces :)
Created attachment 259192 [details] [review] ui: fix pgp/ssh key export And this time without memory leaks...
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.
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?
Thanks for the patch. Attachment 259192 [details] pushed as b8efbb1 - ui: fix pgp/ssh key export