aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2016-11-21 18:47:18 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2016-11-21 18:47:18 +0000
commit43fb3dac59914deee8bf7a79f25f07c388b141fb (patch)
treeccda043050892530bcfe299c4413489c7baaf1bb
parent415817083b7f2abf48775ced15691960fb4b77dc (diff)
downloadllvm-43fb3dac59914deee8bf7a79f25f07c388b141fb.zip
llvm-43fb3dac59914deee8bf7a79f25f07c388b141fb.tar.gz
llvm-43fb3dac59914deee8bf7a79f25f07c388b141fb.tar.bz2
Merging r287551:
------------------------------------------------------------------------ r287551 | jlpeyton | 2016-11-21 10:18:57 -0600 (Mon, 21 Nov 2016) | 8 lines Fix for D25504 - segfault because of double free()-ing in shutdown code. Paul Osmialowski pointed out a double free bug in shutdown code. This patch Moves the freeing of the implicit task to above the freeing of all fast memory to prevent the double-free issue. Differential Revision: https://reviews.llvm.org/D26860 ------------------------------------------------------------------------ llvm-svn: 287560
-rw-r--r--openmp/runtime/src/kmp_runtime.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c
index 77b8c07..663421b 100644
--- a/openmp/runtime/src/kmp_runtime.c
+++ b/openmp/runtime/src/kmp_runtime.c
@@ -5688,6 +5688,8 @@ __kmp_reap_thread(
--__kmp_thread_pool_nth;
}; // if
+ __kmp_free_implicit_task(thread);
+
// Free the fast memory for tasking
#if USE_FAST_MEMORY
__kmp_free_fast_memory( thread );
@@ -5743,7 +5745,6 @@ __kmp_reap_thread(
}; // if
#endif /* KMP_AFFINITY_SUPPORTED */
- __kmp_free_implicit_task(thread);
__kmp_reap_team( thread->th.th_serial_team );
thread->th.th_serial_team = NULL;
__kmp_free( thread );