Re: [Mingw-w64-public] openmp/pthread debug test case

2012-11-23 Thread Antony Riakiotakis
Hmmm, OK, it looks like 'ended' is set in the code after all in pthread_create_wrapper, after the thread function exits. I'll keep investigating this. -- Monitor your physical, virtual and cloud infrastructure from a singl

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-11-23 Thread Antony Riakiotakis
Hi, time to look into this issue again. I built a debug version of winpthreads but as you can understand debugging this is a PITA. Hang seems to happen around line 1539 of src/thread.c of winpthreads. This reads like: if (tv->ended == 0) WaitForSingleObject (tv->h, INFINITE); Trying to fig

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-10-07 Thread Ruben Van Boxem
2012/8/25 Antony Riakiotakis > It is reproducable with just one thread too. This should be the simpler > case: > > #include > #include > #include > > void *do_thread(void *) { > int niterations = 200; > int i; > > #pragma omp parallel for > for (i = 0; i < niter

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-09-26 Thread Antony Riakiotakis
Hi niXman, no it won't cause a link error because the #pragma just gets ignored so essentially there is no parallelism, hence, no hang. It is interesting though that when using -fopenmp, the -lpthread flag is unnecessary. Maybe when using openmp links some other version of pthread somehow? Just fo

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-09-26 Thread niXman
2012/9/12 Antony Riakiotakis: > Hi, any news on this issue? Can I help in some way? Hi Antony, I want to pay your attention to the fact that if I compile the code without using the '-fopenmp' option, then the bug does not occur. Although, far as I remember in this case must occur a link error. Bu

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-09-12 Thread Antony Riakiotakis
Hi, any news on this issue? Can I help in some way? -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discu

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-08-24 Thread Antony Riakiotakis
It is reproducable with just one thread too. This should be the simpler case: #include #include #include void *do_thread(void *) { int niterations = 200; int i; #pragma omp parallel for for (i = 0; i < niterations; i++) { printf (

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-08-24 Thread Antony Riakiotakis
Hi, I think I have figured it out: The issue may be that internally openmp may be allocating thread identifiers that may already be used by pthread so pthread_join somehow ends up waiting for the parent thread to finish, deadlocking itself. Try this: #include #include #include void *do_threa

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-08-24 Thread Antony Riakiotakis
Indeed. I do not have much experience with thread programmng unfortunately. :/ In any case trying to debug this from within blender is quite hard because I can't get a stacktrace. A disassembly shows that the problem occurs within pthread_create_wrapper. Here is a small disassembly around the cras

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-08-24 Thread Kai Tietz
This test program is invalid. Your application tries to create an thread and afterwards immediately terminates (by returning from main). By add the line 'pthread_join (id, NULL);' after creation of the thread, you will see the message "I am a thread!" as expected. Regards, Kai -

Re: [Mingw-w64-public] openmp/pthread debug test case

2012-08-24 Thread Antony Riakiotakis
Just as a note, removing the 'private' openmp directive also crashes. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers

[Mingw-w64-public] openmp/pthread debug test case

2012-08-24 Thread Antony Riakiotakis
Hi, I am looking into openmp-related crashes that we've had into blender. I see that the issue is known ( http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg03982.html ) and that people from this mailing list have requested test files to debug so I am sending a small program that