Closed Bug 284889 Opened 19 years ago Closed 19 years ago

OOM crash [@nsStyleContext::ApplyStyleFixups]

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: dewildt, Assigned: bastiaan)

Details

(Keywords: crash, helpwanted)

Crash Data

Attachments

(2 files, 2 obsolete files)

GetUniqueStyleData could return nsnull is several cases (e.g. invalid
nsStyleStructID, OOM etc.). This is not handled in
nsStyleContext::ApplyStyleFixups which could result in a crash
Hmmmm...  We really need this fixup -- if it doesn't happen, we'll crash in
various places in layout, iirc.  Maybe if getting the unique style data fails we
should just munge our non-unique data?
Keywords: helpwanted
Attached patch add null check (obsolete) — Splinter Review
This patch adds a null check. I don't completely understand bz's comment, so
his suggested additional fix is lost upon me.
Attachment #187730 - Flags: review?(dbaron)
My comment just says that with that patch we'll go on to crash elsewhere instead
of crashing here.

My suggestion is that if we fail to get a unique style data we should perhaps
modify |disp| (or rather a non-const version thereof) directly.  Possibly by
making GetUniqueStyleData never return null and return the non-unique data if it
can't allocate a new struct.
Attachment #187730 - Flags: review?(dbaron)
Attached patch better fix (obsolete) — Splinter Review
Attachment #187730 - Attachment is obsolete: true
On second thought, we should probably return immediately.
Assignee: dbaron → b.jacques
Attachment #188117 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #188120 - Flags: superreview?(dbaron)
Attachment #188120 - Flags: review?(dbaron)
Comment on attachment 188120 [details] [diff] [review]
even better fix..

>+    NS_WARNING("Ran out of memory while trying to allocate memory for a unique nsStyleStruct! " \
>+               "Returning the non-unique data.");

No need for the backslash.  It may even be counterproductive.
Attachment #188120 - Flags: superreview?(dbaron)
Attachment #188120 - Flags: superreview+
Attachment #188120 - Flags: review?(dbaron)
Attachment #188120 - Flags: review+
Attachment #188120 - Attachment is obsolete: true
Attachment #189720 - Flags: approval1.8b4?
Comment on attachment 188120 [details] [diff] [review]
even better fix..

Requesting 1.8b4 approval for this OOM error handling fix.  Risk is quite low.
Attachment #188120 - Attachment is obsolete: false
Attachment #188120 - Flags: approval1.8b4?
Attachment #188120 - Flags: approval1.8b4?
Attachment #189720 - Flags: approval1.8b4? → approval1.8b4+
Checked in by timeless (2005-07-19 14:03).
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Crash Signature: [@nsStyleContext::ApplyStyleFixups]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: