Re: tin 1.9.4 20090211 segfaults

Urs Janßen <[email protected]> Tue, 9 Jun 2009 13:55:26 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On Tue, Jun 09, 2009 at 12:50:43PM +0200, clemens fischer wrote:
> 'uname -rims'
> Linux 2.6.29-ARCH i686 AuthenticAMD
> 
> 'gcc --version'
> gcc (GCC) 4.4.0 20090526 (prerelease)
> Copyright (C) 2009 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
>   /src/bulk/tin/tin-1.9.4/src
>   0 5 # ./tin -r
>   Reading config file...
>   tin 1.9.4 release 20090211 ("Rieclachan") [UNIX] (c) Copyright 1991-2009 Iain Lea.
>   Connecting to 127.0.0.1...
>   tin: signal handler caught SIGSEGV signal (11).
>   tin 1.9.4 20090211 ("Rieclachan") [UNIX]: send a DETAILED bug report to [email protected]
>   Aborted (core dumped)
> 
> After having a working, unchanged same version which broke after
> updating libicuuc.so.42 from libicuuc.so.40, I decided to re-compile and
> re-install:
> 
>  1112  090609-12:35 rm config.*

use 'make distclean' instead, this will remove src/Makefile and
include/autoconf.h as well - keeping them might lead to "funny" results (and
cofigure sometime fails to overwrite them).

