Closed Bug 846368 Opened 12 years ago Closed 12 years ago

Add number of bytes requested to OOM last-gasp

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: abr, Assigned: abr)

References

Details

Attachments

(1 file, 3 obsolete files)

Currently, when memory allocation fails, the only diagnostic printed to the
log messages is a simple "out of memory" string. It would be useful in
distinguishing from a true out-of-memory situation and a request for
an unrealistically large block of memory if the message included the
size of the requested allocation.
This patch uses a preallocated buffer and primitive operations to maximize the
chance of success under potentially unstable conditions, as might exist in
true out-of-memory situations.
Comment on attachment 719534 [details] [diff] [review]
Add number of bytes requested to OOM last-gasp

Benjamin: I'm just taking a guess that you're the right person to look at this patch. If it needs additional or different eyes, please let me know.
Attachment #719534 - Flags: review?(benjamin)
Which message are we talking about? The one printed in crash-stats, or something on the console?
Flags: needinfo?(adam)
On the console. This might be clearer if I give an example. Look at this tbpl log:

https://tbpl.mozilla.org/php/getParsedLog.php?id=20159969&tree=Mozilla-Inbound#error1

In cases like this, I'd like the line "15:29:23     INFO -  out of memory" to provide more useful diagnostics.

BTW, reading through the log for Bug 811483, I note that this really needs to be thread-safe. I was hoping to avoid pushing another 60 bytes or so onto the stack in what could be a delicate operating state, but any other solution would be even more disruptive. I'm about to update the patch to put the message buffer on the stack to handle potential threading issues.
Flags: needinfo?(adam)
Attachment #719534 - Attachment is obsolete: true
Attachment #719534 - Flags: review?(benjamin)
Attachment #719550 - Flags: review?(benjamin)
Comment on attachment 719550 [details] [diff] [review]
Add number of bytes requested to OOM last-gasp

ok, that makes sense. I'm pretty sure that this will not affect the abort message in crash stats (which is desired, because signatures might change).

Have you any interest in taking bug 811483?
Attachment #719550 - Flags: review?(benjamin) → review+
Actually... this is printing in decimal. Perhaps it would make more sense to print in hex?
(In reply to Benjamin Smedberg  [:bsmedberg] from comment #6)
> Have you any interest in taking bug 811483?

Under other circumstances, I'd say yes -- but right now, we're in a pretty frantic push to get the WebRTC stuff stable and finished.
(In reply to Benjamin Smedberg  [:bsmedberg] from comment #7)
> Actually... this is printing in decimal. Perhaps it would make more sense to
> print in hex?

Sure, that would be easy enough. I'll respin the patch.
Attachment #719550 - Attachment is obsolete: true
Attachment #719558 - Attachment is obsolete: true
https://hg.mozilla.org/integration/mozilla-inbound/rev/0644287fbbdc
https://hg.mozilla.org/mozilla-central/rev/0644287fbbdc
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Depends on: 851981
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: