Yahoo Groups archive

Milter-greylist

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

Message

Re: [milter-greylist] Milter-greylist crashes on DragonFly-2.8

2011-01-30 by manu@netbsd.org

Francois Tigeot <ftigeot@...> wrote:

> 673054832: calling dumper_start() from main, line 1711
> 673054832: calling dumper() from dumper_start, line 116
> 673055056: conf_retain called from dumper, line 134
> conf.c:351 BUG: conf_retain called twice?

But there is a mystery here: we do not see two conf_retain() calls.  I suggest
you log pthread_self() on conf_retain() entering.

I wonder if the problem could not be that Thread Speficfic Storage get
inherited (AFAIK it shoud not). Could you build and run this?

/*  cc -Wall -Werror -ansi -lpthread -o tss tss.c */
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <err.h>
#include <sysexits.h>

pthread_key_t key;

void *
child(arg)
        void *arg;
{
        void *tss;

        printf("child (%d) starts, key = %p\n", 
               (int)pthread_self(), (void *)key);

        if ((tss = pthread_getspecific(key)) == NULL)
                errx(EX_OSERR, "pthread_getspecific() failed in child");
        
        printf("child (%d) TSS key %p readen as %p\n", 
               (int)pthread_self(), (void *)key, tss);
                
        sleep(2);

        printf("child (%d) exit\n", (int)pthread_self());

        return NULL;
}

int
main(void) {
        char test[] = "foo";
        pthread_t tid;
        void *tss;

        if (pthread_key_create(&key, NULL) != 0)
                err(EX_OSERR, "pthread_key_create() failed");

        if (pthread_setspecific(key, test) != 0)
                err(EX_OSERR, "pthread_setspecific() failed");
        
        printf("parent (%d) TSS key %p set to %p\n", 
               (int)pthread_self(), (void *)key, test);
                
        if (pthread_create(&tid, NULL, child, NULL) != 0)
                err(EX_OSERR, "pthread_create() failed");

        if ((tss = pthread_getspecific(key)) == NULL)
                errx(EX_OSERR, "pthread_getspecific() failed in parent");
        
        printf("parent (%d) TSS key %p readen as %p\n", 
               (int)pthread_self(), (void *)key, tss);
                
        sleep(3);

        printf("parent (%d) exit\n", (int)pthread_self());

        return 0;
}


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

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.