Closed
Bug 472593
Opened 16 years ago
Closed 16 years ago
"ASSERTION: Illegal value" in nsJISx4501LineBreaker.cpp when removing tab characters
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Unassigned)
Details
(Keywords: assertion, testcase)
Attachments
(2 files, 2 obsolete files)
178 bytes,
text/html
|
Details | |
2.76 KB,
patch
|
roc
:
superreview+
|
Details | Diff | Splinter Review |
Loading http://www.trafficjot.com/TJMain.aspx triggers: ###!!! ASSERTION: Illegal value (length > position): 'aLen > aPos', file /Users/jruderman/central/intl/lwbrk/src/nsJISx4501LineBreaker.cpp, line 789 I have attached a simple testcase based on the site.
Reporter | ||
Updated•16 years ago
|
Attachment #355895 -
Attachment is private: false
Comment 1•16 years ago
|
||
The attached patch, to check that we're not already at the end before calling mLineBreaker->Next(), appears to resolve this. I will run reftests to check there are no unexpected side-effects before requesting review.
Comment 2•16 years ago
|
||
Moved this bug from Layout: Text to Content, as the assertion fires (correctly) when nsPlainTextSerializer (in content/base) calls mLineBreaker->Next() with a current position that is already at the end of the text. It shouldn't be calling the line breaker for a Next() break position when there's no more text in the current line being processed.
Component: Layout: Text → Content
QA Contact: layout.fonts-and-text → content
Comment 3•16 years ago
|
||
The assertion message in Next() was poorly worded; same applies to the equivalent assertion in Prev(). So I have revised these in the updated patch. The actual code change in content/base/src/nsPlainTextSerializer.cpp is unchanged from the earlier version of the patch.
Attachment #355975 -
Attachment is obsolete: true
Attachment #356098 -
Flags: review?(bzbarsky)
Reporter | ||
Comment 4•16 years ago
|
||
> + NS_ASSERTION(aLen > aPos, "Illegal value (position should be < length)");
If you're concerned that "aLen > aPos" is confusing, you can change the condition to "aPos < aLen" instead of repeating the condition in the assertion text. I prefer assertion text that provides context ("Bad position passed to nsJISx4051LineBreaker::Next") or is easy to recognize ("Position is past the end of the text!").
Updated•16 years ago
|
Attachment #356098 -
Flags: review?(bzbarsky) → review+
Comment 5•16 years ago
|
||
Comment on attachment 356098 [details] [diff] [review] same patch, but also tidy up assertion messages in the linebreaker r=bzbarsky with Jesse's comments addressed. For what it's worth, the mq diff would be a lot easier to review if you add the following to the [diff] section in your hgrc: showfunc = true It would be even better if you also added unified = 8 but that also increases the risk of conflicts when applying the mq patches of course. Generally speaking, I think it's worth it.
Comment 6•16 years ago
|
||
Thanks for the comments; adjusted patch is attached. Note that the assertion in nsJISx4051LineBreaker::Prev() is now slightly stricter than the original (it prohibits aPos == 0, which would be an equivalent error to the one with Next() that's actually being fixed in this patch). I've run the full layout reftest suite with this version and it doesn't break anything, so it seems worth tightening up the code while we're here.
Attachment #356098 -
Attachment is obsolete: true
Attachment #356174 -
Flags: superreview?(roc)
Attachment #356174 -
Flags: superreview?(roc) → superreview+
Updated•16 years ago
|
Keywords: checkin-needed
Would be good to add a crashtest for this.
Pushed 3afab626d3aa
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Reporter | ||
Updated•16 years ago
|
Flags: in-testsuite? → in-testsuite+
Assignee | ||
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•