Skip to contentSkip to conversation

Stuck with AVR32 segfaults in init

DISCUSSION Geoffrey Wossum 5 participants 8 messages Mar 11, 2008 – Mar 12, 2008

lore
Share & tools
lore
#0 lore raw

Hi all,

I can't seem to get past a problem with init segfaulting at boot time on my AVR32 board. Here's the error I get:

Freeing init memory: 64K (90000000 - 90010000) init[1]: segfault at 00000008 pc 2aaabc84 sp 7fec2f30 ecr 24 init has generated signal 11 but has no handler for it

Kernel panic - not syncing: Attempted to kill init!

I started out using the toolchain already in OE. This was:
binutils 2.17.atmel.0.0.99 20060623
gcc 4.1.2-atmel.1.1.0
uClibc 0.9.28-avr32-20061019 (or somesuch)

It was suggested I move up to uClibc 0.9.29, so I got that working quickly. No dice. Exact same error.

I tried passing init=/bin/sh, and that segfaulted with almost exactly the same error message, so it seems to be a more general problem than with sysvinit.

Now, Atmel's buildroot for the AVR32 version 2.1.0 can build a fully bootable image (with a little prodding). It uses:
binutils 2.17.atmel.0.0.99 20060623
gcc 4.2.1-atmel.1.0.3
uClibc 0.9.29-atmel.1 (or somesuch)

So I hacked around a little bit, and got OE setup with:
binutils 2.17.atmel.0.0.99 20060623
gcc 4.2.1-atmel.1.0.3
uClibc 0.9.29-atmel.1

That ought to work the same. No, same exact error. Comparing the source code of the tool chains, binutils and uClibc are the same, but gcc is only ALMOST the same. I don't think the differences I found impact this problem, but here they are:

--- gcc-4.2.1/gcc/config/avr32/avr32.c 2007-10-16 03:21:32.000000000 -0500
+++ /home/geoff/src/buildroot-avr32-v2.1.0/toolchain_build_avr32_nofpu/gcc-4.2.1/gcc/config/avr32/avr32.c

2008-02-25 09:09:42.000000000 -0600
@@ -705,8 +705,8 @@
       {
         if (avr32_const_ok_for_constraint_p (mi_delta, 'I', "Is21"))
           {
-            fprintf (file, "\tsub\t%s, -0x%x\n", reg_names[this_regno],
-                mi_delta);
+            fprintf (file, "\tsub\t%s, %d\n", reg_names[this_regno],
+                -mi_delta);
           }
         else
           {

--- gcc-4.2.1/gcc/config/avr32/linux-elf.h 2007-10-01 08:43:09.000000000 -0500
+++ /home/geoff/src/buildroot-avr32-v2.1.0/toolchain_build_avr32_nofpu/gcc-4.2.1/gcc/config/avr32/linux-elf.h

2008-02-25 09:09:42.000000000 -0600

@@ -68,7 +68,7 @@
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"

#undef ASM_SPEC
-#define ASM_SPEC "%{!mno-pic:%{!fno-pic:--pic}} %{mrelax|O*:%{mno-relax|O0|
O1: ;:--linkrelax}} %{mcpu=*:-mcpu=%*}"
+#define ASM_SPEC "%{!mno-pic:--pic} %{mrelax|O*:%{mno-relax|O0|
O1: ;:--linkrelax}} %{mcpu=*:-mcpu=%*}"

#undef LINK_SPEC
#define LINK_SPEC "%{version:-v} \

Since both sysvinit and busybox both segfault with about the same error, I'm thinking it might be related to runtime linking. I tried configuring uClibc to with SUPPORT_LD_DEBUG and SUPPORT_LD_DEBUG_EARLY, and then passing LD_DEBUG=all on the kernel command line to get it to the init environment. Nothing was printed out, so either I didn't do the LD debug properly, or something is really wrong.

I've never had an issue building a kernel that boots, but I haven't been able to get past whatever the init process is segfaulting.

Does anyone have an ideas?

Thanks,
---
Geoffrey

#1 lore raw

Hi,

Quoted 11 lines · Geoffrey Wossum

Since both sysvinit and busybox both segfault with about the same error, I'm thinking it might be related to runtime linking. I tried configuring uClibc to with SUPPORT_LD_DEBUG and SUPPORT_LD_DEBUG_EARLY, and then passing LD_DEBUG=all on the kernel command line to get it to the init environment. Nothing was printed out, so either I didn't do the LD debug properly, or something is really wrong.

I've never had an issue building a kernel that boots, but I haven't been able to get past whatever the init process is segfaulting.

Does anyone have an ideas?

If you take an OE binary and run it within a working filesystem from whereever, what happens? If it segfaults there you may be able to debug it. If it doesn't, try copying libs from OE into that system until it breaks? That should at least tell you where the problem is.

Cheers,

Richard

#2 lore raw
Quoted 6 lines

If you take an OE binary and run it within a working filesystem from whereever, what happens? If it segfaults there you may be able to debug it. If it doesn't, try copying libs from OE into that system until it breaks? That should at least tell you where the problem is.

Dear all
I was starting a oe build the day koen announced the merge and it went with some obstacles and finished the major libs nicely but i cant tell what i had to do to get past the uclibc parts.

I did then get a 0.9.28 based libs and apps which i now merge with a atmel bsp kernel and uClibc.
So i can now run all oe libs ( beside uClibc) with that and it feels wonderful. I am currently running the ngw100 with a 5.7 lcd attached and can get up a Xfbdev + gtk+ + x11vnc within the nand and nor ( totale of 16 mb) Hurray the power if footprinting of oe !!

