Bug 51376 - libgomp taskwait failure
Summary: libgomp taskwait failure
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgomp (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Alan Modra
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords: openmp, patch
Depends on:
Blocks:
 
Reported: 2011-12-01 09:22 UTC by Alan Modra
Modified: 2013-02-05 13:40 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2011-12-01 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Modra 2011-12-01 09:22:20 UTC
libgomp.c++/task-6 occasionally aborts on power7 with symptoms that indicate "#pragma omp taskwait" is failing to wait for a child thread.  On replacing the abort() with an asm illegal insn to get a core with the register state at the failure point, you see "a" or "n" has been loaded to regs with their original value.  By the time the core dump is written, the memory value for "a" and "n" is correct.
Comment 1 Alan Modra 2011-12-01 09:23:38 UTC
Investigating possible fix
Comment 2 Alan Modra 2011-12-09 02:21:46 UTC
Author: amodra
Date: Fri Dec  9 02:21:43 2011
New Revision: 182151

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182151
Log:
	PR libgomp/51376
	* task.c (GOMP_taskwait): Don't access task->children outside of
	task_lock mutex region.
	(GOMP_task): Likewise.


Modified:
    trunk/libgomp/ChangeLog
    trunk/libgomp/task.c
Comment 3 Alan Modra 2011-12-09 05:20:25 UTC
Fixed
Comment 4 Alan Modra 2013-01-22 11:41:56 UTC
Author: amodra
Date: Tue Jan 22 11:41:53 2013
New Revision: 195370

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195370
Log:
	PR libgomp/51376
	PR libgomp/56073
	* task.c (GOMP_task): Revert 2011-12-09 change.
	(GOMP_taskwait): Likewise.  Instead use atomic load with acquire
	barrier to read task->children..
	(gomp_barrier_handle_tasks): ..and matching atomic store with
	release barrier here when setting parent->children to NULL.


Modified:
    trunk/libgomp/ChangeLog
    trunk/libgomp/task.c
Comment 5 Alan Modra 2013-01-24 21:52:03 UTC
Author: amodra
Date: Thu Jan 24 21:51:58 2013
New Revision: 195444

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195444
Log:
	PR libgomp/51376
	PR libgomp/56073
	* task.c (GOMP_task): Revert 2011-12-09 change.
	(GOMP_taskwait): Likewise.  Instead use atomic load with acquire
	barrier to read task->children..
	(gomp_barrier_handle_tasks): ..and matching atomic store with
	release barrier here when setting parent->children to NULL.


Added:
    branches/ibm/gcc-4_7-branch/libgomp/ChangeLog.ibm
Modified:
    branches/ibm/gcc-4_7-branch/libgomp/task.c
Comment 6 Alan Modra 2013-02-05 13:40:35 UTC
Author: amodra
Date: Tue Feb  5 13:40:25 2013
New Revision: 195756

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195756
Log:
	PR libgomp/51376
	PR libgomp/56073
	* task.c (GOMP_task): Revert 2011-12-09 change.
	(GOMP_taskwait): Likewise.  Instead use atomic load with acquire
	barrier to read task->children..
	(gomp_barrier_handle_tasks): ..and matching atomic store with
	release barrier here when setting parent->children to NULL.


Modified:
    branches/gcc-4_7-branch/libgomp/ChangeLog
    branches/gcc-4_7-branch/libgomp/task.c