Subject: invalid mutex in named
To: None <current-users@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: current-users
Date: 08/07/2007 21:43:52
I am testing latest greatest named from ISC's bind9 CVS.
This is with old NetBSD/i386 

It is failing with:

I built with --with-libxml2 --with-dlz-filesystem=yes --with-dlz-bdb=/usr/pkg

Running named immediately exits:

glacier:/usr/local/etc$ sudo /usr/local/sbin/named -g -d 1 
named: Error detected by libpthread: Invalid mutex.
Detected by file "/usr/src/lib/libpthread/pthread_mutex.c", line 334, 
function "pthread_mutex_unlock".
See pthread(3) for information.
Abort (core dumped) 

Here's the backtrace:

(gdb) bt
#0  0xbb7c2a6b in kill () from /usr/lib/libc.so.12
#1  0xbb9d0e03 in pthread__errorfunc () from /usr/lib/libpthread.so.0
#2  0xbb9cf811 in pthread_mutex_unlock () from /usr/lib/libpthread.so.0
#3  0x081606d4 in isc_mem_createx2 (init_max_size=0, target_size=0, 
    memalloc=0x815e944 <default_memalloc>, 
    memfree=0x815da18 <default_memfree>, arg=0x0, ctxp=0x81b32e0, flags=2)
    at mem.c:814
#4  0x081608c6 in isc_mem_create (init_max_size=0, target_size=0, 
    ctxp=0x81b32e0) at mem.c:841
#5  0x0805846f in main (argc=0, argv=0xbfbfec70) at ./main.c:866
#6  0x0804bb70 in ___start ()


If I understand this correctly, some operating systems' threading 
implementations ignore the error of calling pthread_mutex_unlock() on a 
data area which is not a properly initialized mutex. But NetBSD doesn't 
allow it.

Hs anyone else hit this? Does our bind9 in our NetBSD tree have this issue 
patched (or maybe it is newer)? (I looked at CVS logs for related files 
but didn't notice anything.)

  Jeremy C. Reed

p.s. I also emailed about this to the bind workers list.