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 608010 - Crashes in egg_set_desktop_file() if autostart desktop file is not present
Crashes in egg_set_desktop_file() if autostart desktop file is not present
Status: RESOLVED FIXED
Product: seahorse
Classification: Applications
Component: Daemon
git master
Other Linux
: Normal normal
: 2.26.0
Assigned To: Seahorse Maintainer
Seahorse Maintainer
Depends on:
Blocks: 608012
 
 
Reported: 2010-01-25 09:32 UTC by Martin Pitt
Modified: 2010-02-07 20:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
git formatted patch (1.18 KB, patch)
2010-01-25 09:51 UTC, Martin Pitt
rejected Details | Review

Description Martin Pitt 2010-01-25 09:32:38 UTC
If the autostart file is not present, seahorse-daemon crashes on startup:

** (seahorse-daemon:29213): WARNING **: Could not load desktop file '/usr/local/etc/xdg/autostart/seahorse-daemon.desktop': No such file or directory

Program received signal SIGSEGV, Segmentation fault.
0x000000000048591a in egg_set_desktop_file (
    desktop_file_path=0x485da0 "/usr/local/etc/xdg/autostart/seahorse-daemon.desktop")
    at eggdesktopfile.c:1444
1444	  if (egg_desktop_file->name)
(gdb) bt
  • #0 egg_set_desktop_file
    at eggdesktopfile.c line 1444
  • #1 main
    at seahorse-daemon.c line 263
  • #0 egg_set_desktop_file
    at eggdesktopfile.c line 1444
  • #1 main
    at seahorse-daemon.c line 263
1439			 desktop_file_path, error->message);
1440	      g_error_free (error);
1441	    }
1442	
1443	  /* Set localized application name and default window icon */
1444	  if (egg_desktop_file->name)
1445	    g_set_application_name (egg_desktop_file->name);
1446	  if (egg_desktop_file->icon)
1447	    {
1448	      if (g_path_is_absolute (egg_desktop_file->icon))
(gdb) p egg_desktop_file
$1 = (EggDesktopFile *) 0x0

The problem is that egg_desktop_file_new() returns NULL, but doesn't set error. I. e. g_key_file_load_from_file() does not set error properly.

Context: seahorse-daemon should not have an autostart .desktop file, since it costs quite a lot of startup time and is not even needed for the ssh and GPG agents; only for the nautilus plugin and the key manager application. I'll file a separate bug for this, though.
Comment 1 Martin Pitt 2010-01-25 09:45:39 UTC
> The problem is that egg_desktop_file_new() returns NULL, but doesn't set error.
> I. e. g_key_file_load_from_file() does not set error properly.

Sorry, I was misled at first sight. Of course it does set error, but it forgets to return before accessing the NULL egg_desktop_file.
Comment 2 Martin Pitt 2010-01-25 09:51:59 UTC
Created attachment 152208 [details] [review]
git formatted patch

Trivial git formatted patch for "git am" love.

Is it ok for me to commit? Thanks!
Comment 3 Christian Persch 2010-01-25 13:04:20 UTC
Comment on attachment 152208 [details] [review]
git formatted patch

This patch is buggy (the early return leaves the egg_desktop_file lock locked).

Plus, this is already fixed in the smclient master copy in libegg; just update from there.
Comment 4 Martin Pitt 2010-01-25 15:12:14 UTC
Comment on attachment 152208 [details] [review]
git formatted patch

ah, thanks for pointing out. This patch is obsolete then.
Comment 5 Adam Schreiber 2010-02-07 20:57:58 UTC
Thanks.  Updated from libegg.