pkgsrc-Bugs archive

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

pkg/44337: sendmail failes to run when compiled with latest db4 lib



>Number:         44337
>Category:       pkg
>Synopsis:       sendmail failes to run when compiled with latest db4 lib
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 07 12:15:01 +0000 2011
>Originator:     Dr. W. Stukenbrock
>Release:        NetBSD 5.1
>Organization:
Dr. Nagler & Company GmbH
>Environment:
        
        
System: NetBSD test-s0 4.0 NetBSD 4.0 (NSW-WS) #0: Tue Aug 17 17:28:09 CEST 
2010 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
        Sendmail is a single threaded program that uses the old-style resolver 
interface with "_res".
        NetBSD supports "_res" only for single threaded programs.
        If a program is linked with libpthread it is assumed to be 
multithreaded.
        This is OK - for most cases ...
        Db4-lib 4.8 now uses mutexes from libpthread and sendmail gets linked 
against this lib.
        The resulting sendmail binary will now abort with a message, because it 
uses the old interface.
>How-To-Repeat:
        Try to run pkgsrc-sendmail with db4 support enabled. It will fail with 
the message
        "_res is not supported for multi-threaded programs."
>Fix:
        Since sendmail itself is a single threaded program, the problem an be 
fixed for NetBSD with the
        following patch to sendmail/sendmail.h.
        This will force the use of the single-thread version for all sendmail 
sources.
        It uses knowledge about internal functions of the resolver stuff in 
libc.
        The patch will only change anything for NetBSD systems, because I do 
not know if any correction
        are needed for other operation systems.
        The result of this patch is the same as if libpthread is not linked.
        (__res_state is a weak-alias for __res_get_state_nothread in 
libc/resolv/res_state.c)
        So it can be used even for builds without db4.

--- sendmail/sendmail.h.orig    2011-01-07 12:33:08.000000000 +0100
+++ sendmail/sendmail.h 2011-01-07 12:33:28.000000000 +0100
@@ -109,6 +109,13 @@
 #   undef NOERROR              /* avoid <sys/streams.h> conflict */
 #  endif /* NOERROR */
 #  include <resolv.h>
 #  ifdef __NetBSD__
+/* force redirection of old-style resolver usage to single-thread version
+ * db4 library may drag in libpthread forcing sendmail to fail
+ */
+    extern res_state __res_get_state_nothread(void);
+#   define __res_state __res_get_state_nothread
+#  endif
 # else /* NAMED_BIND */
 #   undef SM_SET_H_ERRNO
 #   define SM_SET_H_ERRNO(err)

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index