Opened 4 years ago

Closed 4 years ago

#24297 closed defect (fixed)

No RLIMIT_RSS on Cygwin

Reported by: embray Owned by:
Priority: blocker Milestone: sage-8.1
Component: porting: Cygwin Keywords:
Cc: charpent Merged in:
Authors: Erik Bray Reviewers: Jeroen Demeyer
Report Upstream: N/A Work issues:
Branch: 50c280e (Commits, GitHub, GitLab) Commit: 50c280e4bf566eb0fc19629526a9fe0911baaf92
Dependencies: Stopgaps:

Status badges

Description

The following fails on Cygwin:

sage -t src/sage/matrix/matrix_mod2_dense.pyx
**********************************************************************
File "src/sage/matrix/matrix_mod2_dense.pyx", line 183, in
sage.matrix.matrix_mod2_dense.Matrix_mod2_dense.__cinit__
Failed example:
    if resource.RLIMIT_AS == resource.RLIMIT_RSS:
        # Skip this test if RLIMIT_AS is not properly
        # supported like on OS X, see Trac #24190
        raise RuntimeError("matrix allocation failed")
    else:  # Real test
        MatrixSpace(GF(2), 2^30)(1)
Expected:
    Traceback (most recent call last):
    ...
    RuntimeError: matrix allocation failed
Got:
    <BLANKLINE>
    Traceback (most recent call last):
      File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 515, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/doctest/forker.py",
line 885, in compile_and_execute
        exec(compiled, globs)
      File "<doctest
sage.matrix.matrix_mod2_dense.Matrix_mod2_dense.__cinit__[4]>", line
1, in <module>
        if resource.RLIMIT_AS == resource.RLIMIT_RSS:
    AttributeError: 'module' object has no attribute 'RLIMIT_RSS'
**********************************************************************
1 item had failures:
   1 of   8 in sage.matrix.matrix_mod2_dense.Matrix_mod2_dense.__cinit__
    [337 tests, 1 failure, 3.32 s]
----------------------------------------------------------------------
sage -t src/sage/matrix/matrix_mod2_dense.pyx  # 1 doctest failed

The resources module (and the system header from which it's populated) does not implement RLIMIT_RSS on that platform. In fact RLIMIT_RSS is a non-POSIX extension and should probably be checked for in general.

Change History (4)

comment:1 Changed 4 years ago by embray

  • Authors set to Erik Bray
  • Branch set to u/embray/cygwin/ticket-24297
  • Commit set to 50c280e4bf566eb0fc19629526a9fe0911baaf92
  • Status changed from new to needs_review

New commits:

50c280eRLIMIT_RSS may not be defined at all on some platforms

comment:2 Changed 4 years ago by charpent

  • Cc charpent added

comment:3 Changed 4 years ago by jdemeyer

  • Reviewers set to Jeroen Demeyer
  • Status changed from needs_review to positive_review

Indeed. The only purpose of this test is to check whether RLIMIT_AS is really an alias of RLIMIT_RSS. If RLIMIT_RSS does not exist, it certainly isn't.

comment:4 Changed 4 years ago by vbraun

  • Branch changed from u/embray/cygwin/ticket-24297 to 50c280e4bf566eb0fc19629526a9fe0911baaf92
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.