[MASTER] Exec format error : package failed to install/remove : installation/removal script returned error exit status 2
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dpkg (Debian) |
Fix Released
|
Unknown
|
|||
dpkg (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Karmic |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Under some conditions package installation/
-- Error during installation --
Setting up screenlets (0.1.2-7) ...
dpkg (subprocess): unable to execute installed post-installation script: Exec format error
dpkg: error processing screenlets (--configure):
subprocess installed post-installation script returned error exit status 2
-- Error during removal --
Removing gnome-do ...
dpkg (subprocess): unable to execute installed pre-removal script: Exec format error
dpkg: error processing gnome-do (--purge):
subprocess installed pre-removal script returned error exit status 2
This error occurs when one of the installation or removal scripts (/var/lib/
== HOW TO REPRODUCE ==
Install a package and emulates a system crash before 30 seconds:
# apt-get install hello; sleep 20; echo b > /proc/sysrq-trigger
[simulates a system crash]
After reboot both installation and removal scripts are 0 bytes. You will notice that hello.list was correctly written to disk because of the fsync call in dpkg/src/filesdb.c
$ ls -l /var/lib/
-rw-r--r-- 1 root root 323 2010-02-09 00:42 /var/lib/
-rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/
-rwxr-xr-x 1 root root 0 2009-08-15 19:17 /var/lib/
If you replay the test but adding a sync before the system crash:
# apt-get install hello; sync; echo b > /proc/sysrq-trigger
After reboot the files are fine:
$ ls -l /var/lib/
-rw-r--r-- 1 root root 323 2010-02-09 00:46 /var/lib/
-rwxr-xr-x 1 root root 103 2009-08-15 19:17 /var/lib/
-rwxr-xr-x 1 root root 74 2009-08-15 19:17 /var/lib/
If I adjust /proc/sys/
== WORKAROUNDS ==
Execute the following commands in a terminal
(GNOME: Applications -> Accessories -> Terminal
KDE: KMenu -> Applications -> System -> Terminal [Konsole] )
Workaround A: Remove the package and reinstall
$ sudo rm /var/lib/
$ sudo apt-get remove --purge PACKAGE
$ sudo apt-get clean
$ sudo apt-get update
Then reinstall the package
Workaround B: Finish the install when the package can't be removed
$ sudo apt-get clean
$ sudo aptitude download PACKAGE
$ sudo dpkg --unpack ./PACKAGE_
$ sudo dpkg --configure PACKAGE
Replace PACKAGE with the package name which fails to install/remove.
== Localization ==
The same error in non-english language:
. fr: Erreur de format pour exec()
. Error de formato ejecutable
. Errore di formato di exec
. en: Exec format error
. hu: Érvénytelen végrehajtható fájlformátum
. Exec formátum hiba
. nl: Verkeerd uitvoerbaar bestand
. Exec 格式错误
. sv: Formatfel på körbar fil
. fi: Käynnistettävän tiedoston muoto virheellinen
. zh_CN: 可执行文件格式错误
. ja: 実行形式エラー
. ru: Ошибка формата выполняемого файла
. es: Formato de ejecutable incorrecto
. ca: L’executable té un format erroni
. it: Formato eseguibile non valido
. de: Fehler im Format der Programmdatei
. pt: Erro de formato de executável
. pt_BR: Erro no formato exec
. da: Ugyldigt format på eksekverbar fil
More localizations can be found at https:/
Related branches
- Michael Nelson (community): Approve (code)
-
Diff: 11 lines (+0/-1)1 file modifiedlib/lp/services/mail/sendmail.py (+0/-1)
CVE References
tags: | added: bugpattern-needed |
description: | updated |
description: | updated |
description: | updated |
tags: | added: metabug |
Changed in dpkg (Debian): | |
status: | Unknown → New |
description: | updated |
tags: | added: patch |
tags: |
added: patch-upstreaminput removed: patch |
Changed in dpkg (Debian): | |
status: | New → Fix Released |
Changed in dpkg (Ubuntu): | |
status: | Fix Released → Confirmed |
Changed in dpkg (Ubuntu): | |
status: | Fix Released → Fix Committed |
Changed in dpkg (Ubuntu): | |
status: | Fix Committed → Fix Released |
description: | updated |
description: | updated |
tags: | added: patch |
Changed in dpkg (Ubuntu Karmic): | |
status: | Confirmed → Won't Fix |
description: | updated |
description: | updated |
tags: | added: iso-testing |
Here is a patch proposal which add some fsync on files and directories to prevent delayed allocation and the zero-length file problem after a system crash.