Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ntpq -p coredumps with today's sources



Could you check this patch.

ntpq.c exercises the new AI_ADDRCONFIG option in getaddrinfo(). There seems to
be a PNPE (programmed null pointer exception).

Frank


On 03/20/12 00:44, Sverre Froyen wrote:
Hi,

With sources from today (kernel and userland), I get a segmentation fault from
'ntpq -p'. Gdb says

Program received signal SIGSEGV, Segmentation fault.
0x00007f7ff5cd4b58 in getaddrinfo () from /usr/lib/libc.so.12
(gdb) bt
#0  0x00007f7ff5cd4b58 in getaddrinfo () from /usr/lib/libc.so.12
#1  0x0000000000403f8b in openhost ()
#2  0x0000000000406427 in ntpqmain ()
#3  0x0000000000403542 in ___start ()
#4  0x00007f7ff7c06ae6 in _rtld () from /usr/libexec/ld.elf_so
#5  0x00007f7ffffff9d8 in ?? ()
#6  0x00007f7ffffff9f7 in ?? ()
#7  0x00007f7ffffffa56 in ?? ()
#8  0x00007f7ffffffa96 in ?? ()
#9  0x00007f7ffffffab6 in ?? ()
#10 0x00007f7ffffffac8 in ?? ()
#11 0x00007f7ffffffad8 in ?? ()
#12 0x00007f7ffffffb0a in ?? ()
#13 0x00007f7ffffffb20 in ?? ()
...

I don't see any other major breakage. Is ntpq using getaddrinfo incorrectly?

This is on NetBSD 6.99.4 / amd64.

Regards,
Sverre

Index: getaddrinfo.c
===================================================================
RCS file: /cvsroot/src/lib/libc/net/getaddrinfo.c,v
retrieving revision 1.98
diff -u -r1.98 getaddrinfo.c
--- getaddrinfo.c       17 Mar 2012 21:56:40 -0000      1.98
+++ getaddrinfo.c       20 Mar 2012 07:35:25 -0000
@@ -1032,7 +1032,7 @@
        if (getifaddrs(&ifaddrs) == -1)
                return -1;
 
-       mask = 0;
+       *mask = 0;
        for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next)
                if (ifa->ifa_addr && (ifa->ifa_flags & IFF_UP)) {
                        _DIAGASSERT(ifa->ifa_addr->sa_family < 64);


Home | Main Index | Thread Index | Old Index