Opened 3 years ago

Last modified 19 months ago

#5443 new bug

Errors when shutting down the event manager loop

Reported by: basvandijk Owned by: tibbe
Priority: normal Milestone: 7.6.2
Component: Compiler Version: 7.2.1
Keywords: Cc: johan.tibell@…, bos@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:


As explained in this thread on the GHC list I use the GHC event manager in my usb library. I create my own EventManager and start a thread which runs the event manager loop. When the library is finalized I automatically shutdown the loop. However this causes error messages from the RTS to be printed.

The following program shows the problem in isolation:

import Control.Concurrent
import GHC.Event

main = do
 em <- new
 tid <- forkIO $ loop em
 threadDelay 2000000
 shutdown em  -- Note that 'killThread tid' has the same effect.
 threadDelay 2000000

Make sure to build it with -threaded enabled:

$ ghc -threaded --make eventManagerBug.hs

Running it gives the following errors:

$ ./eventManagerBug
example: ioManagerWakeup: write: Bad file descriptor
example: ioManagerDie: write: Bad file descriptor

Note that these errors are printed in the ioManagerWakeup function in rts/posix/Signals.c.

Change History (2)

comment:1 Changed 2 years ago by igloo

  • Milestone set to 7.6.1
  • Owner set to tibbe

comment:2 Changed 19 months ago by igloo

  • Milestone changed from 7.6.1 to 7.6.2
Note: See TracTickets for help on using tickets.