Closed
Bug 284038
Opened 21 years ago
Closed 20 years ago
OOM crash [@ EnumFonts]
Categories
(Core Graveyard :: Ports: Qt, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: bastiaan)
References
()
Details
(Keywords: crash)
Crash Data
Attachments
(1 file, 3 obsolete files)
|
1.11 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
note that cleanup for this case needs to properly release the partially
constructed array.
Updated•21 years ago
|
Severity: normal → critical
| Assignee | ||
Comment 1•21 years ago
|
||
Not only are the Allocs not checked, but in the for loop, i is never
incremented. So, EnumFonts() would always enumerate exactly one font.
Assignee: zack → b.jacques
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•21 years ago
|
||
Attachment #187727 -
Attachment is obsolete: true
| Assignee | ||
Updated•21 years ago
|
Attachment #187774 -
Flags: review?(zack)
Comment 3•21 years ago
|
||
Comment on attachment 187774 [details] [diff] [review]
better fix
yeah, why not, looks good. thanks.
Attachment #187774 -
Flags: review?(zack) → review+
| Assignee | ||
Updated•21 years ago
|
Attachment #187774 -
Flags: approval1.8b3?
| Assignee | ||
Updated•21 years ago
|
Attachment #187774 -
Flags: approval1.8b3?
| Assignee | ||
Comment 4•21 years ago
|
||
Comment on attachment 187774 [details] [diff] [review]
better fix
+ array = (PRUnichar**)nsMemory::Realloc(count *
sizeof(PRUnichar*));
This is wrong. nsMemory::Realloc() should take two arguments. Why does the
compiler allow us to call it with only one?
| Assignee | ||
Comment 5•21 years ago
|
||
..Because I don't normally build with the qt backend, of course. Boy, do I look
silly now.
Attachment #187774 -
Attachment is obsolete: true
| Assignee | ||
Updated•21 years ago
|
Attachment #187802 -
Flags: review?(zack)
Comment 6•21 years ago
|
||
Comment on attachment 187802 [details] [diff] [review]
oops.
As long as it builds I'm fine with virtually anything. Both KDE and Qt don't
handle OOM errors cleanly anyway. The bottom line on anything beside Windows is
that due to excessive swapping user has closed the application around five
times anyway ;)
Attachment #187802 -
Flags: review?(zack) → review+
| Assignee | ||
Updated•21 years ago
|
Attachment #187802 -
Flags: approval1.8b3?
Comment 7•21 years ago
|
||
Comment on attachment 187802 [details] [diff] [review]
oops.
a=bsmedberg for checkin on 6/30 only
Attachment #187802 -
Flags: approval1.8b3? → approval1.8b3+
| Assignee | ||
Comment 8•21 years ago
|
||
Checked in by timeless (2005-06-30 13:48).
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 9•21 years ago
|
||
ok, so...
+ array = (PRUnichar**)nsMemory::Realloc((void*)array, count *
sizeof(PRUnichar*));
does this actually have a chance of working in an OOM situation? given how
realloc works, I actually doubt that... (because realloc leaves the old memory
untouched if the allocation fails. thus, it must request the new memory before
freeing the old one)
so, I'll reopen.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 10•21 years ago
|
||
Hm, okay. So would you suggest returning the partial array (with its count
adjusted), or freeing up the partial array and returning NS_ERROR_OOM?
Comment 11•21 years ago
|
||
hm, I think just adjusting the count is better... (something like the first
patch here)
| Assignee | ||
Comment 12•21 years ago
|
||
And you couldn't have mentioned this earlier?! ;)
Attachment #187802 -
Attachment is obsolete: true
Comment 13•21 years ago
|
||
it worried me all the time but only now I could explain why :-)
| Assignee | ||
Updated•21 years ago
|
Attachment #188681 -
Flags: review?(zack)
| Assignee | ||
Comment 14•21 years ago
|
||
CC'ing Zack.
| Assignee | ||
Comment 15•20 years ago
|
||
Comment on attachment 188681 [details] [diff] [review]
remove realloc
Zack hasn't responded to my request, would you be interested in sr and rs'ing
this change, roc?
Attachment #188681 -
Flags: review?(zack) → superreview?(roc)
Attachment #188681 -
Flags: superreview?(roc)
Attachment #188681 -
Flags: superreview+
Attachment #188681 -
Flags: review+
| Assignee | ||
Comment 16•20 years ago
|
||
Attachment 188681 [details] [diff] was checked in by timeless (2005-10-06 14:16).
Status: REOPENED → RESOLVED
Closed: 21 years ago → 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
QA Contact: cbiesinger → ports-qt
Updated•18 years ago
|
Product: Core → Core Graveyard
Updated•15 years ago
|
Crash Signature: [@ EnumFonts]
You need to log in
before you can comment on or make changes to this bug.
Description
•