[commit: ghc] ghc-7.8: compiler: fix trac issue #9817 (7be1eb7)

git at git.haskell.org git at git.haskell.org
Mon Dec 15 14:55:00 UTC 2014


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

On branch  : ghc-7.8
Link       : http://ghc.haskell.org/trac/ghc/changeset/7be1eb7d8e3f064e3407795afcebfb76770a3c34/ghc

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

commit 7be1eb7d8e3f064e3407795afcebfb76770a3c34
Author: Austin Seipp <austin at well-typed.com>
Date:   Mon Dec 15 08:44:32 2014 -0600

    compiler: fix trac issue #9817
    
    Summary:
    When we call runHandlers, we must pass it a ForeignPtr. To ensure that
    this happens, we introduce a wrapper that receives a plain Ptr and
    converts it into a ForeignPtr. Then we adjust startSignalHandlers in
    rts/posix/Signals.c to call the wrapper instead of calling runHandlers
    directly.
    
    Reviewers: hvr, austin, rwbarton, simonmar
    
    Reviewed By: austin, simonmar
    
    Subscribers: simonmar, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D515
    
    GHC Trac Issues: #9817
    
    (cherry picked from commit 7ca5bb090ff78141fbe275b058a9e35ee496bd58)


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

7be1eb7d8e3f064e3407795afcebfb76770a3c34
 rts/Prelude.h       | 4 ++--
 rts/RtsStartup.c    | 2 +-
 rts/package.conf.in | 4 ++--
 rts/posix/Signals.c | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/rts/Prelude.h b/rts/Prelude.h
index 89e80a0..5923da2 100644
--- a/rts/Prelude.h
+++ b/rts/Prelude.h
@@ -46,7 +46,7 @@ PRELUDE_CLOSURE(base_ControlziExceptionziBase_nestedAtomically_closure);
 PRELUDE_CLOSURE(base_GHCziConcziSync_runSparks_closure);
 PRELUDE_CLOSURE(base_GHCziConcziIO_ensureIOManagerIsRunning_closure);
 PRELUDE_CLOSURE(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure);
-PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlers_closure);
+PRELUDE_CLOSURE(base_GHCziConcziSignal_runHandlersPtr_closure);
 
 PRELUDE_CLOSURE(base_GHCziTopHandler_flushStdHandles_closure);
 
@@ -94,7 +94,7 @@ PRELUDE_INFO(base_GHCziStable_StablePtr_con_info);
 #define runSparks_closure         DLL_IMPORT_DATA_REF(base_GHCziConcziSync_runSparks_closure)
 #define ensureIOManagerIsRunning_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ensureIOManagerIsRunning_closure)
 #define ioManagerCapabilitiesChanged_closure DLL_IMPORT_DATA_REF(base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure)
-#define runHandlers_closure       DLL_IMPORT_DATA_REF(base_GHCziConcziSignal_runHandlers_closure)
+#define runHandlersPtr_closure       DLL_IMPORT_DATA_REF(base_GHCziConcziSignal_runHandlersPtr_closure)
 
 #define flushStdHandles_closure   DLL_IMPORT_DATA_REF(base_GHCziTopHandler_flushStdHandles_closure)
 
diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c
index 15e48a6..24d50ee 100644
--- a/rts/RtsStartup.c
+++ b/rts/RtsStartup.c
@@ -214,7 +214,7 @@ hs_init_ghc(int *argc, char **argv[], RtsConfig rts_config)
     getStablePtr((StgPtr)ensureIOManagerIsRunning_closure);
     getStablePtr((StgPtr)ioManagerCapabilitiesChanged_closure);
 #ifndef mingw32_HOST_OS
-    getStablePtr((StgPtr)runHandlers_closure);
+    getStablePtr((StgPtr)runHandlersPtr_closure);
 #endif
 
     /* initialise the shared Typeable store */
diff --git a/rts/package.conf.in b/rts/package.conf.in
index 4c8686f..a364fd3 100644
--- a/rts/package.conf.in
+++ b/rts/package.conf.in
@@ -106,7 +106,7 @@ ld-options:
          , "-Wl,-u,_base_GHCziConcziIO_ensureIOManagerIsRunning_closure"
          , "-Wl,-u,_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
          , "-Wl,-u,_base_GHCziConcziSync_runSparks_closure"
-         , "-Wl,-u,_base_GHCziConcziSignal_runHandlers_closure"
+         , "-Wl,-u,_base_GHCziConcziSignal_runHandlersPtr_closure"
 #else
            "-Wl,-u,ghczmprim_GHCziTypes_Izh_static_info"
          , "-Wl,-u,ghczmprim_GHCziTypes_Czh_static_info"
@@ -146,7 +146,7 @@ ld-options:
          , "-Wl,-u,base_GHCziConcziIO_ensureIOManagerIsRunning_closure"
          , "-Wl,-u,base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure"
          , "-Wl,-u,base_GHCziConcziSync_runSparks_closure"
-         , "-Wl,-u,base_GHCziConcziSignal_runHandlers_closure"
+         , "-Wl,-u,base_GHCziConcziSignal_runHandlersPtr_closure"
 #endif
 
 /*  Pick up static libraries in preference over dynamic if in earlier search
diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c
index f4a8341..6ebbfd3 100644
--- a/rts/posix/Signals.c
+++ b/rts/posix/Signals.c
@@ -448,7 +448,7 @@ startSignalHandlers(Capability *cap)
 		       RtsFlags.GcFlags.initialStkSize, 
                        rts_apply(cap,
                                  rts_apply(cap,
-                                           &base_GHCziConcziSignal_runHandlers_closure,
+                                           &base_GHCziConcziSignal_runHandlersPtr_closure,
                                            rts_mkPtr(cap, info)),
                                  rts_mkInt(cap, info->si_signo))));
   }



More information about the ghc-commits mailing list