RTS/IOManager: fix trac issue #9722.
AbandonedPublic

Authored by AndreasVoellmy on Mar 9 2015, 3:09 PM.

Details

Summary

Whenever the RTS has been inactive for idleGCDelayTime, the idle timer
fires and calls wakeUpRts(), which in turn calls ioManagerWakeup(),
which in turn writes a byte (or a few) to a file descriptor (stored in
the io_manager_wakeup_fd variable) registered by the TimerManager and
on which the TimerManager will wait. (Note that the write will only
occur if the file descriptor is non-negative.) When the RTS shuts
down, it shuts down the TimerManager, and in this process the file
descriptor stored in io_manager_wakeup_fd is closed. In the error
case, the idle timer fires after the close of the file occurs, and
then the write() call in ioManagerWakeup() fails and the
aforementioned error message gets printed.

This patch solves the problem by (1) having the TimerManager (via
Control) write -1 to io_manager_wakeup_fd just before closing the file
descriptor written in io_manager_wakeup_fd, and (2) having
ioManagerWakeup() ignore an error returned by write() in the case that
the write returned -1 and the io_manager_wakeup_fd is -1.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Branch
fix-trac-9722
Lint
Lint OK
SeverityLocationCodeMessage
Auto-Fixlibraries/base/GHC/Event/Control.hs:117TXT6Trailing Whitespace
Auto-Fixlibraries/base/GHC/Event/Control.hs:124TXT6Trailing Whitespace
Auto-Fixrts/posix/Signals.c:164TXT6Trailing Whitespace
Auto-Fixrts/posix/Signals.c:165TXT6Trailing Whitespace
Auto-Fixrts/posix/Signals.c:166TXT6Trailing Whitespace
Unit
No Unit Test Coverage
Build Status
Buildable 3334
Build 3361: GHC Patch Validation (amd64/Linux)
AndreasVoellmy retitled this revision from to RTS/IOManager: fix trac issue #9722..
AndreasVoellmy updated this object.
AndreasVoellmy edited the test plan for this revision. (Show Details)
AndreasVoellmy added reviewers: austin, simonmar, thomie.
AndreasVoellmy abandoned this revision.Mar 9 2015, 3:12 PM

This is a duplicate. Please disregard this. The real one is D722.