tech-userlevel archive

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

Re: radiusd: Error detected by libpthread: Invalid mutex.

> It is prolly a radiusd bug:
Maybe yes. See below.

> $ gdb radiusd radiusd.core
Unfortunately, this (with allow_core_dumps=yes in radiusd.conf) doesn't give
me a core dump.

The problem seems to be that radiusd sets up mutexes (pthread_mutex_init)
while reading the config file. It reads the config file before fork()ing
in order to daemonize. In fact, running it with -f and then manually
backgrounding it makes the problem disappear.
Also, moving the config-file reading code below the fork() also helps.

Before reporting a bug to the FreeRADIUS people: It looks weird to me to
create a mutex, then fork and use the mutex in the child process. However,
I'm unsure whether this is really illegal (I can't find anything saying so
besides the sheer existance of pthread_atfork(), which radiusd doesn't call)
or a problem with NetBSD's implementation.

Any pthread experts to help me?

Home | Main Index | Thread Index | Old Index