Subject: Re: Problems trying to debug pkgsrc/mail/milter-greylist
To: Gert Doering <gert@greenie.muc.de>
From: Chris Ross <cross+netbsd@distal.com>
List: port-sparc64
Date: 11/26/2007 12:38:11
On Nov 23, 2007, at 02:40, Gert Doering wrote:
> Michael-John Turner wrote:
>> Another possibility is to build milter-greylist using pth rather than
>> native threads. [..]
>

> OK.  It's not straightforward, because it needs careful mangling of
> system header files - but it can be done.

   I did this in a slightly different way.  I made a patch-local-aa to
pkgsrc/mail/sendmail to get libmilter to build correctly against pth's
libpthread, and ended up modifying config.h after the "make configure"
phase of building milter-greylist.  The last part isn't really  
repeatable,
so I won't post patches or anything, but since it doesn't work in the
end anyway.....

> now ldd confirms that milter-greylist is using pkg pth only - but  
> alas:
> it still crashes on me.

   This is true for me as well.  The first run, which only ran an hour
or two, yielded:

Program received signal SIGPIPE, Broken pipe.
0x0000000040b397d8 in writev () from /usr/lib/libc.so.12
(gdb) where
#0  0x0000000040b397d8 in writev () from /usr/lib/libc.so.12
#1  0x0000000040513d04 in __pth_sc_writev () from /usr/pkg/lib/ 
libpthread.so.20
#2  0x00000000405118d0 in pth_writev_ev () from /usr/pkg/lib/ 
libpthread.so.20
#3  0x00000000001304b4 in mi_wr_cmd ()
#4  0x000000000012f94c in sendreply ()
#5  0x00000000001301e8 in mi_engine ()
#6  0x000000000012cbb4 in mi_handle_session ()
#7  0x000000000012b980 in mi_thread_handle_wrapper ()
#8  0x000000004050dd0c in pth_spawn_trampoline ()
    from /usr/pkg/lib/libpthread.so.20
#9  0x0000000040ba7fc0 in _lwp_makecontext () from /usr/lib/libc.so.12
#10 0x0000000040ba7fc0 in _lwp_makecontext () from /usr/lib/libc.so.12
Previous frame identical to this frame (corrupt stack?)
(gdb)

   So, I'm not sure why, but it seems pth has similar problems to
the native threads, at least on NetBSD-4.0_RC3 sparc64, for me.

   I'll try running this one repeatedly, as I had been doing with
the one compiled against native pthreads, and see if it feels any
different.

                            - Chris