diff options
author | Austin Seipp <austin@well-typed.com> | 2014-12-15 08:44:32 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-12-15 08:45:09 -0600 |
commit | 7be1eb7d8e3f064e3407795afcebfb76770a3c34 (patch) | |
tree | 6a2d8212c789aea6e08b9eabbc4eca0c6bbed962 | |
parent | 615d03a4cab16d7818cf6f64aaa9032514b2b36e (diff) | |
download | haskell-7be1eb7d8e3f064e3407795afcebfb76770a3c34.tar.gz |
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)
-rw-r--r-- | rts/Prelude.h | 4 | ||||
-rw-r--r-- | rts/RtsStartup.c | 2 | ||||
-rw-r--r-- | rts/package.conf.in | 4 | ||||
-rw-r--r-- | rts/posix/Signals.c | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/rts/Prelude.h b/rts/Prelude.h index 89e80a0a3d..5923da229a 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 15e48a690d..24d50eedd0 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 4c8686f262..a364fd38a0 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 f4a8341c6a..6ebbfd3d86 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)))); } |