Summary: | segmentation fault in write_magic_cache | ||
---|---|---|---|
Product: | shared-mime-info | Reporter: | Chris KOALI <chris.kde> |
Component: | general | Assignee: | Shared Mime Info group <shared_mime_info> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | medium | CC: | marius.vollmer |
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
patch
test case |
Description
Chris KOALI
2010-06-13 16:55:09 UTC
I cannot reproduce the warnings you see locally. What's in your ~/.local/share/mime directory? Would there be any files that could cause problems? Created attachment 39242 [details]
test case
This file cashs update-mime-database
(In reply to comment #1) > I cannot reproduce the warnings you see locally. > > What's in your ~/.local/share/mime directory? Would there be any files that > could cause problems? Hello, To start, I am no more using this way to change a mime type association. So, few months ago, I wanted to change the mime type for "*.inc" files. First, here what I had: $ xdg-mime query filetype test.inc text/plain and: $ ./update-mime-database -V /home/syn/.local/share/mime Updating MIME database in /home/syn/.local/share/mime... Wrote 12 strings at 2c - 1bc Wrote aliases at 1bc - 1c0 Wrote parents at 1c0 - 1c4 Wrote literal globs at 1c4 - 1c8 Wrote suffix globs at 1c8 - 2b4 Wrote full globs at 2b4 - 2b8 Wrote magic at 2b8 - 2c4 Wrote namespace list at 2c4 - 2c8 Wrote icons list at 2c8 - 30c Wrote generic icons list at 30c - 310 Wrote types list at 310 - 340 Works fine. Then, by using this: http://library.gnome.org/admin/system-admin-guide/stable/mimetypes-modifying.html.en and http://library.gnome.org/admin/system-admin-guide/stable/mimetypes-source-xml.html.en I have created a file Overrides.xml like that (see my new attachment). And I've updated the database: $ ./update-mime-database -V /home/syn/.local/share/mime Updating MIME database in /home/syn/.local/share/mime... Wrote 17 strings at 2c - 204 Wrote aliases at 204 - 208 Wrote parents at 208 - 22c Wrote literal globs at 22c - 230 Wrote suffix globs at 230 - 388 Wrote full globs at 388 - 38c Erreur de segmentation It crashs without error (even if my file isn't invalid, the program shouldn't crash). By the way, despite the crash, if I do a query filetype, it works: $ xdg-mime query filetype test.inc application/x-php $ xdg-mime query filetype test.tpl text/html My two news entry in database (*.inc and *.tpl) are really in the database, but due to the crash, the database is incomplete ("magic", "namespace list", "icons list", "generic icons list" and "types list" are missing). Here my patch comes, I compile and run again: $ ./update-mime-database -V /home/syn/.local/share/mime Updating MIME database in /home/syn/.local/share/mime... Wrote 17 strings at 2c - 204 Wrote aliases at 204 - 208 Wrote parents at 208 - 22c Wrote literal globs at 22c - 230 Wrote suffix globs at 230 - 388 Wrote full globs at 388 - 38c Wrote magic at 38c - 3b8 Wrote namespace list at 3b8 - 3bc Wrote icons list at 3bc - 400 Wrote generic icons list at 400 - 414 Wrote types list at 414 - 44c And of course, "xdg-mime query filetype" still returns the expected information. By the way, I don't know how work "update-mime-database", nor "g_ptr_array_foreach". And I don't know why my patch works... but it works. Can you try to reproduce it by using the attachment file ? (this file should be saved in directory ~/.local/share/mime/packages/). Thanks. Easier to fix with a reproducer. commit eed6a8a94bd7842411ba343669d2e78c6ca8e782 Author: Bastien Nocera <hadess@hadess.net> Date: Thu Oct 14 01:42:48 2010 +0100 Fix crasher with incomplete magic element https://bugs.freedesktop.org/show_bug.cgi?id=28527 Now your .xml file will show: Error in type 'application/x-php' (in mime-db-tests/packages/bug28527.xml): Incomplete <magic> element. Error in type 'text/html' (in mime-db-tests/packages/bug28527.xml): Incomplete <magic> element. Thanks for the help. |
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.