Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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-0.9.33.2.so. 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 172.18.255.212/24 brd 172.18.255.255 scope global eth0
[  331.700545] ip[951]: segfault at 0 ip b76e1f26 sp bfbd29b0 error 4 in 
libuClibc-0.9.33.2.so[b76b5000+4d000]
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).

socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
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 192.168.12.198/16 brd 1"..., 65    inet 192.168.12.198/16 brd 192.168.255.255 scope global eth1
) = 65
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault
share|improve this question
    
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
show 4 more comments

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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