Here it is (I modified CCOPTS in the Makefile to replace -O2 by -g to get line 
numbers):
#0  0xb7f8eb45 in fgets () from /lib/tls/i686/cmov/libc.so.6
#1  0x0804c6ff in generic_record_read (fp=0x0, 
    worker=0x804dc35 <dgram_show_line>, f=0x805af50, fam=10) at ss.c:1233
#2  0x0804e216 in udp_show (f=0x805af50) at ss.c:1786
#3  0x08050d59 in main (argc=0, argv=0xbf9ccecc) at ss.c:2774

I think the problem is in the pointer comparison at ss.c:1785:
        if ((f->families&(1<<AF_INET6)) &&
            (fp = net_udp6_open()) >= 0) {

I changed this to
        if ((f->families&(1<<AF_INET6)) &&
            (fp = net_udp6_open()) != NULL) {

and the problem went away. There is similar bug in ss.c:1777, too:
        if (f->families&(1<<AF_INET)) {
                if ((fp = net_udp_open()) < 0)

Indeed trying PROC_NET_UDP=/foo/bar ./misc/ss -un segfaulted. Changing above to:
        if (f->families&(1<<AF_INET)) {
                if ((fp = net_udp_open()) == NULL)

fixed also that problem.

-- 
iproute: ss -u segfaults if ipv6 module is not loaded
https://bugs.launchpad.net/bugs/225573
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to