Closed
Bug 97516
Opened 24 years ago
Closed 24 years ago
crash in nsRenderingContextWin::GetWidth() in certain situation
Categories
(Core :: Layout, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: shanjian, Assigned: shanjian)
Details
(Keywords: crash)
Attachments
(3 files)
|
1.21 KB,
patch
|
Details | Diff | Splinter Review | |
|
484 bytes,
patch
|
Details | Diff | Splinter Review | |
|
527 bytes,
patch
|
waterson
:
superreview+
asa
:
approval+
|
Details | Diff | Splinter Review |
This bug was sprawn from bugscape 8832. It is reproducible an embed product. I
believe this problem also happens in certain situation with other mozilla based
product.
In following code,
nsFontWin** end = &metrics->mLoadedFonts[metrics->mLoadedFontsCount];
while (font < end) {
if (FONT_HAS_GLYPH((*font)->mMap, c)) {
currFont = *font;
goto FoundFont; // for speed -- avoid "if" statement
}
mLoadedFontsCount is not initiated. In certain situation, (font < end) is true,
but *font is null or invalide value, that will lead to a crash.
| Assignee | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
confirming
| Assignee | ||
Comment 4•24 years ago
|
||
roy review the patch in bugscape 8832.
| Assignee | ||
Comment 5•24 years ago
|
||
Comment 6•24 years ago
|
||
Looks ok to me, but I'd like r=yokoyama on this latest patch only, recorded
here, and then one of the SRs cc'd can sr= this patch, too.
/be
Interesting, the nsFontMetricsWin class has
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW, defined in
http://lxr.mozilla.org/seamonkey/source/xpcom/ds/nsCRT.h#51
Isn't this supposed to zero everything, including therefore mLoadedFontsCount?
Comment 8•24 years ago
|
||
Let's ask scc!
/be
| Assignee | ||
Comment 9•24 years ago
|
||
I finally reproduce the problem with a testcase found in bugscape 9036. The real
problem is that sometimes null pointer is assigned to mLoadedFonts array. The
previous patch (attachment 45784 [details]) does not fix any problem.
| Assignee | ||
Comment 10•24 years ago
|
||
| Assignee | ||
Comment 11•24 years ago
|
||
FYI, I still could not reproduce the problem with trunk build, but I believe the
problem exist. We only do not know how to make it happen. I also checked all
places where mLoadedFonts array is assigned, and everything seems fine except
the problematic pointer as shown in my patch.
Comment 12•24 years ago
|
||
Yep, that patch looks more sensible to me. A fall-through error code path
that wasn't accounted for. I had this corrected in my font changes.
r=rbs
Comment 13•24 years ago
|
||
Comment on attachment 48340 [details] [diff] [review]
The patch that fix the real problem
sr=waterson
Attachment #48340 -
Flags: superreview+
| Assignee | ||
Comment 14•24 years ago
|
||
fix checked in to trunk.
Comment 15•24 years ago
|
||
Comment on attachment 48340 [details] [diff] [review]
The patch that fix the real problem
a=asa for checkin to 0.9.4 branch
Attachment #48340 -
Flags: approval+
| Assignee | ||
Comment 16•24 years ago
|
||
fix checked in to 0.9.4 branch.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•