diff mbox

[hsa,merge,02/10] Modifications to libgomp proper

Message ID 20160120144759.GB49431@msticlxl57.ims.intel.com
State New
Headers show

Commit Message

Ilya Verbin Jan. 20, 2016, 2:47 p.m. UTC
On Wed, Jan 13, 2016 at 18:39:27 +0100, Martin Jambor wrote:
> 	* task.c (GOMP_PLUGIN_target_task_completion): Free
> 	firstprivate_copies.

Also this change caused 3 fails on intelmicemul:

FAIL: libgomp.c/target-32.c execution test
FAIL: libgomp.c/target-33.c execution test
FAIL: libgomp.c/target-34.c execution test

Because ttask->firstprivate_copies is uninitialized for !GOMP_OFFLOAD_CAP_SHARED_MEM.

(gdb) p ttask->firstprivate_copies
$1 = (void *) 0x1
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
0x0000003b076800dc in free () from /lib64/libc.so.6
(gdb) bt
#0  0x0000003b076800dc in free () from /lib64/libc.so.6
#1  0x00007ffff7dda871 in GOMP_PLUGIN_target_task_completion (data=0x624ac0) at gcc/libgomp/task.c:585
[...]


OK for trunk?

libgomp/
	* task.c (gomp_create_target_task): Set firstprivate_copies to NULL.


  -- Ilya

Comments

Jakub Jelinek Jan. 20, 2016, 2:55 p.m. UTC | #1
On Wed, Jan 20, 2016 at 05:47:59PM +0300, Ilya Verbin wrote:
> OK for trunk?
> 
> libgomp/
> 	* task.c (gomp_create_target_task): Set firstprivate_copies to NULL.
> 
> diff --git a/libgomp/task.c b/libgomp/task.c
> index 0f45c44..38d4e9b 100644
> --- a/libgomp/task.c
> +++ b/libgomp/task.c
> @@ -683,6 +683,7 @@ gomp_create_target_task (struct gomp_device_descr *devicep,
>    ttask->state = state;
>    ttask->task = task;
>    ttask->team = team;
> +  ttask->firstprivate_copies = NULL;
>    task->fn = NULL;
>    task->fn_data = ttask;
>    task->final_task = 0;

Ok (though, eventually I'd prefer if free (ttask->firstprivate_copies) is
only performed for the shared mem async tasks and not other one.

	Jakub
diff mbox

Patch

diff --git a/libgomp/task.c b/libgomp/task.c
index 0f45c44..38d4e9b 100644
--- a/libgomp/task.c
+++ b/libgomp/task.c
@@ -683,6 +683,7 @@  gomp_create_target_task (struct gomp_device_descr *devicep,
   ttask->state = state;
   ttask->task = task;
   ttask->team = team;
+  ttask->firstprivate_copies = NULL;
   task->fn = NULL;
   task->fn_data = ttask;
   task->final_task = 0;