[Webkit-unassigned] [Bug 12947] REGRESSION: ASSERTION FAILED: maxWidth >= 0 in StringTruncator.cpp:109 in WebCore::truncateString()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 2 13:46:28 PST 2007


------- Comment #4 from ddkilzer at webkit.org  2007-03-02 13:46 PDT -------
(In reply to comment #2)
> I cannot reproduce this on a PowerPC Mac.

The issue is most likely caused by differences in how NaN floating point values
are handled on PowerPC versus Intel architectures.  Obviously, this code from
StringTruncator.cpp (line 109) returns true with a NaN on PowerPC, but false
with a NaN on Intel:

     ASSERT(maxWidth >= 0);

I added an additional ASSERT() macro to the Intel debug build:

+    ASSERT(!isnan(maxWidth));
     ASSERT(maxWidth >= 0);

And rerunning the steps to reproduce demonstrated that maxWidth was a NaN

ASSERTION FAILED: !isnan(maxWidth)
WebCore::String WebCore::truncateString(const WebCore::String&, float, const
WebCore::Font&, unsigned int (*)(const WebCore::String&, unsigned int, unsigned
int, UChar*)))
Segmentation fault

Not sure if we need to determine where the NaN is generated, or simply handle
the NaN case differently in the truncateString(const String& string, float
maxWidth, const Font& font, TruncationFunction truncateToBuffer) method.

Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list