Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) ---+ Reporter: slyfox | Owner: igloo Type: bug| Status: closed Priority: high | Milestone: 6.8.3 Component: libraries/unix |Version: 6.8.2 Severity: major | Resolution: fixed Keywords: regression, ffi, unix | Difficulty: Unknown Testcase: resourceLimit | Architecture: x86 Os: Linux | ---+ Changes (by igloo): * testcase: = resourceLimit * status: new = closed * resolution: = fixed Comment: I've fixed this for `getrlimit`, `setrlimit` and `mkstemp`; I didn't find any other problematic cases. The fix is in both the HEAD and the 6.8 branch. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) ---+ Reporter: slyfox | Owner: igloo Type: bug| Status: new Priority: high | Milestone: 6.8.3 Component: libraries/unix |Version: 6.8.2 Severity: major | Resolution: Keywords: regression, ffi, unix | Difficulty: Unknown Testcase: | Architecture: x86 Os: Linux | ---+ Changes (by Eelis-): * cc: [EMAIL PROTECTED] (added) Comment: As requested in the [http://www.haskell.org/pipermail/glasgow-haskell- users/2008-March/014467.html Release Plans] message, I'm hereby expressing that this bug is very important to me. It pretty much makes [http://www.eelis.net/geordi/ geordi] completely unusable on x86-32. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) ---+ Reporter: slyfox | Owner: igloo Type: bug| Status: new Priority: high | Milestone: 6.8.3 Component: libraries/unix |Version: 6.8.2 Severity: major | Resolution: Keywords: regression, ffi, unix | Difficulty: Unknown Testcase: | Architecture: x86 Os: Linux | ---+ Changes (by igloo): * owner: = igloo -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) ---+ Reporter: slyfox | Owner: Type: bug| Status: new Priority: high | Milestone: 6.8.3 Component: libraries/unix |Version: 6.8.2 Severity: major | Resolution: Keywords: regression, ffi, unix | Difficulty: Unknown Testcase: | Architecture: x86 Os: Linux | ---+ Comment (by igloo): See also #2093 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) ---+ Reporter: slyfox | Owner: Type: bug| Status: new Priority: high | Milestone: 6.8.3 Component: libraries/unix |Version: 6.8.2 Severity: major | Resolution: Keywords: regression, ffi, unix | Difficulty: Unknown Testcase: | Architecture: x86 Os: Linux | ---+ Comment (by slyfox): Code like this would look like: {{{ -- strlimit{,64} is taken from C defines foreign import ccall unsafe #hsc2-mega-macro setrlimit c_setrlimit :: CInt - Ptr RLimit - IO CInt }}} Simply grepping by /usr/include got some of funs: {{{ ./unistd.h:# define lseek lseek64 ./unistd.h:# define pread pread64 ./unistd.h:# define pwrite pwrite64 ./unistd.h:# define truncate truncate64 ./unistd.h:# define ftruncate ftruncate64 ./unistd.h:# define lockf lockf64 ./glob.h:# define glob glob64 ./glob.h:# define globfree globfree64 ./aio.h:# define aio_read aio_read64 ./aio.h:# define aio_write aio_write64 ./aio.h:# define lio_listio lio_listio64 ./aio.h:# define aio_error aio_error64 ./aio.h:# define aio_return aio_return64 ./aio.h:# define aio_cancel aio_cancel64 ./aio.h:# define aio_suspend aio_suspend64 ./aio.h:# define aio_fsync aio_fsync64 ./fcntl.h:# define open open64 ./fcntl.h:# define lockf lockf64 ./fcntl.h:# define posix_fadvise posix_fadvise64 ./fcntl.h:# define posix_fallocate posix_fallocate64 ./sys/mman.h:# define mmap mmap64 ./sys/statvfs.h:# define statvfs statvfs64 ./sys/statvfs.h:# define fstatvfs fstatvfs64 ./sys/statfs.h:# define statfs statfs64 ./sys/statfs.h:# define fstatfs fstatfs64 ./dirent.h:# define readdir readdir64 ./dirent.h:# define readdir_r readdir64_r ./dirent.h:# define scandir scandir64 ./stdlib.h:# define mkstemp mkstemp64 }}} Is there/can be implemented such functionality hsc2hs? Thanks! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) ---+ Reporter: slyfox | Owner: Type: bug| Status: new Priority: high | Milestone: 6.8.3 Component: Compiler |Version: 6.8.2 Severity: major | Resolution: Keywords: regression, ffi, unix | Difficulty: Unknown Testcase: | Architecture: x86 Os: Linux | ---+ Changes (by igloo): * priority: normal = high * difficulty: = Unknown * milestone: = 6.8.3 Comment: Thanks for the report. I can reproduce this on x86/Linux, but not amd64/Linux. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) --+- Reporter: slyfox |Owner: Type: bug| Status: new Priority: normal |Milestone: Component: Compiler | Version: 6.8.2 Severity: major | Resolution: Keywords: regression, ffi, unix | Testcase: Architecture: x86| Os: Linux --+- Changes (by slyfox): * version: 6.8.1 = 6.8.2 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
[GHC] #2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument)
#2038: System.Posix.Resource.setResourceLimit gives setResourceLimit: invalid argument (Invalid argument) --+- Reporter: slyfox | Owner: Type: bug| Status: new Priority: normal | Component: Compiler Version: 6.8.1 |Severity: major Keywords: regression, ffi, unix |Testcase: Architecture: x86| Os: Linux --+- GHC-6.6.1 worked correctly in setResourceLimit, GHC-6.8.2 gives me an error: {{{ $ ./m m: setResourceLimit: invalid argument (Invalid argument) }}} A little exploration (strange rlim_max value). Seems to be a bug in haskell - C type conversion. {{{ $ strace -etrace=setrlimit ./m setrlimit(RLIMIT_CPU, {rlim_cur=3, rlim_max=0}) = -1 EINVAL (Invalid argument) m: setResourceLimit: invalid argument (Invalid argument) }}} Code source: {{{ import System.Exit (exitWith, ExitCode(ExitSuccess)) import System.IO(putStrLn) import System.Posix.Resource rlimit = ResourceLimit 3 f = do putStrLn whoo f main = do setResourceLimit ResourceCPUTime (ResourceLimits rlimit rlimit) r - getResourceLimit ResourceCPUTime let (ResourceLimit s) = softLimit r let (ResourceLimit h) = hardLimit r putStrLn $ show s putStrLn $ show h f exitWith ExitSuccess }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/2038 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs