Bug 71112 - NRWT crashes when parsing leaks output due to UTF-8 decoding error
Summary: NRWT crashes when parsing leaks output due to UTF-8 decoding error
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.6
: P2 Normal
Assignee: Eric Seidel (no email)
URL: http://build.webkit.org/builders/Snow...
Keywords: MakingBotsRed
Depends on:
Blocks:
 
Reported: 2011-10-28 05:17 PDT by Adam Roben (:aroben)
Modified: 2011-10-28 13:46 PDT (History)
1 user (show)

See Also:


Attachments
Patch (2.92 KB, patch)
2011-10-28 13:44 PDT, Eric Seidel (no email)
abarth: review+
abarth: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2011-10-28 05:17:47 PDT
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 "/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py", line 436, in <module>
    sys.exit(main())
  File "/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py", line 431, in main
    return run(port, options, args)
  File "/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py", line 107, in run
    num_unexpected_results = manager.run(result_summary)
  File "/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py", line 919, in run
    self._port.print_leaks_summary()
  File "/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/port/mac.py", line 143, in print_leaks_summary
    total_leaks = self._leak_detector.count_total_leaks(leaks_files)
  File "/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/layout_tests/port/leakdetector.py", line 123, in count_total_leaks
    leaks_output = self._filesystem.read_text_file(leak_file_path)
  File "/Volumes/Data/WebKit-BuildSlave/snowleopard-intel-leaks/build/Tools/Scripts/webkitpy/common/system/filesystem.py", line 218, in read_text_file
    return f.read()
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/codecs.py", line 666, in read
    return self.reader.read(size)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/codecs.py", line 472, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x90 in position 3419483: unexpected code byte
Comment 1 Adam Roben (:aroben) 2011-10-28 05:19:47 PDT
The files it was trying to parse can be found here: http://build.webkit.org/results/SnowLeopard%20Intel%20Leaks/r98706%20(19800)/
Comment 2 Eric Seidel (no email) 2011-10-28 12:32:36 PDT
Very trivial fix.  Will post patch momentarily.
Comment 3 Eric Seidel (no email) 2011-10-28 13:32:42 PDT
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 'NSCFNumber', 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&) | -[NSRunLoop(NSRunLoop) runMode:beforeDate:] | CFRunLoopRunSpecific | __CFRunLoopRun | __CFRunLoopDoSources0 | MultiplexerSource::perform() | URLConnectionClient::processEvents() | URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, 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&) | WebCore::HTMLDocumentParser::pumpTokenizerIfPossible(WebCore::HTMLDocumentParser::SynchronousMode) | WebCore::HTMLDocumentParser::pumpTokenizer(WebCore::HTMLDocumentParser::SynchronousMode) | WebCore::HTMLDocumentParser::canTakeNextToken(WebCore::HTMLDocumentParser::SynchronousMode, WebCore::PumpSession&) | WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder() | WebCore::HTMLScriptRunner::execute(WTF::PassRefPtr<WebCore::Element>, WTF::TextPosition const&) | WebCore::HTMLScriptRunner::runScript(WebCore::Element*, WTF::TextPosition const&) | WebCore::ScriptElement::prepareScript(WTF::TextPosition const&, WebCore::ScriptElement::LegacyTypeSupport) | WebCore::ScriptElement::executeScript(WebCore::ScriptSourceCode const&) | WebCore::ScriptController::evaluate(WebCore::ScriptSourceCode const&) | WebCore::ScriptController::evaluateInWorld(WebCore::ScriptSourceCode const&, WebCore::DOMWrapperWorld*) | WebCore::JSMainThreadExecState::evaluate(JSC::ExecState*, JSC::ScopeChainNode*, JSC::SourceCode const&, JSC::JSValue, JSC::JSValue*) | JSC::evaluate(JSC::ExecState*, JSC::ScopeChainNode*, JSC::SourceCode const&, 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&) | WebCore::FrameSelection::moveTo(WebCore::VisiblePosition const&, WebCore::VisiblePosition const&, WebCore::EUserTriggered) | WebCore::FrameSelection::setSelection(WebCore::VisibleSelection const&, 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&, WebCore::FloatPoint const&, int, int, int) const | WebCore::Font::selectionRectForComplexText(WebCore::TextRun const&, WebCore::FloatPoint const&, int, int, int) const | WebCore::ComplexTextController::ComplexTextController(WebCore::Font const*, WebCore::TextRun const&, bool, WTF::HashSet<WebCore::SimpleFontData const*, WTF::PtrHash<WebCore::SimpleFontData const*>, WTF::HashTraits<WebCore::SimpleFontData const*> >*, 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<TDeletedGlyphIndex>&, TFontCascade const&) | TGlyphEncoder::RunUnicodeEncoderRecursively(CTRun*, CFRange, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const&) | TGlyphEncoder::AppendUnmappedCharRun(CTRun*, CFRange, TGlyphList<TDeletedGlyphIndex>&, TFontCascade const&) | 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 ''

is the bad leak.  that string is the char 0x90. :(
Comment 4 Eric Seidel (no email) 2011-10-28 13:44:36 PDT
Created attachment 112904 [details]
Patch
Comment 5 Eric Seidel (no email) 2011-10-28 13:46:45 PDT
Committed r98758: <http://trac.webkit.org/changeset/98758>