Our testing sucks

Eric S. Raymond esr at thyrsus.com
Mon Jun 27 06:17:36 UTC 2016


Hal Murray <hmurray at megapathdsl.net>:
> 
>  1007  ./waf configure --refclock=20,22 --enable-debug-gdb
>  1008  ./waf build
>  1009  gdb ./build/main/ntpq/ntpq
> 
> (gdb) run -p
> Starting program: /home/murray/ntpsec/raw/build/main/ntpq/ntpq -p
> Missing separate debuginfos, use: dnf debuginfo-install 
> glibc-2.21-13.fc22.x86_64
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
>      remote           refid      st t when poll reach   delay   offset  jitter
> ==============================================================================
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000413d68 in strlcpy (dst=0x7fffffffd700 "", 
>     src=0x4f <error: Cannot access memory at address 0x4f>, siz=1025)
>     at ../../libntp/strl_obsd.c:36
> 36                              if ((*d++ = *s++) == '\0')
> Missing separate debuginfos, use: dnf debuginfo-install 
> ncurses-libs-5.9-18.20150214.fc22.x86_64
> (gdb) bt
> #0  0x0000000000413d68 in strlcpy (dst=0x7fffffffd700 "", 
>     src=0x4f <error: Cannot access memory at address 0x4f>, siz=1025)
>     at ../../libntp/strl_obsd.c:36
> #1  0x000000000040a561 in doprintpeers (pvl=0x625460 <peervarlist>, 
>     associd=1947, rstatus=37914, datalen=2, 
>     data=0x62880d <pktdata+525> "\r\n", fp=0x7ffff725b620 <_IO_2_1_stdout_>, 
>     af=0) at ../../ntpq/ntpq-subs.c:1795
> #2  0x000000000040a8c8 in dogetpeers (pvl=0x625460 <peervarlist>, 
>     associd=1947, fp=0x7ffff725b620 <_IO_2_1_stdout_>, af=0)
>     at ../../ntpq/ntpq-subs.c:1877
> #3  0x000000000040aae1 in dopeers (showall=0, 
>     fp=0x7ffff725b620 <_IO_2_1_stdout_>, af=0) at ../../ntpq/ntpq-subs.c:1928
> #4  0x000000000040ad9a in peers (pcmd=0x7fffffffe220, 
>     fp=0x7ffff725b620 <_IO_2_1_stdout_>) at ../../ntpq/ntpq-subs.c:2008
> #5  0x0000000000404bc2 in docmd (cmdline=0x419d08 "peers")
>     at ../../ntpq/ntpq.c:1649
> #6  0x0000000000402cda in ntpqmain (argc=0, argv=0x7fffffffe478)
>     at ../../ntpq/ntpq.c:658
> #7  0x0000000000402426 in main (argc=2, argv=0x7fffffffe468)
>     at ../../ntpq/ntpq.c:442
> (gdb) 

This is weird.  I'm doing ntpq -p constantly as a smoke test - I'm not
seeing this.  But when I looked at the code just now there was an obvious
uninitialized variable.  It *shouldn't* have worked here - my test has
been constantly thowing false negatives.

That's disturbing.

Fix pushed.  I think this is probably also issue #86.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>


More information about the devel mailing list