Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#35037 - [mkinitcpio] errors in install_modules() will lead to zero exit status and no error messages

Attached to Project: Arch Linux
Opened by Susan (hbitca) - Tuesday, 30 April 2013, 14:10 GMT
Last edited by Dave Reisner (falconindy) - Thursday, 02 May 2013, 03:31 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When upgrading the kernel, pacman(8) calls mkinitcpio as mkinitcpio -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img

if the file system where mkinitcpio's BUILDROOT is (/tmp/ by default) does not contain enough space for mkinitcpio's files, what mkinitcpio attempts will fail and it will not generate a correct initramfs image. In that case, it should return a non-zero exit code and generate an error message. In the degenerate case of this situation (BUILDROOT has *no* space before mkinitcpio is run), this works correctly.

If mkinitcpio runs out of disk space while it is running, some commands it runs will have non-zero exit status, as in the previous case. This is supposed to cause mkinitcpio to return a non-zero exit status and print an error message.

However, if any command in the install_modules() function in mkinitcpio fails (due to lack of disk space or whatever other reason) and thus returns a non-zero exit status, mkinitcpio will *not* print out an error message and will (incorrectly) return zero. This can be verified trivially by inserting "false" inside that function and running mkinitcpio. However, errors in this function, as in the running-out-of-disk case, can cause a non-working initramfs image.

Additional info:
* this error is for the current version (0.13.0) of mkinitcpio

here are output files from mkinitcpio -v -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img under the specified conditions:

/tmp/ almost empty, everything works as it should: http://sprunge.us/TVZB

/tmp/ full, no space to write anything. mkinitcpio fails to work correctly (as expected, due to no disk space) and correctly indicates an error, and correctly returns a nonzero exit status: http://sprunge.us/eEDV

/tmp/ filled up such that mkinitcpio only runs out of disk space in install_modules(). mkinitcpio fails to work correctly (as expected, due to no disk space when it reaches install_modules()), but returns zero and does NOT indicate an error. Notice that the initramfs image that it generates is shorter than the one generated when there is adequate disk space (as expected), meaning that mkinitcpio indeed generated an incorrect image but does not report it. http://sprunge.us/QbXD

Steps to reproduce:

fill up the filesystem where /tmp is such that mkinitcpio only runs out of space in the install_modules() function, or more generally, any run of mkinitcpio that only has an error inside the install_modules() function will not report the error and mkinitcpio will return zero.

(I rated this bug's severity as "Critical" as a corrupt mkinitcpio image may prevent the computer from booting, and something like this should not happen without appropriate error reporting)
This task depends upon

Closed by  Dave Reisner (falconindy)
Thursday, 02 May 2013, 03:31 GMT
Reason for closing:  Fixed
Additional comments about closing:  testing/mkinitcpio-0.14.0
Comment by Dave Reisner (falconindy) - Wednesday, 01 May 2013, 17:18 GMT
Thanks, looks like errtrace wasn't being set for install_modules, even though this is the intention.

Loading...