>  1113  090609-12:36 ./configure --disable-nls --disable-etiquette --enable-cancel-locks --with-pcre=/usr --enable-debug --with-gpg=/usr/bin/gpg --program-suffix=-test
>  1114  090609-12:36 make build
>  1115  090609-12:37 pd
>  1116  090609-12:37 ./tin -r
> 
> I have a valgrind log from an earlier run, which is appended at the end.
> 
>   /src/bulk/tin/tin-1.9.4/src
>   0 5 # ldd /l/bin/tin-test
>           linux-gate.so.1 =>  (0xb7eff000)
>           libpcre.so.0 => /lib/libpcre.so.0 (0xb7eb9000)
>           libncursesw.so.5 => /lib/libncursesw.so.5 (0xb7e6c000)
>           libidn.so.11 => /usr/lib/libidn.so.11 (0xb7e3b000)
>           libicuuc.so.42 => /usr/lib/libicuuc.so.42 (0xb7cf9000)
>           libc.so.6 => /lib/libc.so.6 (0xb7bb1000)
>           libicudata.so.42 => /usr/lib/libicudata.so.42 (0xb6c69000)
>           libpthread.so.0 => /lib/libpthread.so.0 (0xb6c51000)
>           libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6b5f000)
>           libm.so.6 => /lib/libm.so.6 (0xb6b39000)
>           libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb6b1b000)
>           /lib/ld-linux.so.2 (0xb7f00000)
> 
> Here's the gdb backtrace:
> 
>   /src/bulk/tin/tin-1.9.4/src
>   134 5 # gdb tin core
>   GNU gdb 6.8
>   Copyright (C) 2008 Free Software Foundation, Inc.
>   ...
>   This GDB was configured as "i686-pc-linux-gnu"...
>   Reading symbols from /home/src/bulk/tin/tin-1.9.4/src/tin...done.
>   Using host libthread_db library "/lib/libthread_db.so.1".
> 
>   warning: Can't read pathname for load map: Input/output error.
>   Reading symbols from /lib/libpcre.so.0...done.
>   Loaded symbols for /lib/libpcre.so.0
>   Reading symbols from /lib/libncursesw.so.5...done.
>   Loaded symbols for /lib/libncursesw.so.5
>   Reading symbols from /usr/lib/libidn.so.11...done.
>   Loaded symbols for /usr/lib/libidn.so.11
>   Reading symbols from /usr/lib/libicuuc.so.42...done.
>   Loaded symbols for /usr/lib/libicuuc.so.42
>   Reading symbols from /lib/libc.so.6...done.
>   Loaded symbols for /lib/libc.so.6
>   Reading symbols from /usr/lib/libicudata.so.42...
>   warning: Lowest section in /usr/lib/libicudata.so.42 is .hash at 000000b4
>   done.
>   Loaded symbols for /usr/lib/libicudata.so.42
>   Reading symbols from /lib/libpthread.so.0...done.
>   Loaded symbols for /lib/libpthread.so.0
>   Reading symbols from /usr/lib/libstdc++.so.6...done.
>   Loaded symbols for /usr/lib/libstdc++.so.6
>   Reading symbols from /lib/libm.so.6...done.
>   Loaded symbols for /lib/libm.so.6
>   Reading symbols from /usr/lib/libgcc_s.so.1...done.
>   Loaded symbols for /usr/lib/libgcc_s.so.1
>   Reading symbols from /lib/ld-linux.so.2...done.
>   Loaded symbols for /lib/ld-linux.so.2
>   Reading symbols from /lib/libnss_files.so.2...done.
>   Loaded symbols for /lib/libnss_files.so.2
>   Reading symbols from system-supplied DSO at 0xb80ac000...done.
>   Core was generated by `./tin -r'.
>   Program terminated with signal 6, Aborted.
>   [New process 22614]
>   #0  0xb80ac424 in __kernel_vsyscall ()
>   (gdb) bt full
>   incomplete CFI data; unspecified registers (e.g., eax) at 0xb80ac425...Reading in symbols for ./signal.c...
>   DW_AT_name missing from DW_TAG_base_type...DW_AT_type missing from DW_TAG_subrange_type...done.
>   Reading in symbols for ./nntplib.c...done.
>   Reading in symbols for ./main.c...done.
>   #0  0xb80ac424 in __kernel_vsyscall ()
>   No symbol table info available.
>   #1  0xb7d887a1 in raise () from /lib/libc.so.6
>   No symbol table info available.
>   #2  0xb7d89fd4 in abort () from /lib/libc.so.6
>   No symbol table info available.
>   #3  0x080a7e41 in signal_handler (sig=11) at ./signal.c:447
>           wait_status = 1
>   #4  <signal handler called>
>   No symbol table info available.
>   #5  0x08084990 in nntp_open () at ./nntplib.c:447
>           linep = <value optimized out>
>           line = "\2003\352\267\021\000\000\000\021\000\000\000\b\247F\t\000\000\000\000\364\037\352\267\310GF\t\377\377\377\377\210n\314\277\203\373\334\267\020\000\000\000H\000\000\000\344g\337\267\326\264\334\267\2703\352\267\020\000\000\000H\000\000\000B\000\000\000\000\033\352\267\000\000\000\0001\000\000\000\364\037\352\267\001\000\000\000\300O\006\270\250n\314\277\253\\\332\267\r\247F\t\260GF\t^\306\334\267\030J\006\270\021\000\000\000\324\254\004\270\2003\352\267\364\037\352\267H\247F\t\021\000\000\000\370n\314\277\016\366\334\267\260GF\t\271*\350\267\r\000\000\000x\000\000\000\r\000\000\000i\000\000\000i\000\000\000h\000\000\000\000\000\000\000\364\037\352\267P\247F\t\2003\352\267"...
>           i = <value optimized out>
>           ret = <value optimized out>
>           sec = 0
>           is_reconnect = 0
>   #6  0x0807a544 in main (argc=2, argv=0xbfcc7124) at ./main.c:197
>           count = <value optimized out>
>           num_cmd_line_groups = <value optimized out>
>           start_groupnum = <value optimized out>
>           tmp_no_write = 0
>   (gdb) quit

recompile without any optimizations (CFLAGS=-O0) and run tin from inside gdb

# gdb tin
(gdb) run -r

use till it crashes and then do a backtrace
(gdb) bt

and select the frame before the signal_handler (in the above output it
would be frame 5)

(gdb) frme 5
(gdb) print *line

> ==27973== Memcheck, a memory error detector.
> ==27973== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
> ==27973== Using LibVEX rev 1884, a library for dynamic binary translation.
> ==27973== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
> ==27973== Using valgrind-3.4.1, a dynamic binary instrumentation framework.
> ==27973== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
> ==27973==
> ==27973== My PID = 27973, parent PID = 8205.  Prog and args are:
> ==27973==    rtin-test
> ==27973==
> --27973--
> --27973-- Command line
> --27973--    rtin-test
> --27973-- Startup, with flags:
> --27973--    -v
> --27973--    --log-file=../valgrind.log
> --27973-- Contents of /proc/version:
> --27973--   Linux version 2.6.29-ARCH (root@T-POWA-LX) (gcc version 4.4.0 (GCC) ) #1 SMP PREEMPT Wed May 20 07:06:02 UTC 2009
> --27973-- Arch and hwcaps: X86, x86-sse1-sse2
> --27973-- Page sizes: currently 4096, max supported 4096
> --27973-- Valgrind library directory: /usr/lib/valgrind
> --27973-- Reading syms from /lib/ld-2.10.1.so (0x4000000)
> --27973-- Reading syms from /usr/local/opt/tin/1.9.4/bin/tin-test (0x8048000)
> --27973--    object doesn't have a symbol table
> --27973-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000)
> --27973--    object doesn't have a symbol table
> --27973--    object doesn't have a dynamic symbol table
> --27973-- Reading suppressions file: /usr/lib/valgrind/default.supp
> --27973-- REDIR: 0x4016930 (index) redirected to 0x3803b8d3 (???)
> --27973-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so (0x401f000)
> --27973-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so (0x4021000)
> ==27973== WARNING: new redirection conflicts with existing -- ignoring it
> --27973--     new: 0x04016930 (index               ) R-> 0x040256b0 index
> --27973-- REDIR: 0x4016ad0 (strlen) redirected to 0x4025970 (strlen)
> --27973-- Reading syms from /lib/libpcre.so.0.0.1 (0x403e000)
> --27973-- Reading syms from /lib/libncursesw.so.5.7 (0x406f000)
> --27973-- Reading syms from /usr/lib/libidn.so.11.5.43 (0x40bc000)
> --27973-- Reading syms from /usr/lib/libicuuc.so.42.0 (0x40ed000)
> --27973-- Reading syms from /lib/libc-2.10.1.so (0x4230000)
> --27973-- Reading syms from /lib/libpthread-2.10.1.so (0x52bf000)
> --27973-- Reading syms from /usr/lib/libstdc++.so.6.0.12 (0x52d7000)
> --27973-- Reading syms from /lib/libm-2.10.1.so (0x53c9000)
> --27973-- Reading syms from /usr/lib/libgcc_s.so.1 (0x53f0000)
> --27973-- REDIR: 0x42a3bc0 (index) redirected to 0x4025680 (index)
> --27973-- REDIR: 0x42a5990 (memchr) redirected to 0x4025db0 (memchr)
> --27973-- REDIR: 0x42a4660 (rindex) redirected to 0x4025590 (rindex)
> --27973-- REDIR: 0x42a3d30 (strcmp) redirected to 0x4025c90 (strcmp)
> --27973-- REDIR: 0x42a42a0 (strlen) redirected to 0x4025950 (strlen)
> --27973-- REDIR: 0x42a4490 (strncmp) redirected to 0x4025c00 (strncmp)
> --27973-- REDIR: 0x42a8f70 (strchrnul) redirected to 0x4026a30 (strchrnul)
> --27973-- REDIR: 0x42a0b30 (malloc) redirected to 0x4025160 (malloc)
> --27973-- REDIR: 0x42a5ef0 (mempcpy) redirected to 0x4026a90 (mempcpy)
> --27973-- REDIR: 0x42a63a0 (memcpy) redirected to 0x4025df0 (memcpy)
> --27973-- REDIR: 0x42a0a50 (free) redirected to 0x4023e00 (free)
> --27973-- REDIR: 0x42a4580 (strncpy) redirected to 0x4025a90 (strncpy)
> --27973-- REDIR: 0x42a3da0 (strcpy) redirected to 0x40259b0 (strcpy)
> --27973-- REDIR: 0x42a0270 (calloc) redirected to 0x4023080 (calloc)
> --27973-- REDIR: 0x42a6080 (stpcpy) redirected to 0x40266a0 (stpcpy)
> --27973-- Reading syms from /lib/libnss_files-2.10.1.so (0x5afd000)
> --27973-- REDIR: 0x42a43f0 (strncat) redirected to 0x4025800 (strncat)
> --27973-- REDIR: 0x42a8ea0 (rawmemchr) redirected to 0x4026a70 (rawmemchr)
> --27973-- REDIR: 0x42a1aa0 (realloc) redirected to 0x4025280 (realloc)
> ==27973== Invalid write of size 4
> ==27973==    at 0x8084990: (within /usr/local/opt/tin/1.9.4/bin/tin-test)
> ==27973==    by 0x807A543: (within /usr/local/opt/tin/1.9.4/bin/tin-test)
> ==27973==    by 0x4246A35: (below main) (in /lib/libc-2.10.1.so)
> ==27973==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
> ==27973==
> ==27973== Process terminating with default action of signal 6 (SIGABRT): dumping core
> ==27973==    at 0x425A7A1: raise (in /lib/libc-2.10.1.so)
> ==27973==    by 0x425BFD3: abort (in /lib/libc-2.10.1.so)
> ==27973==    by 0x80A7E40: (within /usr/local/opt/tin/1.9.4/bin/tin-test)
> ==27973==    by 0x425A847: (within /lib/libc-2.10.1.so)
> ==27973==    by 0x807A543: (within /usr/local/opt/tin/1.9.4/bin/tin-test)
> ==27973==    by 0x4246A35: (below main) (in /lib/libc-2.10.1.so)
> --27973-- Discarding syms at 0x5afe9f0-0x5b05d88 in /lib/libnss_files-2.10.1.so due to munmap()
> ==27973==
> ==27973== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 35 from 1)
> ==27973==
> ==27973== 1 errors in context 1 of 1:
> ==27973== Invalid write of size 4
> ==27973==    at 0x8084990: (within /usr/local/opt/tin/1.9.4/bin/tin-test)
> ==27973==    by 0x807A543: (within /usr/local/opt/tin/1.9.4/bin/tin-test)
> ==27973==    by 0x4246A35: (below main) (in /lib/libc-2.10.1.so)
> ==27973==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
> --27973--
> --27973-- supp:     35 dl-hack3-cond-1
> ==27973==
> ==27973== IN SUMMARY: 1 errors from 1 contexts (suppressed: 35 from 1)
> ==27973==
> ==27973== malloc/free: in use at exit: 279,683 bytes in 91 blocks.
> ==27973== malloc/free: 227 allocs, 136 frees, 295,279 bytes allocated.
> ==27973==
> ==27973== searching for pointers to 91 not-freed blocks.
> ==27973== checked 594,412 bytes.
> ==27973==
> ==27973== LEAK SUMMARY:
> ==27973==    definitely lost: 0 bytes in 0 blocks.
> ==27973==      possibly lost: 0 bytes in 0 blocks.
> ==27973==    still reachable: 279,683 bytes in 91 blocks.
> ==27973==         suppressed: 0 bytes in 0 blocks.
> ==27973== Rerun with --leak-check=full to see details of leaked memory.
> --27973--  memcheck: sanity checks: 8 cheap, 2 expensive
> --27973--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
> --27973--  memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
> --27973--  memcheck: auxmaps_L2: 0 searches, 0 nodes
> --27973--  memcheck: SMs: n_issued      = 32 (512k, 0M)
> --27973--  memcheck: SMs: n_deissued    = 0 (0k, 0M)
> --27973--  memcheck: SMs: max_noaccess  = 65535 (1048560k, 1023M)
> --27973--  memcheck: SMs: max_undefined = 1 (16k, 0M)
> --27973--  memcheck: SMs: max_defined   = 365 (5840k, 5M)
> --27973--  memcheck: SMs: max_non_DSM   = 32 (512k, 0M)
> --27973--  memcheck: max sec V bit nodes:    3 (0k, 0M)
> --27973--  memcheck: set_sec_vbits8 calls: 3 (new: 3, updates: 0)
> --27973--  memcheck: max shadow mem size:   816k, 0M
> --27973-- translate:            fast SP updates identified: 8,070 ( 86.5%)
> --27973-- translate:   generic_known SP updates identified: 1,002 ( 10.7%)
> --27973-- translate: generic_unknown SP updates identified: 249 (  2.6%)
> --27973--     tt/tc: 12,924 tt lookups requiring 13,619 probes
> --27973--     tt/tc: 12,924 fast-cache updates, 4 flushes
> --27973--  transtab: new        6,015 (146,778 -> 2,051,934; ratio 139:10) [0 scs]
> --27973--  transtab: dumped     0 (0 -> ??)
> --27973--  transtab: discarded  166 (2,943 -> ??)
> --27973-- scheduler: 844,345 jumps (bb entries).
> --27973-- scheduler: 8/7,580 major/minor sched events.
> --27973--    sanity: 9 cheap, 2 expensive checks.
> --27973--    exectx: 769 lists, 764 contexts (avg 0 per list)
> --27973--    exectx: 1,653 searches, 1,290 full compares (780 per 1000)
> --27973--    exectx: 0 cmp2, 110 cmp4, 0 cmpAll
> --27973--  errormgr: 11 supplist searches, 112 comparisons during search
> --27973--  errormgr: 36 errlist searches, 120 comparisons during search
> 
> valgrind: m_main.c:2217 (shutdown_actions_NORETURN): Assertion 'VG_(threads)[tid].os_state.fatalsig != 0' failed.
> ==27973==    at 0x38025F28: (within /usr/lib/valgrind/x86-linux/memcheck)
> 
> sched status:
>   running_tid=1