[Openmp-commits] [openmp] r287560 - Merging r287551:

Jonathan Peyton via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 21 10:47:18 PST 2016


Author: jlpeyton
Date: Mon Nov 21 12:47:18 2016
New Revision: 287560

URL: http://llvm.org/viewvc/llvm-project?rev=287560&view=rev
Log:
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

------------------------------------------------------------------------

Modified:
    openmp/branches/release_39/   (props changed)
    openmp/branches/release_39/runtime/src/kmp_runtime.c

Propchange: openmp/branches/release_39/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 21 12:47:18 2016
@@ -1 +1 @@
-/openmp/trunk:278036,278332,280138,285283
+/openmp/trunk:278036,278332,280138,285283,287551

Modified: openmp/branches/release_39/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/branches/release_39/runtime/src/kmp_runtime.c?rev=287560&r1=287559&r2=287560&view=diff
==============================================================================
--- openmp/branches/release_39/runtime/src/kmp_runtime.c (original)
+++ openmp/branches/release_39/runtime/src/kmp_runtime.c Mon Nov 21 12:47:18 2016
@@ -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 );




More information about the Openmp-commits mailing list