Closed Bug 480029 Opened 15 years ago Closed 15 years ago

mmgc should print a message when is low on memory or out of memory before exiting with 128

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: dschaffe, Assigned: lhansen)

References

Details

Attachments

(1 file)

The OOM handler exits gracefully from the vm shell with an exit code of 128.  Can the handler print low memory warning or out of memory warning to exercise the callback mechanism?
Flags: flashplayer-triage+
Flags: in-testsuite?
OOM exit code 128 is not in the automated buildbot acceptance tests.  I have a script (replace AVM with python script) to run an abc calculating the minimum memory before the test stops working.  The script sets heaplimit at and below the minimum memory testing 128 exit code is returned and not a SEGFAULT or value besides 0 is returned.  It is tested 1-off. I could experiment with adding acceptance test to set low heap limit and allocate a bunch of memory in the acceptance tests.  Would not be as exhaustive as running every acceptance tests.
Flags: in-testsuite? → in-testsuite-
Assignee: nobody → lhansen
Attached patch For Mac and UnixSplinter Review
The OOM mechanism in MMgc already prints "out of memory" using the GCLog mechanism, but that may be diverted or throttled in various ways.

This patch catches the error in the toplevel "main" function and prints a message (using no additional memory) "OUT OF MEMORY" before termination.

Since there is no console on Win32 or WinMo, this patch does not apply to those platforms.
Attachment #385770 - Flags: review?(stejohns)
Comment on attachment 385770 [details] [diff] [review]
For Mac and Unix

Might be useful to have Win32/WinCE write a similar message with OutputDebugStringA().
Attachment #385770 - Flags: review?(stejohns) → review+
(In reply to comment #4)
> (From update of attachment 385770 [details] [diff] [review])
> Might be useful to have Win32/WinCE write a similar message with
> OutputDebugStringA().

The implementation of VMPI_log appears to indicate that this function is not available on CE, but I'll add it on Windows desktop.  Don't know if I can count on it using no dynamically allocated memory but I guess I'll take my chances.
OutputDebugStringW appears to work on WinMo (with an L"whatever" string).
right, CE is unicode-only.
redux changeset:   2069:4b5ca7ca1b15
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
verified fixed.  shell prints message "error: out of memory" to stdout when oom happens.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: