[commit: ghc] ghc-8.0: rts: Disable -hb with multiple capabilities (c51caaf)

git at git.haskell.org git at git.haskell.org
Thu Sep 15 17:50:33 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/c51caafae7669d4246f4efd3d1a6858020780e02/ghc

>---------------------------------------------------------------

commit c51caafae7669d4246f4efd3d1a6858020780e02
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Mon Sep 12 08:44:24 2016 -0400

    rts: Disable -hb with multiple capabilities
    
    Biographical profiling is not thread-safe as documented in #12019. Throw
    an error when it is used in this way.
    
    Test Plan: Validate
    
    Reviewers: simonmar, austin, erikd
    
    Reviewed By: erikd
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2516
    
    GHC Trac Issues: #12019
    
    (cherry picked from commit 6555c6bb8447ed65d5da4bab462ee9da7dc3f97a)


>---------------------------------------------------------------

c51caafae7669d4246f4efd3d1a6858020780e02
 rts/ProfHeap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 1b82b36..29fda5a 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -384,6 +384,13 @@ initHeapProfiling(void)
         errorBelch("cannot mix -hb and -hr");
         stg_exit(EXIT_FAILURE);
     }
+#ifdef THREADED_RTS
+    // See Trac #12019.
+    if (doingLDVProfiling() && RtsFlags.ParFlags.nCapabilities > 1) {
+        errorBelch("-hb cannot be used with multiple capabilities");
+        stg_exit(EXIT_FAILURE);
+    }
+#endif
 #endif
 
     // we only count eras if we're doing LDV profiling.  Otherwise era



More information about the ghc-commits mailing list