update-mime-info segfaults

Bug #59240 reported by Daniel Milstein
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
shared-mime-info (Ubuntu)
Fix Released
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: shared-mime-info

When I try and install shared-mime-info in apt-get, I get a segfault with the following error message:

Setting up shared-mime-info (0.17-0ubuntu11) ...
***
* Updating MIME database in /usr/share/mime...
Wrote 503 strings at 20 - 29c8
Wrote aliases at 29c8 - 2bbc
Wrote parents at 2bbc - 35b8
Wrote literal globs at 35b8 - 3614
Wrote suffix globs at 3614 - 6b4c
Wrote full globs at 6b4c - 6b70
/var/lib/dpkg/info/shared-mime-info.postinst: line 9: 15628 Segmentation fault /usr/bin/update-mime-database /usr/share/mime
dpkg: error processing shared-mime-info (--configure):
 subprocess post-installation script returned error exit status 139
Errors were encountered while processing:
 shared-mime-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

The gdb backtrace is as follows:
                  Program received signal SIGSEGV, Segmentation fault.
0x0804ad92 in write_match (key=0x8075d68,
    data=0xbfd220f4) at update-mime-database.c:2194
2194 offset = mdata->offset + 32 * g_list_index (mdata->matches, magic->matches->data);
(gdb) bt
#0 0x0804ad92 in write_match (key=0x8075d68,
    data=0xbfd220f4) at update-mime-database.c:2194
#1 0xb7d354ba in g_ptr_array_foreach ()
   from /usr/lib/libglib-2.0.so.0
#2 0x0804b6e7 in write_cache (cache=0x8070890)
    at update-mime-database.c:2332
#3 0x0804dee8 in main (argc=2, argv=0xbfd22314)
    at update-mime-database.c:2833
(gdb)

Is there anything that I can do to fix this?

Many thanks.

Revision history for this message
Daniel Milstein (djmilstein) wrote :

Looks like the problem was that a file in /usr/share/mime was malformatted. Nevermind. Sorry about that.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for your bug. Was that file shipped by an Ubuntu package or a file corrupted or coming from a different source?

Changed in shared-mime-info:
assignee: nobody → desktop-bugs
importance: Untriaged → Low
status: Unconfirmed → Needs Info
Revision history for this message
Daniel Holbach (dholbach) wrote :

Your bug lacks information we would need to investigate further. We
are now going to close the bug - please reopen if you have more
information at hand.

Changed in shared-mime-info:
status: Needs Info → Rejected
Revision history for this message
Yuki Izumi (kivikakk) wrote :

This problem ran into me while I was upgrading through gutsy revisions. update-mime-database kept crashing - for instance, in the post/pre install/rm scripts for sun-java5-jre, or even in shared-mime-info's scripts. Here's a backtrace of what happens when "update-mime-database /usr/share/mime" happens:

Program received signal SIGSEGV, Segmentation fault.
0x0804bc15 in write_match (key=0x8059ce8, data=0xffba48b4)
    at update-mime-database.c:2228
2228 offset = mdata->offset + 32 * g_list_index (mdata->matches, magic->matches->data);
(gdb) bt
#0 0x0804bc15 in write_match (key=0x8059ce8, data=0xffba48b4)
    at update-mime-database.c:2228
#1 0xf7dd3789 in g_ptr_array_foreach () from /usr/lib/libglib-2.0.so.0
#2 0x0804b82d in write_cache (cache=0x8059fc8) at update-mime-database.c:2366
#3 0x0804e472 in main (argc=Cannot access memory at address 0x4
) at update-mime-database.c:2869
#4 0xf7c8f040 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#5 0x08049c51 in _start ()
(gdb)

If I sit at the top frame and try to print any of the mentioned variables (offset, mdata, magic), they're all apparently not in the context. As a heads up, this is the i386 package running in a chroot, on a x64 host.

Changed in shared-mime-info:
status: Invalid → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

What version of Ubuntu do you use? Could you try to figure if the crash is triggered by a corrupted desktop?

