I have an embedded device, built using buildroot, kernel version 3.6.11 running busybox. The kernel is built with completely default options. I have configured the device according to what the network guy has specified for the IP, gateway, netmask etc and I have put these values in the /etc/network/interfaces file. When the system boots up, a call to ifconfig tells me that all the network settings are what they are supposed to be. However, I cannot ping any other machine on the same subnet as the device. I can communicate with my host machine with a direct ethernet cable connection so I think the network adapter is ok - I can ssh to the host, and the host can view the target correctly from the vsftpd I have installed on the device. Basically I am very unsure how to proceed with diagnosing the problem. I am drowning on internet forum linux network setup guides and getting nowhere. Also, worryingly, when I type

# ip addr show dev eth0

I get the report of a segfault in libuClibc- I built this all using buildroot and it reported that everything was successful. Is it possible that I have a broken kernel?? I really do not know how to proceed so any advice would be gratefully received.

EDIT The output from ip addr show dev eth0 is

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen
    1000 link/ether 00:18:7d:19:a0:d8 brd ff:ff:ff:ff:ff:ff
    inet brd scope global eth0
[  331.700545] ip[951]: segfault at 0 ip b76e1f26 sp bfbd29b0 error 4 in 
Segmentation fault

When I call the same command on the other adapter eth1, then I get no segfault, so really don't know what is going on.

EDIT2 After rebuilding with debug information and strace I was able to get strace output of the segfault - I do not really know what this means though other than it looks like it is trying to write to a location it perhaps should not (I have not included it all, just the last few lines).

ioctl(4, SIOCGIFTXQLEN, {ifr_name="eth1", ifr_qlen=1000}) = 0
close(4)                                = 0
write(1, "3: eth1: <BROADCAST,MULTICAST,UP"..., 793: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
) = 79
write(1, "    link/ether 00:18:7d:19:a0:d7"..., 55    link/ether 00:18:7d:19:a0:d7 brd ff:ff:ff:ff:ff:ff
) = 55
open("/etc/iproute2/rt_scopes", O_RDONLY) = 4
ioctl(4, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0xbfc91b30) = -1 ENOTTY (Inappropriate ioctl for device)
read(4, "#\n# reserved values\n#\n0\tglobal\n2"..., 4096) = 92
read(4, "", 4096)                       = 0
close(4)                                = 0
write(1, "    inet brd 1"..., 65    inet brd scope global eth1
) = 65
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault
  • If it segfaults in the library, it might be a broken library, a badly built iproute package (perhaps built against a different libc?). Or it might be that some required configuration file isn't there or contains garbage. Can you get a core dump to see where exactly it crashes? Perhaps run an strace ip addr show dev eth0 > /tmp/OUT and look at which files it opens? Does ip addr show also crash? What does ip link list say? – vonbrand Feb 25 '13 at 16:58
  • I have not built strace as part of the embedded setup - I will do so ASAP. ip addr show also crashes, but ip link list displays output without crashing. I will update the question with the output as its too large to write here. – mathematician1975 Feb 25 '13 at 17:04
  • That means that the links (i.e., basic hardware) is handled correctly (unless it spouts nonsense, that is). The problem is one stage up... – vonbrand Feb 25 '13 at 17:06
  • @vonbrand So basically its an incorrectly configured network? – mathematician1975 Feb 25 '13 at 17:14
  • Could be, or something else is broken. Do you have any way of checking if a package is damaged? What distribution (packaging system) is this? – vonbrand Feb 25 '13 at 17:20

I managed to resolve the segmentation fault issue which I will document here in case anyone has similar problems in the future. I noticed that when I called the following

 ip -f inet addr show dev eth0

instead of

 ip inet addr show dev eth0

then the segfault would not happen, but it would still happen with

 ip -f inet6 addr show dev eth0

This lead me to the conclusion that I must have an incompatibility with IPv6 support somewhere in my toolchain or busybox. I rebuild my entire target, toolchain, kernel and uClibc from scratch once again with the buildroot config files, this time ensuring that my crosstools were created with IPV6 support. With that option set the reported segfault no longer occurs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.