Opened 8 years ago

Closed 7 years ago

Last modified 4 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: Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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 8 years ago by simonmar

  • Milestone set to 6.6

comment:2 Changed 8 years ago by simonpj

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

comment:3 Changed 8 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 8 years ago by igloo

  • Milestone changed from 6.6 to 6.6.1

comment:5 Changed 7 years ago by simonmar

  • Difficulty changed from Unknown to Easy (1 hr)

comment:6 Changed 7 years ago by igloo

  • Owner set to igloo

comment:7 Changed 7 years ago by igloo

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:8 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:9 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:10 Changed 4 years ago by simonmar

  • Difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.