Summary: | Crash if MIME data changes during a call to xdg_mime_get_mime_type_for_file() | ||
---|---|---|---|
Product: | xdgmime | Reporter: | Tom Hughes <tom> |
Component: | xdgmime | Assignee: | Jonathan Blandford <jrb> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | critical | ||
Priority: | high | ||
Version: | unspecified | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
possible patch
Fix a cut-and-paste error from the previous patch. The last patch didn't quite fix things, this one does. |
Description
Tom Hughes
2006-05-03 17:47:32 UTC
Bumping this up to critical. I'm going to attach a patch which I think will work around the problem. It's not particularly elegant, but it might be the way to go. It simply creates private versions of the two public methods called from _xdg_mime_magic_lookup_data() so that xdg_mime_init() isn't called. Created attachment 5670 [details] [review] possible patch Created attachment 5671 [details] [review] Fix a cut-and-paste error from the previous patch. Oops, forgot to actuall remove the call to xdg_mime_init() in _xdg_mime_mime_type_equal(). Created attachment 5721 [details] [review] The last patch didn't quite fix things, this one does. This patch fixes the problem for me on various systems I've tested with Beagle. While I think this patch is probably the right thing either way, there may be another bug here that this fix would cover up, which is that the MIME data appears to be reloaded even if it hasn't been updated. The reloading when the MIME data hasn't been updated is the second problem I covered in my original beagle ticket (http://bugzilla.gnome.org/show_bug.cgi?id=339815) - it is caused by beagle not defining HAVE_MMAP which I think has now been fixed. It is arguably a bug that if xdgmime behaves like that if HAVE_MMAP is not defined though. Tom, yes, I fixed the HAVE_MMAP issue upstream. I had applied a patch to our local package which should have fixed it, but it appears to not have been taken. That's why we continued to see the issue in our SUSE packages. Oops. :) The patch makes sense to me; we shouldn't call init when using xdg functions internally, in order to not mess up the data structures we are using. I'm applying the patch to the GTK+ copy of xdgmime. I'd also apply it to cvs xdgmime, but my checkout is broken. Thanks, I just committed the patch with a slight modification: I also changed the recursive xdg_mime_mime_type_subclass() call in _xdg_mime_mime_type_subclass() to the private version. |
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.