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 720460 - Fix a crash in gnome-shell
Fix a crash in gnome-shell
Status: RESOLVED FIXED
Product: gnome-menus
Classification: Core
Component: libgnome-menu
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
: 712161 715062 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-12-14 14:45 UTC by Giovanni Campagna
Modified: 2018-12-24 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
entry-directories: don't modify a list while iterating it (2.55 KB, patch)
2013-12-14 14:46 UTC, Giovanni Campagna
accepted-commit_now Details | Review
entry-directories: protect event handling for directories (1.23 KB, patch)
2013-12-14 14:46 UTC, Giovanni Campagna
accepted-commit_now Details | Review

Description Giovanni Campagna 2013-12-14 14:45:58 UTC
The crash is reproducible as following:
- start gnome-shell
- open and close the full application view
- force a full GC from the looking glass
- add or remove a .desktop file in a monitored directory
Comment 1 Giovanni Campagna 2013-12-14 14:46:01 UTC
Created attachment 264193 [details] [review]
entry-directories: don't modify a list while iterating it

cached_dir_unref() tries to remove the directory from the parent's
list of subdirectories, but it is also called when the parent is
being freed and iterating with foreach() on its directory list.
This is unsafe, so don't do it.
Also, fix the logic for remove_subdir() to unref() only when it's
right to do so (ie, always, when the function is called, because
everything keeps strong references).
Comment 2 Giovanni Campagna 2013-12-14 14:46:05 UTC
Created attachment 264194 [details] [review]
entry-directories: protect event handling for directories

If a new desktop file is created or deleted in a monitored directory,
the desktop cache is cleared completely, and the CachedDir structure
is freed, which causes a segfault. Protect it as long as the new
event is queued and later handled.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-12-14 16:22:28 UTC
Review of attachment 264193 [details] [review]:

Wow, that "unref if references is 0" looks hella broken, yeah.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-12-14 16:22:40 UTC
Review of attachment 264194 [details] [review]:

OK.
Comment 5 Giovanni Campagna 2013-12-14 16:28:19 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

(git-bz failed because bugzilla crashed...)
Comment 6 Jasper St. Pierre (not reading bugmail) 2014-01-08 19:18:37 UTC
*** Bug 712161 has been marked as a duplicate of this bug. ***
Comment 7 Jeremy Bicha 2018-12-24 17:42:38 UTC
*** Bug 715062 has been marked as a duplicate of this bug. ***