From 47936fa626f195b057de16b35c0e6ca40666fc62 Mon Sep 17 00:00:00 2001 From: "simonmar@microsoft.com" Date: Tue, 6 Jun 2006 08:58:05 +0000 Subject: [PATCH] markSignalHandlers(): implementation was unnecessary, and had a bug There's no need to mark the signal handler here, because it is stored in a StablePtr and hence is a root anyway. Furthermore, the call to evac() was passing the address of a local variable, which turned out to be harmless for copying GC, but fatal for compacting GC: compacting GC assumes that the addresses of the roots are the same each time. Fixes: possibly #783, possibly #776, definitely #787 --- rts/win32/ConsoleHandler.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rts/win32/ConsoleHandler.c b/rts/win32/ConsoleHandler.c index d7096db..cc0365b 100644 --- a/rts/win32/ConsoleHandler.c +++ b/rts/win32/ConsoleHandler.c @@ -180,10 +180,8 @@ void startSignalHandlers(Capability *cap) */ void markSignalHandlers (evac_fn evac) { - if (console_handler >= 0) { - StgPtr p = deRefStablePtr((StgStablePtr)console_handler); - evac((StgClosure**)(void *)&p); - } + // nothing to mark; the console handler is a StablePtr which is + // already treated as a root by the GC. } -- 1.7.10.4