FS#9419 - GHC's setResourceLimits fails on archlinux
Attached to Project:
Arch Linux
Opened by Johannes Schaub (litb) - Thursday, 31 January 2008, 21:26 GMT
Last edited by Vesa Kaihlavirta (vegai) - Wednesday, 07 January 2009, 10:06 GMT
Opened by Johannes Schaub (litb) - Thursday, 31 January 2008, 21:26 GMT
Last edited by Vesa Kaihlavirta (vegai) - Wednesday, 07 January 2009, 10:06 GMT
|
Details
Description:
GHC does execute calls to setResourceLimits correctly on Archlinux , but does on other distributions. see the following samples: -- snip import System.Posix kibi, mebi :: Integral a => a kibi = 1024 mebi = kibi * kibi main = do setResourceLimit ResourceOpenFiles $ ResourceLimits (ResourceLimit 60) (ResourceLimit 60) -- snap -- output snip: a.out: setResourceLimit: invalid argument (Invalid argument) -- snap see this C program and note how it doesn't fail: /* snip */ #include <sys/time.h> #include <sys/resource.h> #include <stdio.h> #include <stdlib.h> int main() { struct rlimit rl = { 60, 60 }; if( setrlimit (RLIMIT_NOFILE, &rl) == -1) { perror ("Error setting limit"); exit (-1); } return 0; } /* snap */ Additional info: * package version(s) i am using ghc 6.8.2 Steps to reproduce: copy the code above (the first snipped) into a file pwns.hs and do: # snip runhaskell pwns.hs # snap see how it fails Have a nice day, greez litb |
This task depends upon
Closed by Vesa Kaihlavirta (vegai)
Wednesday, 07 January 2009, 10:06 GMT
Reason for closing: Upstream
Wednesday, 07 January 2009, 10:06 GMT
Reason for closing: Upstream
import System.Posix
main = do setResourceLimit ResourceOpenFiles $ ResourceLimits (ResourceLimit 60) (ResourceLimit 60)
Seems to be a known upstream bug, to be fixed in the next major release: http://hackage.haskell.org/trac/ghc/ticket/2038