Comment 3 for bug 541595

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Here is a script to recreate this error by corrupting the package cache of apt.
_DON'T RUN IT ON A PRODUCTION SYSTEM_

The only way to reproduce it is when pkgcache.bin and dpkg status are out of sync. In the script I intentionally corrupt pkgcache.bin and the status database but I don't see how this can happen in the real world.

From the dpkg log, it seems that it has to do with triggers and when both a package and its dependencies set the same trigger, and the error seems to always follow a system crash. But I don't know if the trigger execution is not shown into the dpkg log because the write to the log was buffered and not dumped to the log file or because the trigger was really not executed. Furthermore, I don't know if the trigger is what causes the error or if the error is elsewhere and the trigger only 'triggers' the error.

It might be a missing msync in apt or a deferred write of the pkgcache.bin.