On Fri, 30 Jul 2004 15:49:18 +0100
Ollie Cook <[EMAIL PROTECTED]> wrote:

> On Fri, Jul 30, 2004 at 10:24:50AM +0100, Ollie Cook wrote:
> > I have recompiled with debugging symbols, so I will be able to
> > provide a more comprehensive backtrace the next time this occurs.
> 
> With debugging symbols the backtrace is:
> 
> (gdb) c
> Continuing.
> [Switching to process 33496, thread 24]
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x2813e6bf in _flockfile_debug () from /usr/lib/libc_r.so.4
> (gdb) bt
> #0  0x2813e6bf in _flockfile_debug () from /usr/lib/libc_r.so.4
> #1  0x2813e856 in flockfile () from /usr/lib/libc_r.so.4
> #2  0x2815778f in fgets () from /usr/lib/libc_r.so.4
> #3  0x2814f0ae in gethostent () from /usr/lib/libc_r.so.4
> #4  0x2814f2a6 in _gethostbyhtname () from /usr/lib/libc_r.so.4
> #5  0x2814ebd0 in gethostbyname2 () from /usr/lib/libc_r.so.4
> #6  0x2814eb61 in gethostbyname () from /usr/lib/libc_r.so.4
> #7  0x804ffda in scanstream (odesc=16, scanned=0x0, root=0x8084800, 
>     limits=0xbfbffa20, options=27, copt=0x80564c0) at scanner.c:240
> #8  0x804dfce in command (desc=16, root=0x8084800, limits=0xbfbffa20, 
>     options=27, copt=0x80564c0) at session.c:125
> #9  0x804e854 in scanner_thread (arg=0xc608ca0) at server-th.c:74
> #10 0x804e64d in thrmgr_worker (arg=0x955ee00) at thrmgr.c:199
> #11 0x280ff240 in _thread_start () from /usr/lib/libc_r.so.4
> #12 0xbfa10ffc in ?? ()
> #13 0x281255de in accept () from /usr/lib/libc_r.so.4
> #14 0x804f3b8 in acceptloop_th (socketd=4, root=0x8084800,
> copt=0x80564c0)
>     at server-th.c:413
> #15 0x804d7bc in tcpserver (opt=0x805a040, copt=0x80564c0,
> root=0x8084800)
>     at tcpserver.c:112
> #16 0x804d319 in clamd (opt=0x805a040) at clamd.c:285
> #17 0x804c478 in main (argc=2, argv=0xbfbffb94) at options.c:114
> (gdb) fr 7
> #7  0x804ffda in scanstream (odesc=16, scanned=0x0, root=0x8084800, 
>     limits=0xbfbffa20, options=27, copt=0x80564c0) at scanner.c:240
> 240                 if ((he = gethostbyname(cpt->strarg)) == 0) {
> (gdb) p cpt->strarg
> $7 = 0x805a0c0 "80.168.70.183"
> 
> Since the call to gethostbyname has a valid argument, I'm guessing
> there's probably some memory corruption causing this crash.

Thank you for reporting this bug. gethostbyname() is not reentrant,
clamd should use gethostbyname_r()

-- 
   oo    .....         Tomasz Kojm <[EMAIL PROTECTED]>
  (\/)\.........         http://www.ClamAV.net/gpg/tkojm.gpg
     \..........._         0DCA5A08407D5288279DB43454822DC8985A444B
       //\   /\              Fri Jul 30 17:33:01 CEST 2004

Attachment: pgp2xiky4tNRw.pgp
Description: PGP signature

Reply via email to