Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] Re: libpthread: Invalid condition variable

2009-09-29 by Petar Bogdanovic

On Tue, Sep 29, 2009 at 09:59:46AM -0000, reschauzier wrote:
> Ah, I see. The problem is that mg_init() [and therefore dump_init()]
> is called _after_ conf_load() in main(). I am assuming that before the
> introduction of store.c, dump_init used to be called _before_
> conf_load(), properly initializing the cond var. Is this what the
> problem was?

Yes.


> Also, I wonder why nobody caught it before -- do you have any thoughts
> on that?

I guess it depends on your local pthreads implementation.  The NetBSD
libc SIGABRTs the process if cond wasn't initialized properly:

	| __RCSID("$NetBSD: pthread_cond.c,v 1.18 2005/01/06 17:33:36 mycroft Exp $");
	|
	| (...)
	|
	| int
	| pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
	| {
	|
	| 	pthread__error(EINVAL, "Invalid condition variable attribute",
	| 	    (attr == NULL) || (attr->ptca_magic == _PT_CONDATTR_MAGIC));

glibc OTOH doesn't care (see nptl/pthread_cond_init.c).



   Petar Bogdanovic

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.