Opened 11 years ago

Closed 10 years ago

Last modified 8 years ago

#804 closed bug (fixed)

Signal handlers always installed, evem in a DLL

Reported by: guest Owned by: igloo
Priority: normal Milestone: 6.6.1
Component: Compiler Version: 6.4.2
Keywords: Cc: lennart@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Even when building a DLL the GHC runtime system will install signal handlers for SIGINT, etc. This done in RtsStartup.c by calling initUserSignals() and initDefaultHandlers(). This is all good when running a standalone program, but very dubious if generating a DLL. For a DLL it's likely that the main program will handle signals, and the GHC-RTS should keep its greedy little paws away from the signals. :) A flag to control this would be appreciated.

-- Lennart

Change History (10)

comment:1 Changed 11 years ago by simonmar

Milestone: 6.6

comment:2 Changed 11 years ago by simonpj

We agree a flag is reasonable. Now all we need is to implement it.

comment:3 Changed 11 years ago by simonpj

Cc: lennart@… added

Reason that installing signal handlers is bad: if the events happen after the DLL has been unloaded it will dispatch into non-loaded code. This is, obviously, bad.

Another solution would be to uninstall them when the DLL is unloaded, but not installing them in the first place is probably the right thing.

cf dup #747

comment:4 Changed 11 years ago by igloo


comment:5 Changed 10 years ago by simonmar

difficulty: UnknownEasy (1 hr)

comment:6 Changed 10 years ago by igloo

Owner: set to igloo

comment:7 Changed 10 years ago by igloo

Resolution: fixed
Status: newclosed

I've added a --install-signal-handlers=<yes|no> RTS flag to the 6.6 branch and HEAD.

comment:8 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:9 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:10 Changed 8 years ago by simonmar

difficulty: Easy (1 hr)Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.