System.Posix.Resource.setResourceLimit gives "setResourceLimit: invalid argument (Invalid argument)"

Bug #270601 reported by James Westby
4
Affects Status Importance Assigned to Milestone
geordi (Ubuntu)
Fix Released
Undecided
Unassigned
ghc6 (Debian)
Fix Released
Unknown
ghc6 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: ghc6

Hi,

I am importing this RC bug from Debian so that you can consider
it for Intrepid.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491909

Package: ghc6
Version: 6.8.2-5
Severity: important

Just importing this bug from upstream:

    # http://hackage.haskell.org/trac/ghc/ticket/2038

    import System.Exit (exitWith, ExitCode(ExitSuccess))
    import System.IO (putStrLn)
    import System.Posix.Resource

    rlimit = ResourceLimit 3

    f = do
        putStrLn "whoooooo"
        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

   Returns:

     $ strace -etrace=setrlimit ./m
     setrlimit(RLIMIT_CPU, {rlim_cur=3, rlim_max=0}) = -1 EINVAL (Invalid
                                                                   argument)
     m: setResourceLimit: invalid argument (Invalid argument)

.. so that I can request that the patch be applied to ghc6 for Lenny. As
Eelis mentions on the haskell.org BR, this breaks geordi on x86-32.

It has been fixed on Debian by backporting the changes.

Thanks,

James

Changed in ghc6:
status: Unknown → Fix Released
Revision history for this message
Iain Lane (laney) wrote :

Thank you James. I'll look into this.

Changed in ghc6:
assignee: nobody → laney
status: New → In Progress
Revision history for this message
Iain Lane (laney) wrote :

This debdiff applies to the current Ubuntu version and will merge it with the new Debian revision, which has the fix. As far as I can tell, this issue is resolved with the new package. I guess we must rebuild geordi too?

Changed in ghc6:
assignee: laney → nobody
status: In Progress → Confirmed
Revision history for this message
StefanPotyra (sistpoty) wrote :

Hi,

yes, geordi will need a rebuild as well.

However I've been thinking about bug #263773, maybe it might make sense to only do one upload fixing both. I'll leave a comment on that bug.

Cheers,
    Stefan.

Revision history for this message
Iain Lane (laney) wrote :

Well I think that given that the other fix is potentially (probably) rather dangerous, it makes sense to do them in separate uploads, for ease of reverting if nothing else. Also there's the fact that it's not at all clear if we even want to do anything for bug #263773 yet, whereas we can close this one out now and forget about it.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ghc6 - 6.8.2-6ubuntu1

---------------
ghc6 (6.8.2-6ubuntu1) intrepid; urgency=low

  * Merge from Debian unstable (LP: #270601), remaining changes:
    + make lpia similar to i386 in debian/rules
    + add lpia to debian/ghc6_vars via debian/rules
    + add manpage for runghc

ghc6 (6.8.2-6) unstable; urgency=medium

  * New maintainer.
  * Made the perl script driver/split/ghc-split not use the obsolete $*
    var (Closes: #489157)
  * Copied libraries/unix/System/Posix/Resource.hsc and
    libraries/base/include/HsBase.h from 6.8.3 to fix issues with
    setResourceLimit. (Closes: #491909)

 -- Iain Lane <email address hidden> Mon, 15 Sep 2008 20:26:40 +0100

Changed in ghc6:
status: Confirmed → Fix Released
Revision history for this message
Iain Lane (laney) wrote :
Changed in geordi:
status: New → Confirmed
Revision history for this message
James Westby (james-w) wrote :

Uploaded, thank you.

James

Changed in geordi:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package geordi - 0:20080509T0027-1build1

---------------
geordi (0:20080509T0027-1build1) intrepid; urgency=low

  * Rebuild to pick up GHC setResourceLimit fix (LP: #270601)

 -- Iain Lane <email address hidden> Mon, 29 Sep 2008 11:49:18 +0100

Changed in geordi:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.