[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
>Synopsis: sendmail failes to run when compiled with latest db4 lib
>Arrival-Date: Fri Jan 07 12:15:01 +0000 2011
>Originator: Dr. W. Stukenbrock
>Release: NetBSD 5.1
Dr. Nagler & Company GmbH
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
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
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.
Try to run pkgsrc-sendmail with db4 support enabled. It will fail with
"_res is not supported for multi-threaded programs."
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
It uses knowledge about internal functions of the resolver stuff in
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
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
# else /* NAMED_BIND */
# undef SM_SET_H_ERRNO
# define SM_SET_H_ERRNO(err)
Main Index |
Thread Index |