Similar to bug #6824, private code in the cache can trigger a reload of the MIME caches, causing memory corruption and a crash. I'm attaching a patch which fixes this. The reason why I am seeing this now, however, is because of another bug: if XDG_DATA_DIRS contains the same directory twice, the second pass through the directory is declared invalid and the caches reloaded every time. I'll open a separate bug about that.
Created attachment 11670 [details] [review] patch which fixes the crash
See also bug #12513
We are hitting this bug frequently, which causes rather major memory leaks: https://bugzilla.novell.com/show_bug.cgi?id=364186
Never saw that bug before, and Alex is on parental leave. Christian?
It looks like someone forgot to implement _xdg_mime_media_type_equal(), too. It is declared in xdgmime.h, but not implemented anywhere. Also, _xdg_mime_cache_mime_type_subclass() needs to use _xdg_mime_media_type_equal(), not the version without the underscore.
Patch is correct, and Federicos comment is true, too.
(In reply to comment #5) > It looks like someone forgot to implement _xdg_mime_media_type_equal(), too. > It is declared in xdgmime.h, but not implemented anywhere. _xdg_mime_media_type_equal seems to be in xdgmime.c line 680. Please file a new bug if it's actually a problem. > Also, _xdg_mime_cache_mime_type_subclass() needs to use > _xdg_mime_media_type_equal(), not the version without the underscore. Fixed as well. * src/xdgmimecache.c (cache_magic_lookup_data), (_xdg_mime_cache_mime_type_subclass): Fix possible crasher when XDG_DATA_DIRS contains the same directory twice, patch by Joe Shaw <joeshaw@novell.com> (#12512) Make _xdg_mime_cache_mime_type_subclass use the internal version of xdg_mime_media_type_equal(), spotted by Federico Mena-Quintero <federico@ximian.com>
Woot. Thanks, Matthias, for committing to gnome-vfs as well; and thanks, Bastien, for taking care of this module :)
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.