mountall spins eating cpu when 'nobootwait' option exists in fstab followed by a comma
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mountall (Ubuntu) |
Fix Released
|
Critical
|
Colin Watson | ||
Lucid |
Fix Released
|
High
|
Dustin Kirkland | ||
Maverick |
Fix Released
|
Critical
|
Colin Watson |
Bug Description
Binary package hint: mountall
As reported at [1], mountall is eating cpu cycles on reboot of both 10.04 (images 20100923 and later) and 10.10.
I believe the issue is related to changes made under bug 634102.
Here is what happens:
- The images are created with an fstab like:
| proc /proc proc nodev,noexec,nosuid 0 0
| LABEL=uec-rootfs / ext4 defaults 0 0
- On first boot, cloud-init writes additional entries like:
| /dev/sda2 /mnt auto defaults,
| /dev/sda3 none swap sw,comment=
- On reboot, mountall will be eating CPU. and /mnt will *not* be mounted.
- removing the 'nobootwait' flag, and rebooting will result in system functioning properly
I've modified /etc/init/mountall and added '--debug' and '--verbose', and rebooted and collected the console log.
I believe the issue only presents itself when the device exists at boot and the 'nobootwait' flag is present.
I can boot 2 different instance types,
m1.small : has /dev/sda2 and /dev/sda3
t1.micro : does not have /dev/sda2 or /dev/sda3
mountall will spin in m1.small, but not in t1.micro.
I'm attaching the output of debug boot on m1.small (where /dev/sda2 does exist and mountall spins).
--
[1] http://
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: mountall 2.17
ProcVersionSign
Uname: Linux 2.6.35-22-virtual i686
Architecture: i386
Date: Tue Sep 28 06:45:14 2010
Ec2AMI: ami-307d8859
Ec2AMIManifest: ubuntu-
Ec2Availability
Ec2InstanceType: m1.small
Ec2Kernel: aki-407d9529
Ec2Ramdisk: unavailable
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: mountall
==== SRU Information ====
- Impact: On EC2 or UEC, due to how cloud-init writes fstab entries, on first reboot mountall will eat all CPU cycles. On other systems, a user who updates /e
c/fstab seemingly correct will have mountall spin the first time it runs.
- How it was addressed: Logic error in cut_options routine in mountall was fixe
. The code segment was easily removed and tested against different strings to verify no regressions.
- Patch: A branch has been linked with the same patch as used in maverick.
lp:~smoser/ubuntu/lucid/mountall/bug649591
- How to reproduce:
Edit an existing entry in /etc/fstab for which there is an existing device. Change the options field to contain 'nobootwait,' in front of what was previously there. Reboot. You will now see mountall consuming resources.
- Regression: The most likely regression would be either failure of mountall to mount a device or segfault in mountall. That said, the patch was tested well, and Colin had a strong understanding of the cause.
==== End SRU Information ====
Related branches
- Ubuntu Development Team: Pending requested
-
Diff: 104 lines (+58/-3)3 files modifieddebian/changelog (+18/-0)
debian/preinst (+37/-0)
src/mountall.c (+3/-3)
Changed in mountall (Ubuntu Maverick): | |
assignee: | nobody → Colin Watson (cjwatson) |
summary: |
mountall spins eating cpu when 'nobootwait' option exists in fstab + followed by a comma |
Changed in mountall (Ubuntu Maverick): | |
status: | Confirmed → Fix Committed |
Changed in mountall (Ubuntu Lucid): | |
importance: | Undecided → High |
status: | New → Triaged |
assignee: | nobody → Colin Watson (cjwatson) |
milestone: | none → ubuntu-10.04.2 |
description: | updated |
description: | updated |
Changed in mountall (Ubuntu Lucid): | |
assignee: | Colin Watson (cjwatson) → Dustin Kirkland (kirkland) |
status: | Triaged → In Progress |
status: | In Progress → Fix Committed |
I installed debugging libraries and found 2 more pieces of info: cloudconfig' works around the problem
a.) removing 'comment=
b.) mountall is spinning in cut_options at mountall.c:622
When I attach with gdb backtrace shows:
#0 0xb7884c42 in cut_options (parent=0x0, mnt=0xb8ffbff8) at mountall.c:622 NIH_CHILD_ EXITED, status=0) at mountall.c:1789
#1 0xb7884fbe in run_mount (mnt=0xb8ffbff8, fake=0) at mountall.c:1843
#2 0xb78867b9 in try_mount (mnt=0xb8ffbff8, force=0) at mountall.c:1659
#3 0xb7881fe8 in spawn_child_handler (proc=0xb9000478, pid=437,
event=
#4 0xb784b6bb in nih_child_poll () at child.c:217
#5 0xb784eed2 in nih_main_loop () at main.c:600
#6 0xb7888994 in main (argc=3, argv=0xbfaa7db4) at mountall.c:3409