Current-Users archive

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

Re: rbtree problems in libpthread



christos%astron.com@localhost said:
> Do you have a regression test? 

Here is a program which exhibits the bug for me.
Perhaps une could be a bit more creative finding
malloc() sizes -- the purpose is to stir the address
space so that the threads are not allocated
with equal distances. The stack size setting has
probably some influence too. Mine is default afaict.
(The application where this was a fatal bug - the
"totem" media player with some plugins - had
only 9 threads running.)

Could someone test this on the 5.0 branch?

best regards
Matthias





-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------
#include <err.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

static void *
f(void *arg)
{

        sleep(1000);
        return 0;
}

#define NUM 20
int
main(int argc, char *argv[])
{
        pthread_t thr[NUM];
        int i, res;
        char nambuf[20];

        for (i = 0; i < NUM; i++) {
                res = pthread_create(&thr[i], 0, f, 0);
                if (res)
                        err(1, "pthread_create");
                malloc(100000000 * (i + 1));
        }

        for (i = 0; i < NUM; i++) {
                res = pthread_getname_np(thr[i], nambuf, sizeof(nambuf));
                if (res)
                        printf("getname(%d): %s\n", i, strerror(res));
        }

        return 0;
}


Home | Main Index | Thread Index | Old Index