run-init on omap3, omap4 in natty dies if busybox is built with -marm

Bug #683683 reported by Oliver Grawert
32
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linaro GCC
Won't Fix
Undecided
Michael Collison
busybox (Ubuntu)
Fix Released
High
Unassigned
Natty
Fix Released
High
Unassigned
gcc-4.5 (Ubuntu)
Confirmed
Undecided
Unassigned
Natty
Won't Fix
Undecided
Unassigned
klibc (Ubuntu)
Invalid
High
Unassigned
Natty
Invalid
High
Unassigned

Bug Description

trying to boot a natty image on the omap4 platform works fine for teh first part where jasper-initramfs resizes, configures and reboots teh system. as soon as the reboot happened and the rootfs is trying to be mounted the boot dies with:

/init: exec: line 331: run-init: Unknown error 17718852

Related branches

Oliver Grawert (ogra)
affects: ubuntu → klibc (Ubuntu)
Changed in klibc (Ubuntu):
importance: Undecided → High
Revision history for this message
Oliver Grawert (ogra) wrote :

seems linaro has a similar issue in bug 683582

tags: added: armel
Revision history for this message
Thorsten Glaser (mirabilos) wrote :

This looks similar to Debian #334917

Revision history for this message
Paul Larson (pwlars) wrote :

Also, see Linaro bug #683217.

Bug #683582 in Linaro actually had two bugs in it. Since that issue, and the one mentioned here, seem to be a duplicate of Bug the one I mentioned above, I changed it to focus on just the linaro-media-create bug.

Revision history for this message
Paul Larson (pwlars) wrote :

I'll dup mine to here since there seems to be more activity here already.

summary: - run-init on omap4 in natty dies with "run-init: Unknown error 17718852"
+ run-init on omap3, omap4 in natty dies with "run-init: Unknown error
+ 17718852"
Changed in klibc (Ubuntu):
status: New → Confirmed
Revision history for this message
Oliver Grawert (ogra) wrote : Re: run-init on omap3, omap4 in natty dies with "run-init: Unknown error 17718852"

researching the archive, it seems that klibc did not change since maverick (not even a rebuild with the new toolchain). initramfs-tools only had a minor change as well.

i was suspecting something with the handed over args to be wrong. passing init=/bin/bash shows the same behavior, running run-init from an initramfs shell manually with teh right args also shows the same results.

Revision history for this message
Thorsten Glaser (mirabilos) wrote :

Looking at the error and the m68k bug noted, and remembering some planet
postings about armhf (Debian) and *buntu’s ARM related things, I can only wonder
if the same is true about klibc not knowing the correct (syscall? procedure call?) ABI.

Revision history for this message
Tom Gall (tom-gall) wrote :

Using linaro's natty daily snapshot for headless dated 1201 and the hwpack for omap3 dated 1201 and using a linaro-media create that was branched on 11-23 (but with no local changes) my beagle board C4 boots. tty doesn't work but serial cons is fine:

here's the boot log.

http://pastebin.ubuntu.com/538741/

Revision history for this message
Tom Gall (tom-gall) wrote :

I've now been able to replicate this on my beagle xm (but not my C4) same headless 1201 natty build, same linaro-media create, same hwpack.

Boot log:
http://pastebin.ubuntu.com/538759/

Revision history for this message
Michael Casadevall (mcasadevall) wrote :

Debugging info on what run-init is being called with:
13:58:17 < NCommander> ogra_ac: rootmnt is "/root"
13:58:22 < NCommander> init is "/sbin/init"
13:58:26 < NCommander> arguments: "fixrtc"

Arguments to run-init are sane and correct.

tags: added: iso-testing
Revision history for this message
Jamie Bennett (jamiebennett) wrote :

Seems we have a successful boot on the C4 and a failed boot with the *same* sd card with the XM.

Revision history for this message
Tom Gall (tom-gall) wrote :

That was me ... I have an microSD / SD adapter, using the netbook-efl image, booted on the C4 ... moved the microSD card over to the Beagle Xm failed as noted above in this bug

Revision history for this message
Tom Gall (tom-gall) wrote :

so using some echo magic sprinkles in the initrd this seems to be coming from the init script itself ... and the line 331 in the error message in line 331 in init which is the following command :

exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/co
nsole 2>&1

From my debug output on the xm it seems to be trying to run the following:

+ exec run-init /root /sbin/init rootwait ro earlyprintk fixrtc nocompcache

full output here:

http://pastebin.ubuntu.com/538841/

Revision history for this message
Tom Gall (tom-gall) wrote :

Now running with the same SD card on my beagle C4 which boots to a login ... I get no debug output at all ... it's like we're never running init out of the uInitrd ...

anyway out of time today.

Revision history for this message
John Rigby (jcrigby) wrote :

If I replace the /bin/sh in the broken natty initrd with one from a maverick final the problem goes away. The difference is the busybox-initramfs package, natty is 1:1.17.1-7ubuntu2 maverick is 1:1.15.3-1ubuntu5. No other changes were made.

Revision history for this message
John Rigby (jcrigby) wrote :

There is a .37 kernel package for omap in the linaro maintainers kernel ppa if anyone is inclined to try it. There is also a meta package there. Beware that the omap4 support is still a work in progress. The main missing feature is framebuffer.

ppa:linaro-maintainers/kernel

Revision history for this message
Oliver Grawert (ogra) wrote :

1.17.1-6ubuntu1 is the first package exposing the problem

