Seg-fault with busybox

Isaac Dunham ibid.ag at gmail.com
Wed Dec 2 04:06:11 UTC 2015


On Tue, Dec 01, 2015 at 12:46:30PM +0530, Anshul wrote:
> Hello,
> 
> I am trying to use busybox with linux kernel.
> 
> I have compiled busybox with static build option and my default gcc compiler
> on linux kernel 3.16.7-29-desktop.
> 
> When I use intramfs with busybox in it on kernel 2.6.32, I get kernel panic
> saying seg-fault in busybox
> Freeing unused kernel memory: 172k freed
> init[1]: segfault at ffffffffffffffe0 ip 00000000004bbca3 sp
> 00007ffca80ce848 error 6 in busybox[400000+240000]
> Kernel panic - not syncing: Attempted to kill init!

No idea where this comes from beyond "init crashed", but that first
number (ffffffffffffffe0) is (unsigned)(-32).

> Though I tested same initramfs with kernel 3.18, and it worked.
> 
> Is there any option to select the kernel version in busybox setting or
> should I pick up older version busybox.

You may have an issue with your build environment, rather than busybox.

I presume that "default gcc compiler" means "whatever gcc/binutils/glibc
version my distro ships with".
Searching for Linux 3.16.7-29 seems to point to OpenSUSE 13.2, which uses
GCC 4.8 and glibc 2.19 by default.
There can be some issues with building a glibc binary to run on an old
kernel while using a version of glibc built on a new kernel, with new
kernel headers. Knowing nothing more than what you said, I'd suspect that
this is the issue.

If you're wondering what that means in practical terms:
I suspect you need a different toolchain, such as a chroot with an older
environment.


HTH,
Isaac Dunham


More information about the busybox mailing list