update-mime-database crashes on incorrect mime definition

Bug #114241 reported by Prem Rara on 2007-05-12
20
This bug affects 1 person
Affects Status Importance Assigned to Milestone
shared-mime
Fix Released
Medium
shared-mime-info (Ubuntu)
Medium
Ubuntu Desktop Bugs

Bug Description

Binary package hint: update-manager

When upgrading from Edgy to Feisty. I get these errors:

Preparing to replace shared-mime-info 0.18-0ubuntu1 (using .../shared-mime-info_0.20-0ubuntu4_i386.deb) ...
Document `shared-mime-info' is not installed, cannot remove.
Document `shared-mime-info' is not installed, cannot remove.
Unpacking replacement shared-mime-info ...
* Wrong namespace on document element
* in '/usr/share/mime/packages/freemind.xml'
* (should be http://www.freedesktop.org/standards/shared-mime-info)
Aborted (core dumped)
dpkg: warning - old post-removal script returned error exit status 134
dpkg - trying script from the new package instead ...
dpkg: error processing /var/cache/apt/archives/shared-mime-info_0.20-0ubuntu4_i386.deb (--unpack):
 subprocess new post-removal script returned error exit status 134
***
* Updating MIME database in /usr/share/mime...
Wrote 489 strings at 20 - 28d4
Wrote aliases at 28d4 - 2a88

Wrote 489 strings at 20 - 28d4
Wrote aliases at 28d4 - 2a88
Wrote parents at 2a88 - 347c
Wrote literal globs at 347c - 34e8
Wrote suffix globs at 34e8 - 6980
Wrote full globs at 6980 - 69a4Wrote magic at 69a4 - c280
Wrote namespace list at c280 - c290
Errors were encountered while processing:
 /var/cache/apt/archives/shared-mime-info_0.20-0ubuntu4_i386.deb
dpkg: error processing shared-mime-info (--configure):
 package shared-mime-info is already installed and configured
 shared-mime-info
ERROR:root:SystemError from cache.commit(): E:Sub-process /usr/bin/dpkg returned an error code (1), E:Sub-process /usr/bin/dpkg returned an error code (1)
update-manager: Fatal IO error 9 (Bad file descriptor) on X server :0.0.

ProblemType: Package
Date: Sat May 12 21:32:32 2007
ErrorMessage:
 ErrorMessage: subprocess new post-removal script returned error exit status 134
Package: shared-mime-info
SourcePackage: shared-mime-info

Prem Rara (fortran01) wrote :

It's actually not a problem with update-manager. The problem is with shared-mime-info configuration. I have to rewrite /usr/share/mime/packages/freemind.xml

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
        <mime-type type="application/x-freemind">
                <comment xml:lang="en">FreeMind Mindmap</comment>
                <glob pattern="*.mm"/>
        </mime-type>
</mime-info>

Sebastien Bacher (seb128) wrote :

Thanks for your bug report. Please try to obtain a backtrace http://wiki.ubuntu.com/DebuggingProgramCrash and attach the file to the bug report. This will greatly help us in tracking down your problem.

Changed in shared-mime-info:
assignee: nobody → desktop-bugs
importance: Undecided → Medium
status: Unconfirmed → Needs Info
Sebastien Bacher (seb128) wrote :

what is the interest to tag a shared-mime-info bug with the name of the package?

Prem Rara (fortran01) wrote :

How do I actually run the shared-mime-info binary to get the backtrace?

Btw, freemind is a custom install. The installation did not go through because the syntax of the xml file is wrong (I think). This is the original file:

<mime-info>

 <mime-type type="application/x-freemind">

  <comment xml:lang="en">FreeMind Mindmap</comment>

  <glob pattern="*.mm"/>

 </mime-type>

</mime-info>

I changed it to:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
        <mime-type type="application/x-freemind">
                <comment xml:lang="en">FreeMind Mindmap</comment>
                <glob pattern="*.mm"/>
        </mime-type>
</mime-info>

Prem Rara (fortran01) wrote :

What I actually mean is: the install/upgrade of shared-mime-info package did not go through because the syntax of the xml file is wrong (I think).

The bug has been opened on https://bugs.launchpad.net/ubuntu/+source/shared-mime-info/+bug/114241

"Binary package hint: update-manager

When upgrading from Edgy to Feisty. I get these errors:

Preparing to replace shared-mime-info 0.18-0ubuntu1 (using .../shared-mime-info_0.20-0ubuntu4_i386.deb) ...
Document `shared-mime-info' is not installed, cannot remove.
Document `shared-mime-info' is not installed, cannot remove.
Unpacking replacement shared-mime-info ...
* Wrong namespace on document element
* in '/usr/share/mime/packages/freemind.xml'
* (should be http://www.freedesktop.org/standards/shared-mime-info)
Aborted (core dumped)
...
Btw, freemind is a custom install. The installation did not go through because the syntax of the xml file is wrong (I think). This is the original file:

<mime-info>

 <mime-type type="application/x-freemind">

  <comment xml:lang="en">FreeMind Mindmap</comment>

  <glob pattern="*.mm"/>

 </mime-type>

</mime-info>

I changed it to:

<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
        <mime-type type="application/x-freemind">
                <comment xml:lang="en">FreeMind Mindmap</comment>
                <glob pattern="*.mm"/>
        </mime-type>
</mime-info>
...
What I actually mean is: the install/upgrade of shared-mime-info package did not go through because the syntax of the xml file is wrong (I think)."

Debug backtrace of the crash:

Program received signal SIGABRT, Aborted.
0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7cbadf0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7cbc641 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7e0a62a in IA__g_logv (log_domain=<value optimized out>, log_level=G_LOG_LEVEL_ERROR,
    format=0x804eec0 "* Wrong namespace on document element\n* in '%s'\n* (should be %s)\n",
    args1=0xbfa6e7fc "�\032\006\bH�\004\b !ݷ&") at /build/buildd/glib2.0-2.12.12/glib/gmessages.c:497
#4 0xb7e0a669 in IA__g_log (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR,
    format=0x804eec0 "* Wrong namespace on document element\n* in '%s'\n* (should be %s)\n")
    at /build/buildd/glib2.0-2.12.12/glib/gmessages.c:517
#5 0x0804caf5 in load_source_file (filename=0x8061ac8 "/usr/share/mime/packages/freemind.xml")
    at update-mime-database.c:515
#6 0x0804dc67 in main (argc=Cannot access memory at address 0x2863
) at update-mime-database.c:635
#7 0xb7ca6ebc in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#8 0x080498f1 in _start ()

Sebastien Bacher (seb128) wrote :

The incorrect xml makes it crash, I've opened the bug upstream: https://bugs.freedesktop.org/show_bug.cgi?id=10959

Changed in shared-mime-info:
status: Needs Info → Confirmed
Changed in shared-mime:
status: Unknown → Confirmed

Thanks, I replaced the calls to g_error() with calls to g_warning().

Sebastien Bacher (seb128) wrote :

the bug has been fixed upstream now

Changed in shared-mime-info:
status: Confirmed → Fix Committed
Changed in shared-mime:
status: Confirmed → Fix Released
Sebastien Bacher (seb128) wrote :

the bug is fixed in gutsy

Changed in shared-mime-info:
status: Fix Committed → Fix Released
Changed in shared-mime:
importance: Unknown → Medium
Changed in shared-mime:
importance: Medium → Unknown
Changed in shared-mime:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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