Oliver Grawert (ogra)
Changed in klibc (Ubuntu):
status: Confirmed → Invalid
Changed in busybox (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Changed in busybox (Ubuntu Natty):
milestone: none → natty-alpha-2
Revision history for this message
Oliver Grawert (ogra) wrote :

rebuilding nattys busybox under mavericks toolchain (and dropping -marm) makes it work fine

Revision history for this message
Oliver Grawert (ogra) wrote :

doing the same as above with the natty toolchain works fine as well, so it seems the -marm gets in our way.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package busybox - 1:1.17.1-7ubuntu3

---------------
busybox (1:1.17.1-7ubuntu3) natty; urgency=low

  * drop -marm from armel build options to make run-init work again
  (LP: #683683)
 -- Oliver Grawert <email address hidden> Thu, 02 Dec 2010 15:09:33 +0100

Changed in busybox (Ubuntu Natty):
status: Confirmed → Fix Released
Revision history for this message
Dr. David Alan Gilbert (davidgil-uk) wrote :

Added gcc since you wouldn't have thought -marm would break something like that.

Revision history for this message
Matthias Klose (doko) wrote :

gcc-defaults is wrong, unless proven that this occurs with all gcc versions.

affects: gcc-defaults (Ubuntu Natty) → gcc-4.5 (Ubuntu Natty)
tags: added: toolchain
Oliver Grawert (ogra)
summary: - run-init on omap3, omap4 in natty dies with "run-init: Unknown error
- 17718852"
+ run-init on omap3, omap4 in natty dies if busybox is built with -marm
Revision history for this message
Dave Martin (dave-martin-arm) wrote :

klibc has some outstanding ARM/Thumb interworking issues ...
can someone please apply the patch from this bug:

https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/527720 (thumb2 porting issues identified: klibc uses mov.*pc)

... and see if it makes any difference?

Revision history for this message
Michael Hope (michaelh1) wrote :

I'm a bit of a initrd newbie so I wrote up the steps in testing under QEMU here:
 https://wiki.linaro.org/MichaelHope/Sandbox/DebuggingOnInitrd

Revision history for this message
Jamie Bennett (jamiebennett) wrote : Re: [Bug 683683] Re: run-init on omap3, omap4 in natty dies if busybox is built with -marm

On 6 Dec 2010, at 03:33, Michael Hope <email address hidden> wrote:

> I'm a bit of a initrd newbie so I wrote up the steps in testing under QEMU here:
> https://wiki.linaro.org/MichaelHope/Sandbox/DebuggingOnInitrd

Great resource Michael, thanks for putting it together.

Revision history for this message
Oliver Grawert (ogra) wrote :

@dave, could you open a new bug for klibc ? this bug is not klibc related. busybox-initramfs links against glibc and given that busybox' exec behavior changes if we use -marm or not this one is rather a toolchain one.

Revision history for this message
Oliver Grawert (ogra) wrote :

@michael,if you only want to debug a running initrd you dont need to repack it, just boot with the break= option (some of the valid values are: top, premount, bottom).
that way you can get a shell inside the initrd, do your debugging tasks and go on booting with ctrl-D
note though that in case of run-init this wont help a lot, since run-init can only be started by pid 1 (break spawns a subshell with new pid)

Revision history for this message
Dave Martin (dave-martin-arm) wrote :

@ogra, there is a bug open on klibc -- the one I referenced above: https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/527720

Does it need to be prodded?

Revision history for this message
Dave Martin (dave-martin-arm) wrote :

@michael - rdinit=/bin/sh is highly use for initramfs debugging too if you're not aware

Revision history for this message
Oliver Grawert (ogra) wrote :

@dave, ah, thanks, yeah, we should retarget it if that patch is complete now (note that this bug is just exposing a busybox issue, the run-init error is apparently just a side effect of exec misbehaving if busybox is built with -marm)

Revision history for this message
Dave Martin (dave-martin-arm) wrote :

I don't have the right filesystem in front of me to debug, but this recipe should work for debugging PID 1 with gdb (assuming you have a platform already set up with a populated root filesystem etc.):

Connect a keyboard and monitor before booting.

Boot with rdinit=/bin/sh console=<appropriate serial console device>

mkdir /proc /sys /mnt
mount -ntproc proc /proc
mount -ntsysfs sysfs /sys
mknod -m0666 /dev/null c 1 3
udevd --daemon &
# wait a moment
udevadm trigger
# wait a moment
ps
kill <pid of parent udevd process>
mount -oro -text4 /dev/mmcblk0p2 /mnt
LD_LIBRARY_PATH=/mnt/lib:/mnt/usr/lib:/lib; export LD_LIBRARY_PATH
for x in 9 10 11 12; do /mnt/usr/bin/setsid /mnt/bin/bash </dev/tty$x >/dev/tty$x 2>&1 & done

# now you have some usable ttys
# on one of them, type:
/mnt/usr/bin/gdb
attach 1
tcatch exec
continue

# one the console, type
exec /init

# /bin/sh should get exec'd as PID 1, and gdb will stop it
# you'll probably have to load the relevant debug symbols manually etc.

Changed in gcc-linaro:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gcc-4.5 (Ubuntu Natty):
status: New → Confirmed
Changed in gcc-4.5 (Ubuntu):
status: New → Confirmed
Changed in gcc-linaro:
assignee: nobody → Michael Collison (michael-collison)
status: Incomplete → Won't Fix
Revision history for this message
Rolf Leggewie (r0lf) wrote :

natty has seen the end of its life and is no longer receiving any updates. Marking the natty task for this ticket as "Won't Fix".

Changed in gcc-4.5 (Ubuntu Natty):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
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.