[Openmp-commits] [PATCH] D26860: Fix for D25504 - segfault because of double free()-ing in task deps shutdown code.

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Fri Nov 18 09:05:00 PST 2016


jlpeyton created this revision.
jlpeyton added reviewers: pawosm01, AndreyChurbanov.
jlpeyton added a subscriber: openmp-commits.
jlpeyton set the repository for this revision to rL LLVM.

Moves the freeing of the implicit task to above the freeing of all fast memory to prevent the double-free issue.

Fixes: https://reviews.llvm.org/D25504


Repository:
  rL LLVM

https://reviews.llvm.org/D26860

Files:
  runtime/src/kmp_runtime.c


Index: runtime/src/kmp_runtime.c
===================================================================
--- runtime/src/kmp_runtime.c
+++ runtime/src/kmp_runtime.c
@@ -5707,6 +5707,8 @@
         --__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 );
@@ -5762,7 +5764,6 @@
     }; // 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 );


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26860.78538.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20161118/9fb4bbbf/attachment.bin>


More information about the Openmp-commits mailing list