<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>71112</bug_id>
          
          <creation_ts>2011-10-28 05:17:47 -0700</creation_ts>
          <short_desc>NRWT crashes when parsing leaks output due to UTF-8 decoding error</short_desc>
          <delta_ts>2011-10-28 13:46:45 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://build.webkit.org/builders/SnowLeopard%20Intel%20Leaks/builds/19800/steps/layout-test/logs/stdio</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>MakingBotsRed</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Roben (:aroben)">aroben</reporter>
          <assigned_to name="Eric Seidel (no email)">eric</assigned_to>
          <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>492388</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-10-28 05:17:47 -0700</bug_when>
    <thetext>NRWT is crashing when parsing leaks files due to a UTF-8 decoding error:

http://build.webkit.org/builders/SnowLeopard%20Intel%20Leaks/builds/19800/steps/layout-test/logs/stdio

Traceback (most recent call last):
  File &quot;/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 436, in &lt;module&gt;
    sys.exit(main())
  File &quot;/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 431, in main
    return run(port, options, args)
  File &quot;/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py&quot;, line 107, in run
    num_unexpected_results = manager.run(result_summary)
  File &quot;/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py&quot;, line 919, in run
    self._port.print_leaks_summary()
  File &quot;/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/port/mac.py&quot;, line 143, in print_leaks_summary
    total_leaks = self._leak_detector.count_total_leaks(leaks_files)
  File &quot;/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py&quot;, line 123, in count_total_leaks
    leaks_output = self._filesystem.read_text_file(leak_file_path)
  File &quot;/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/common/system/filesystem.py&quot;, line 218, in read_text_file
    return f.read()
  File &quot;/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/codecs.py&quot;, line 666, in read
    return self.reader.read(size)
  File &quot;/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/codecs.py&quot;, line 472, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: &apos;utf8&apos; codec can&apos;t decode byte 0x90 in position 3419483: unexpected code byte</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>492391</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-10-28 05:19:47 -0700</bug_when>
    <thetext>The files it was trying to parse can be found here: http://build.webkit.org/results/SnowLeopard%20Intel%20Leaks/r98706%20(19800)/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>492604</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-10-28 12:32:36 -0700</bug_when>
    <thetext>Very trivial fix.  Will post patch momentarily.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>492636</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-10-28 13:32:42 -0700</bug_when>
    <thetext>http://build.webkit.org/results/SnowLeopard%20Intel%20Leaks/r98706%20(19800)/DumpRenderTree-88620-leaks.txt

is the file with the bad char.