Changed in shared-mime-info:
status: Confirmed → Incomplete
Revision history for this message
Yuki Izumi (kivikakk) wrote :

Maybe you can forget about it! I was using gutsy - I'm currently up-to-date [last updated an hour or two ago] and it no longer crashes. :)

Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for let us know about it! :-)

Changed in shared-mime-info:
status: Incomplete → Fix Released
Revision history for this message
Aleksey Generozov (alex-generozov) wrote :

I am running into a similar problem running Lucid 10.04, and I am running into a similar problem with shared-mime-info. Basically whenever I try running apt-get install I get:

Errors were encountered while processing shared-mime-info. (essentially same thing as first post)

 Here is the backtrace for update-mime-database of /usr/share/mime

#0 0x00007ffff7559850 in ?? () from /lib/libc.so.6
#1 0x00007ffff7aeca6a in _ _xmlParserInputBufferCreateFilename () from /usr/lib/libxml2/so.2
#2 0x00007ffff7ac1d9d in xmlNewInputFromFile () from /usr/lib/libxml2.so.2
#3 0x00007ffff7ac61c6 in xmlCreateURLParseCtxt () from /usr/lib/libxml2.so.2
#4 0x00007ffff7adcfae in xmlSAXParseFileWithData () from /usr/lib/libxml2.so.2
#5 0x00000000004065e6 in ?? ()
#6 0x000000000040785b in ?? ()
#7 0x00007ffff7449c4d in _ _libc_start_main () from /lib/libc.so.6
#8 0x0000000000402829 in ?? ()
#9 0x00007fffffffe7a8 in ?? ()
#10 0x000000000000001c in ?? ()
#11 0x0000000000000002 in ?? ()
#12 0x00007fffffffe9b4 in ?? ()
#13 0x00007fffffffe9d7 in ?? ()
#14 0x0000000000000000 in ?? ()

Revision history for this message
Leonardo Silva Amaral (leleobhz) wrote :
Download full text (8.5 KiB)

Ive got the same problem in a Lucid instalation - until now without solution:

root@ligp:~# strace -f update-mime-database.real /usr/share/mime/
execve("/usr/bin/update-mime-database.real", ["update-mime-database.real", "/usr/share/mime/"], [/* 27 vars */]) = 0
brk(0) = 0x1dc6000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb361772000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=60151, ...}) = 0
mmap(NULL, 60151, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb361763000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libxml2.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\354\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1372312, ...}) = 0
mmap(NULL, 3472728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb361205000
mprotect(0x7fb36134b000, 2093056, PROT_NONE) = 0
mmap(0x7fb36154a000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x145000) = 0x7fb36154a000
mmap(0x7fb361554000, 3416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb361554000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libglib-2.0.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P}\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=905480, ...}) = 0
mmap(NULL, 3002736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb360f27000
mprotect(0x7fb361002000, 2097152, PROT_NONE) = 0
mmap(0x7fb361202000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xdb000) = 0x7fb361202000
mmap(0x7fb361204000, 368, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb361204000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\355\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1572232, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb361762000
mmap(NULL, 3680296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb360ba4000
mprotect(0x7fb360d1e000, 2093056, PROT_NONE) = 0
mmap(0x7fb360f1d000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x179000) = 0x7fb360f1d000
mmap(0x7fb360f22000, 18472, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb360f22000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14696, ...}) = 0
mmap(NULL, 2109696, PR...

Read more...

Revision history for this message
LexLythius (lexlythius) wrote :

Same problem Leonardo Silva has, combined with failure with package gconf2. 55 packages cannot be configured because of that.

dmesg | tail
[ 719.871495] gconftool-2[1424]: segfault at 300001c4f ip 00007fa70e6aa280 sp 00007fffefbea0b8 error 4 in libc-2.11.1.so[7fa70e627000+17a000]
[ 720.054924] update-mime-dat[1428]: segfault at 300001c4f ip 00007f2e56981280 sp 00007fffd68d95c8 error 4 in libc-2.11.1.so[7f2e568fe000+17a000]

Attached is the strace output for

strace -o/tmp/strace.txt update-mime-database.real /usr/share/mime

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.