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 667279 - [PATCH] Sometimes crashes when launching commandline-created GDesktopAppInfo
[PATCH] Sometimes crashes when launching commandline-created GDesktopAppInfo
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.31.x
Other Linux
: Normal critical
: ---
Assigned To: gtkdev
gtkdev
: 666284 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-01-04 18:09 UTC by Michael Terry
Modified: 2012-01-05 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (912 bytes, patch)
2012-01-04 18:10 UTC, Michael Terry
accepted-commit_now Details | Review

Description Michael Terry 2012-01-04 18:09:05 UTC
If you create a GDesktopAppInfo with g_app_info_create_from_commandline and then launch it, there is a chance glib will crash.

This is because is in _g_desktop_app_info_launch_uris_internal():
 1) "ChildSetupData data" never gets initialized to initially be all zeros
 2) data.pid_envvar is only set if info->filename is not NULL
 3) data.pid_envvar is written to during child_setup() if it is not NULL

An easy fix is to make sure data.pid_envvar is set to NULL if info->filename is also NULL.

Downstream Ubuntu bug here: https://bugs.launchpad.net/ubuntu/+source/deja-dup/+bug/901388
Comment 1 Michael Terry 2012-01-04 18:10:07 UTC
Created attachment 204595 [details] [review]
Proposed patch
Comment 2 Dan Winship 2012-01-04 18:41:00 UTC
Comment on attachment 204595 [details] [review]
Proposed patch

yeah, looks right
Comment 3 Michael Terry 2012-01-04 19:43:35 UTC
commit 31c3082e19551377049742a7862dab455727844a
Author: Michael Terry <michael.terry@canonical.com>
Date:   Wed Jan 4 13:08:56 2012 -0500

    gdesktopappinfo: Avoid crash by NULL-ing data.pid_envvar before launch
    
    https://bugzilla.gnome.org/show_bug.cgi?id=667279
Comment 4 Ken VanDine 2012-01-05 17:07:17 UTC
*** Bug 666284 has been marked as a duplicate of this bug. ***