Current-Users archive

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

Re: dspam problem



On Thu, Mar 26, 2009 at 09:39:31PM +0200, Martti Kuparinen wrote:

> This gets really weird... Do we have changes in pthread stuff since 5.0_RC1 
> which could cause this?

Yes and no. There are two issues of note:

- With SA, processes were by and large single threaded from the perspective
  of the ptrace() interface, and so ptrace() lacks real thread support.

- Our in-tree gdb was upgraded and lost its NetBSD thread support.

The only way to debug threaded programs is to get a core dump from the
program. gdb does understand the thread info in ELF core files.

What you see when you attach to the process is information from a "random"
thread.

> # ./dspam --daemon
> 2315: [03/26/2009 21:23:08] Daemon process starting
> 
> # gdb attach 2315
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0xbb6f58c7 in read () from /usr/lib/libc.so.12
> (gdb) bt
> #0  0xbb6f58c7 in read () from /usr/lib/libc.so.12
> #1  0xbb7c7efd in read () from /usr/lib/libpthread.so.0
> #2  0xbb79ed82 in __sread () from /usr/lib/libc.so.12
> #3  0xbb793cfd in __srefill () from /usr/lib/libc.so.12
> #4  0xbb772559 in fgets () from /usr/lib/libc.so.12
> #5  0x0804ae1f in has_virus (message=0xbb5854a0) at dspam.c:3622
> #6  0x0804f723 in process_message (ATX=0xbb597000, message=0xbb5854a0,
>     username=0xbb586280 "xxx%xxx.xxx@localhost", result_string=0x86dff1b4)
>     at dspam.c:398
> #7  0x08050fbc in process_users (ATX=0xbb597000, message=0xbb585480)
>     at dspam.c:1793
> #8  0x08053d6a in process_connection (ptr=0xbb587250) at daemon.c:724
> #9  0xbb7cc9e7 in pthread_create () from /usr/lib/libpthread.so.0
> #10 0xbb718420 in swapcontext () from /usr/lib/libc.so.12
> (gdb)
> 


Home | Main Index | Thread Index | Old Index