Leak: 0x1240d0090  size=32  zone: DefaultMallocZone_0x107420000	instance of &apos;NSCFNumber&apos;, type ObjC, implemented in Foundation	
	0x70fdd8c8 0x00007fff 0x00001686 0x00000001 	...p............
	0x00000000 0x40300000 0x00000000 0x00000000 	......0@........
	Call stack: [thread 0x7fff7026fca0]: | start | main | dumpRenderTree(int, char const**) | runTestingServerLoop() | runTest(std::string const&amp;) | -[NSRunLoop(NSRunLoop) runMode:beforeDate:] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSources0 | MultiplexerSource::perform() | URLConnectionClient::processEvents() | URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo&lt;XClientEvent, XClientEventParams&gt;*, long) | URLConnectionClient::_clientDidReceiveData(__CFData const*, URLConnectionClient::ClientConnectionEventQueue*) | _NSURLConnectionDidReceiveData | -[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:] | WebCore::ResourceLoader::didReceiveData(WebCore::ResourceHandle*, char const*, int, int) | WebCore::MainResourceLoader::didReceiveData(char const*, int, long long, bool) | WebCore::ResourceLoader::didReceiveData(char const*, int, long long, bool) | WebCore::MainResourceLoader::addData(char const*, int, bool) | WebCore::DocumentLoader::receivedData(char const*, int) | WebCore::DocumentLoader::commitLoad(char const*, int) | WebFrameLoaderClient::committedLoad(WebCore::DocumentLoader*, char const*, int) | -[WebDataSource(WebInternal) _receivedData:] | -[WebHTMLRepresentation receivedData:withDataSource:] | -[WebFrame(WebInternal) _commitData:] | WebCore::DocumentLoader::commitData(char const*, unsigned long) | WebCore::DocumentWriter::addData(char const*, unsigned long) | WebCore::DecodedDataDocumentParser::appendBytes(WebCore::DocumentWriter*, char const*, unsigned long) | WebCore::HTMLDocumentParser::append(WebCore::SegmentedString const&amp;) | WebCore::HTMLDocumentParser::pumpTokenizerIfPossible(WebCore::HTMLDocumentParser::SynchronousMode) | WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode) | WebCore::HTMLDocumentParser::canTakeNextToken(WebCore::HTMLDocumentParser::SynchronousMode, WebCore::PumpSession&amp;) | WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder() | WebCore::HTMLScriptRunner::execute(WTF::PassRefPtr&lt;WebCore::Element&gt;, WTF::TextPosition const&amp;) | WebCore::HTMLScriptRunner::runScript(WebCore::Element*, WTF::TextPosition const&amp;) | WebCore::ScriptElement::prepareScript(WTF::TextPosition const&amp;, WebCore::ScriptElement::LegacyTypeSupport) | WebCore::ScriptElement::executeScript(WebCore::ScriptSourceCode const&amp;) | WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&amp;) | WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&amp;, WebCore::DOMWrapperWorld*) | WebCore::JSMainThreadExecState::evaluate(JSC::ExecState*, JSC::ScopeChainNode*, JSC::SourceCode const&amp;, JSC::JSValue, JSC::JSValue*) | JSC::evaluate(JSC::ExecState*, JSC::ScopeChainNode*, JSC::SourceCode const&amp;, JSC::JSValue, JSC::JSValue*) | JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::ScopeChainNode*, JSC::JSObject*) | JSC::JITCode::execute(JSC::RegisterFile*, JSC::ExecState*, JSC::JSGlobalData*) | 0x262ebe8011f8 | WebCore::jsDOMSelectionPrototypeFunctionSetBaseAndExtent(JSC::ExecState*) | WebCore::DOMSelection::setBaseAndExtent(WebCore::Node*, int, WebCore::Node*, int, int&amp;) | WebCore::FrameSelection::moveTo(WebCore::VisiblePosition const&amp;, WebCore::VisiblePosition const&amp;, WebCore::EUserTriggered) | WebCore::FrameSelection::setSelection(WebCore::VisibleSelection const&amp;, unsigned int, WebCore::FrameSelection::CursorAlignOnScroll, WebCore::TextGranularity) | WebCore::FrameSelection::updateAppearance() | WebCore::RenderView::setSelection(WebCore::RenderObject*, int, WebCore::RenderObject*, int, WebCore::RenderView::SelectionRepaintMode) | WebCore::RenderSelectionInfo::RenderSelectionInfo(WebCore::RenderObject*, bool) | WebCore::RenderText::selectionRectForRepaint(WebCore::RenderBoxModelObject*, bool) | WebCore::InlineTextBox::localSelectionRect(int, int) | WebCore::Font::selectionRectForText(WebCore::TextRun const&amp;, WebCore::FloatPoint const&amp;, int, int, int) const | WebCore::Font::selectionRectForComplexText(WebCore::TextRun const&amp;, WebCore::FloatPoint const&amp;, int, int, int) const | WebCore::ComplexTextController::ComplexTextController(WebCore::Font const*, WebCore::TextRun const&amp;, bool, WTF::HashSet&lt;WebCore::SimpleFontData const*, WTF::PtrHash&lt;WebCore::SimpleFontData const*&gt;, WTF::HashTraits&lt;WebCore::SimpleFontData const*&gt; &gt;*, bool) | WebCore::ComplexTextController::collectComplexTextRuns() | WebCore::ComplexTextController::collectComplexTextRunsForCharacters(unsigned short const*, unsigned int, unsigned int, WebCore::SimpleFontData const*) | WebCore::ComplexTextController::collectComplexTextRunsForCharactersCoreText(unsigned short const*, unsigned int, unsigned int, WebCore::SimpleFontData const*) | CTTypesetterCreateWithAttributedStringAndOptions | TTypesetterAttrString::Initialize() | TGlyphEncoder::EncodeChars(CFRange, __CFDictionary const*) | TGlyphEncoder::RunUnicodeEncoder(CTRun*, CFRange, TGlyphList&lt;TDeletedGlyphIndex&gt;&amp;, TFontCascade const&amp;) | TGlyphEncoder::RunUnicodeEncoderRecursively(CTRun*, CFRange, TGlyphList&lt;TDeletedGlyphIndex&gt;&amp;, TFontCascade const&amp;) | TGlyphEncoder::AppendUnmappedCharRun(CTRun*, CFRange, TGlyphList&lt;TDeletedGlyphIndex&gt;&amp;, TFontCascade const&amp;) | TFontCascade::CreateFallback(__CTFont const*, __CFString const*, CFRange) const | TFontCascade::CreateCascadeFallback(long) | -[WebCascadeList objectAtIndex:] | TFont::CopyDescriptor() const | CFNumberCreate | _CFRuntimeCreateInstance | malloc_zone_malloc 
