[GHC] #7325: threadDelay mistreats minBound and maxBound in some configurations

GHC ghc-devs at haskell.org
Tue Aug 5 21:19:01 UTC 2014


#7325: threadDelay mistreats minBound and maxBound in some configurations
-------------------------------------+-------------------------------------
              Reporter:  joeyadams   |            Owner:
                  Type:  bug         |           Status:  new
              Priority:  high        |        Milestone:  7.10.1
             Component:  Runtime     |          Version:  7.6.1
  System                             |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:  Incorrect   |  Related Tickets:
  result at runtime                  |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by kim):

 * cc: simonmar (added)


Comment:

 On OSX 10.0 and ghc 7.8.x I'm seeing the following behaviour:

 * {{{ threadDelay minBound }}} returns immediately (with or without {{{
 -threaded }}})
 * {{{ threadDelay maxBound }}} without {{{ -threaded }}}, the program
 terminates with:
 {{{
 maxbound: select: Invalid Argument
 }}}
   (similar to #6019)

 * {{{ threadDelay maxBound }}} ''with'' {{{ -threaded }}} prints on
 stderr:
 {{{
 maxbound: c_poll: invalid argument (Invalid argument)
 maxbound: ioManagerWakeup: write: Bad file descriptor
 }}}
   and then appears to hang. When running it on a different thread, which
 is then killed from the main thread after some time, the following line is
 printed in after the above:
 {{{
 maxbound: ioManagerWakeup: write: Bad file descriptor
 }}}
   The program makes no progress after the thread got killed. Curiously, on
 another machine with same OS and ghc versions but more cores, the program
 crashes instead of hangs.

    (similar to #5544)
 * as described by the reporter, for some values < {{{ maxBound }}} but in
 the same order of magnitude, the errors disappear, but for others they
 don't.


 Please do let me know if providing {{{ dtruss }}} output would be helpful.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7325#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list