But i am also stuck now redoing this and rebuilding a new oe toolchain for avr32 . I cant get pass the external-toolchain ERROR mentioned in some earlier mails.
I tried both oe uclibc 0.9.28 and 0.9.29
So i now have one tool chain up and running and i can go on to develop my target application but nobody is allowed to touch my laptop with that toolchain or he dies !!

Maybe we need some of the guru`s here to help us poor avr32 small users to get the basic oe toolchain up and running and stable at least for the ucLibc part.

Robert

Quoted 1 line
#3 lore raw

Geoffrey

Did you rebuild OE with the above gcc patches applied. You should give it a shot.

Quoted 42 lines · Robert Wörle
Quoted 6 lines

If you take an OE binary and run it within a working filesystem from whereever, what happens? If it segfaults there you may be able to debug it. If it doesn't, try copying libs from OE into that system until it breaks? That should at least tell you where the problem is.

Dear all
I was starting a oe build the day koen announced the merge and it went with some obstacles and finished the major libs nicely but i cant tell what i had to do to get past the uclibc parts.

I did then get a 0.9.28 based libs and apps which i now merge with a atmel bsp kernel and uClibc.
So i can now run all oe libs ( beside uClibc) with that and it feels wonderful. I am currently running the ngw100 with a 5.7 lcd attached and can get up a Xfbdev + gtk+ + x11vnc within the nand and nor ( totale of 16 mb) Hurray the power if footprinting of oe !!

But i am also stuck now redoing this and rebuilding a new oe toolchain for avr32 . I cant get pass the external-toolchain ERROR mentioned in some earlier mails.
I tried both oe uclibc 0.9.28 and 0.9.29
So i now have one tool chain up and running and i can go on to develop my target application but nobody is allowed to touch my laptop with that toolchain or he dies !!

Maybe we need some of the guru`s here to help us poor avr32 small users to get the basic oe toolchain up and running and stable at least for the ucLibc part.

Robert

Quoted 1 line

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#4 lore raw
Quoted 6 lines · Khem Raj

Geoffrey

Did you rebuild OE with the above gcc patches applied. You should give it a shot.

Can you point me to those patches it seems i cant find them.. sorry or are they in .dev ?

Robert

#5 lore raw
In reply to Robert Wörle
Quoted 3 lines · Robert Wörle

But i am also stuck now redoing this and rebuilding a new oe toolchain for avr32 . I cant get pass the external-toolchain ERROR mentioned in some earlier mails.

Can you remind us which error this is and what MACHINE/DISTRO and other setup you're using please?

Thanks,

Richard

#6 lore raw
In reply to Robert Wörle

FYI I won't be able to even look at avr32/OE for at least a month a half and Koen's stk1000 is in my office waiting to be unbricked :(
With the amount (and type) of changes going into .dev these days it would have been a miracle if something was working without problems. Probably this could also be connected to the SCM issue but I think it would be wise in the future, to create separate branches when these kind of "infrastacture" changes are to be pushed to OE, so they could be tested before been merged with .dev.

Stelios S. Koroneos

Digital OPSiS - Embedded Intelligence
http://www.digital-opsis.com

Quoted 51 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Robert Worle
Sent: Wednesday, March 12, 2008 8:14 AM
To: [email protected]
Cc: [email protected]
Subject: Re: [oe] Stuck with AVR32 segfaults in init

Quoted 2 lines

If you take an OE binary and run it within a working

filesystem from

Quoted 3 lines

whereever, what happens? If it segfaults there you may be able to debug it. If it doesn't, try copying libs from OE into that system until it breaks? That should at least tell you where the problem is.

Dear all
I was starting a oe build the day koen announced the merge and it went with some obstacles and finished the major libs nicely but i cant tell what i had to do to get past the uclibc parts.

I did then get a 0.9.28 based libs and apps which i now merge with a atmel bsp kernel and uClibc.
So i can now run all oe libs ( beside uClibc) with that and it feels wonderful. I am currently running the ngw100 with a 5.7 lcd attached and can get up a Xfbdev + gtk+ + x11vnc within the nand and nor ( totale of
16 mb) Hurray the power if footprinting of oe !!

But i am also stuck now redoing this and rebuilding a new oe toolchain for avr32 . I cant get pass the external-toolchain ERROR mentioned in some earlier mails.
I tried both oe uclibc 0.9.28 and 0.9.29 So i now have one tool chain up and running and i can go on to develop my target application but nobody is allowed to touch my laptop with that toolchain or he dies !!

Maybe we need some of the guru`s here to help us poor avr32 small users to get the basic oe toolchain up and running and stable at least for the ucLibc part.

Robert

Quoted 1 line

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#7 lore raw
In reply to Richard Purdie
Quoted 6 lines · Richard Purdie

Hi,

If you take an OE binary and run it within a working filesystem from whereever, what happens? If it segfaults there you may be able to debug it. If it doesn't, try copying libs from OE into that system until it breaks? That should at least tell you where the problem is.

Here's the results:
- Run OE busybox on working BR system
Works

- Run OE busybox with OE libc.so on working BR system Works

- Run OE busybox with OE libc.so / libm.so on working BR system Works

- Replace BR libc.so with OE libc.so
Works

- Replace BR libc.so / libm.so with OE libc.so / libm.so Works

- Replace BR ld-uClibc.so with OE ld-uClibc.so
init[1]: segfault at 00000008 pc 2aaabc84 sp 7ff80f30 ecr 24

- Replace OE ld-uClibc.so with BR ld-uClibc.so
Works

So the ld-uClibc.so build by OE is definitely the culprit, and replacing it with the ld-uClibc.so from Atmel's buildroot makes everything better.

I'm going to investigate what possible differences could exist between the OE ld-uClibc.so and the BR ld-uClibc.so now.

---
Geoffrey