Leak: 0x1240d00f0  size=32  zone: DefaultMallocZone_0x107420000	string &apos;&apos;

is the bad leak.  that string is the char 0x90. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>492644</commentid>
    <comment_count>4</comment_count>
      <attachid>112904</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-10-28 13:44:36 -0700</bug_when>
    <thetext>Created attachment 112904
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>492648</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-10-28 13:46:45 -0700</bug_when>
    <thetext>Committed r98758: &lt;http://trac.webkit.org/changeset/98758&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>112904</attachid>
            <date>2011-10-28 13:44:36 -0700</date>
            <delta_ts>2011-10-28 13:45:30 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-71112-20111028134435.patch</filename>
            <type>text/plain</type>
            <size>2986</size>
            <attacher name="Eric Seidel (no email)">eric</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTg3NTMKZGlmZiAtLWdpdCBhL1Rvb2xzL0NoYW5nZUxvZyBi
L1Rvb2xzL0NoYW5nZUxvZwppbmRleCBjZTJjOGRjY2E1NjE4N2UyYzY1OWUzZDRlM2M3NjQ1NDE1
Y2Y3MzMzLi5jOTczYmUzNTI4ZjhmYWVhY2MxMzg2ZDY3OD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Bub24tdXRmOCBjaGFyYWN0ZXJzIHRvIG1ha2Ugc3VyZSB3
ZSBkb24ndCBibG93IHVwIHRyeWluZyB0byBwYXJzZSB0aGUgZmlsZS4KKyAgICAgICAgICAgICcv
bW9jay1yZXN1bHRzL0R1bXBSZW5kZXJUcmVlLTEyMzQtbGVha3MudHh0JzogJ1x4ZmZcblByb2Nl
c3MgMTIzNDogMTIgbGVha3MgZm9yIDQwIHRvdGFsIGxlYWtlZCBieXRlcy5cblx4ZmZcbicsCiAg
ICAgICAgICAgICAnL21vY2stcmVzdWx0cy9EdW1wUmVuZGVyVHJlZS0yMzQyMy1sZWFrcy50eHQn
OiAnUHJvY2VzcyAxMjM1OiAxMjM0MSBsZWFrcyBmb3IgMjc5MzQgdG90YWwgbGVha2VkIGJ5dGVz
LlxuJywKICAgICAgICAgICAgICcvbW9jay1yZXN1bHRzL0R1bXBSZW5kZXJUcmVlLTgyMy1sZWFr
cy50eHQnOiAnUHJvY2VzcyAxMjM1NjogMjM0MTIgbGVha3MgZm9yIDE4IHRvdGFsIGxlYWtlZCBi
eXRlcy5cbicsCiAgICAgICAgIH0pCg==
</data>
<flag name="review"
          id="111104"
          type_id="1"
          status="+"
          setter="abarth"
    />
    <flag name="commit-queue"
          id="111105"
          type_id="3"
          status="+"
          setter="abarth"
    />
          </attachment>
      

    </bug>

</bugzilla>