[GHC] #7714: The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid

#7714: The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid -----------------------------+---------------------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- poll() is used in GHC/Event/Poll.hsc. The type of its second argument is nfds_t. nfds_t is defined unsigned long on Linux and unsigned int on Mac/FreeBSD. FFI in Poll.hsc uses CULong instead of (#type nfds_t). So, this may cause a problem on Mac/FreeBSD. Actually, a web server compiled by GHC head on FreeBSD sometime causes the following error: {{{ mighty-head: c_poll: invalid argument (Invalid argument) mighty-head: sendWakeup: invalid argument (Bad file descriptor) mighty-head: sendWakeup: invalid argument (Bad file descriptor) mighty-head: sendWakeup: invalid argument (Bad file descriptor) }}} poll() on FreeBSD returns EINVAL when the specified time limit is negative. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7714 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7714: The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid -----------------------------+---------------------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by kazu-yamamoto): I'm not 100% sure but I don't see the bug above after applying this patch. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7714#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7714: The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid -----------------------------+---------------------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by kazu-yamamoto): I confirmed that this patch works well both on FreeBSD and Linux. "validate" passed on Linux. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7714#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7714: The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid -----------------------------+---------------------------------------------- Reporter: kazu-yamamoto | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Comment(by kazu-yamamoto): Please merge this patch. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7714#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7714: The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid
-----------------------------+----------------------------------------------
Reporter: kazu-yamamoto | Owner:
Type: bug | Status: merge
Priority: normal | Component: Compiler
Version: 7.7 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Blockedby:
Blocking: | Related:
-----------------------------+----------------------------------------------
Changes (by ezyang):
* status: new => merge
Comment:
Applied.
{{{
commit 25b44d2e089e3aa030f146e2c52601146c8d126a
Author: Edward Z. Yang

#7714: The type of the second argument of poll() in GHC/Event/Poll.hsc is invalid ---------------------------------+------------------------------------------ Reporter: kazu-yamamoto | Owner: Type: bug | Status: merge Priority: normal | Milestone: 7.6.3 Component: Compiler | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * difficulty: => Unknown * milestone: => 7.6.3 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7714#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC