Bug 548551 - maxima-runtime-sbcl : checks for memory size incorrectly and fails if ulimit -v is used
Summary: maxima-runtime-sbcl : checks for memory size incorrectly and fails if ulimit ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: maxima
Version: 13
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rex Dieter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 568753
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-12-17 19:03 UTC by Josh Cogliati
Modified: 2011-06-27 14:42 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-06-27 14:42:27 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Josh Cogliati 2009-12-17 19:03:46 UTC
Description of problem:
When running maxima reads the physical memory value from /proc/meminfo, and then tries to mmap this amount of memory.   If this memory cannot be allocated, the program then exits.  maxima does not check getrlimit  RLIMIT_DATA.  This means if a data segment ulimit is in place, maxima always fails.  

Version-Release number of selected component (if applicable):
maxima-5.19.2-1.fc12.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1.  Set a ulimit smaller than the size of physical ram
$ ulimit -S -v 1048576
2. Run maxima
$ maxima
mmap: Cannot allocate memory
ensure_space: failed to validate 8589869056 bytes at 0x1000000000
(hint: Try "ulimit -a"; maybe you should increase memory limits.)
 
Actual results:
maxima fails to run if there is data segment memory limit smaller than the physical memory on a machine.

Expected results:
maxima would read both the physical memory, and the current ulimit, and choose the smaller of the two values, and thereby be able to run.

Additional info:
If this bug were fixed, the memory usage could be properly limited and maxima would not be able to cause out of memory problems on a computer.

Relevant portions of strace output:

23413 open("/proc/meminfo", O_RDONLY)   = 3
23413 fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
23413 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9f2a032000
23413 read(3, "MemTotal:        8196156 kB\nMemF"..., 1024) = 1024
23413 close(3)                          = 0

23413 mmap(NULL, 33554432, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffff01a3000
23413 mmap(0x20000000, 1044480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x20000000
23413 mmap(0x20100000, 1044480, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = 0x20100000
23413 mmap(0x1000000000, 8589869056, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE, -1, 0) = -1 ENOMEM (Cannot allocate memory)

Comment 1 Josh Cogliati 2010-01-29 15:37:30 UTC
This seems to be the fault of the sbcl lisp compiler.  I will have to track it down in that code.

Comment 2 Matt McCutchen 2010-04-14 01:04:31 UTC
(In reply to comment #0)
> When running maxima reads the physical memory value from /proc/meminfo, and
> then tries to mmap this amount of memory.

That does not appear to be true.  My machine has "MemTotal: 2056292 kB", but sbcl still tries to allocate 8 GiB.  I think the open of /proc/meminfo is something unrelated in glibc because I see it also when stracing other programs.

Comment 3 Bug Zapper 2010-11-04 03:05:39 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Rex Dieter 2010-11-05 16:37:46 UTC
Cannot reproduce using
maxima-runtime-sbcl-5.22.1-5.fc13.i686
sbcl-1.0.38-2.fc13.i686

Comment 5 Rex Dieter 2010-11-05 16:39:49 UTC
confirmed problem (still) exists on x86_64

Comment 6 Bug Zapper 2011-06-02 17:05:43 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2011-06-27 14:42:27 UTC
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.