summaryrefslogtreecommitdiff
path: root/rts/RtsSymbols.c
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2020-08-31 10:35:56 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-09 08:41:50 -0400
commitfd984d68e5ec4b04bc79395c099434e653eb1060 (patch)
tree9b3e3725cc82fbd8686f3e63ba5a62860afdcd58 /rts/RtsSymbols.c
parenta566c83d4fc3a90b209b33131a2972ea53ec81b2 (diff)
downloadhaskell-fd984d68e5ec4b04bc79395c099434e653eb1060.tar.gz
rts: fix race condition in StgCRun
On windows the stack has to be allocated 4k at a time, otherwise we get a segfault. This is done by using a helper ___chkstk_ms that is provided by libgcc. The Haskell side already knows how to handle this but we need to do the same from STG. Previously we would drop the stack in StgRun but would only make it valid whenever the scheduler loop ran. This approach was fundamentally broken in that it falls apart when you take a signal from the OS. We see it less often because you initially get allocated a 1MB stack block which you have to blow past first. Concretely this means we must always keep the stack valid. Fixes #18601.
Diffstat (limited to 'rts/RtsSymbols.c')
-rw-r--r--rts/RtsSymbols.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rts/RtsSymbols.c b/rts/RtsSymbols.c
index 8d8bd1115f..3a2e37fd63 100644
--- a/rts/RtsSymbols.c
+++ b/rts/RtsSymbols.c
@@ -135,7 +135,7 @@
SymI_HasProto(rts_InstallConsoleEvent) \
SymI_HasProto(rts_ConsoleHandlerDone) \
SymI_HasProto(atexit) \
- RTS_WIN32_ONLY(SymI_NeedsProto(__chkstk_ms)) \
+ RTS_WIN32_ONLY(SymI_NeedsProto(___chkstk_ms)) \
RTS_WIN64_ONLY(SymI_NeedsProto(___chkstk_ms)) \
RTS_WIN32_ONLY(SymI_HasProto(_imp___environ)) \
RTS_WIN64_ONLY(SymI_HasProto(__imp__environ)) \