Skip to content

Commit

Permalink
Fixed crash on Android tcmalloc builds caused by vasprintf being inco…
Browse files Browse the repository at this point in the history
…mpatible to tcmalloc

[email protected]
TEST=Compile Android build with Deep Memory Profiler support. Go to lenta.ru. Open some news pages. Should not crash.

********** Crash dump: **********
Build fingerprint: 'samsung/GT-I9100/GT-I9100:4.0.3/IML74K/XXLPQ:user/release-keys'
pid: 3431, tid: 3444  >>> org.chromium.content_shell_apk:sandboxed_process1 <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000039
Stack frame #00  pc 02263b44  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine Abort in ../../third_party/tcmalloc/chromium/src/base/abort.cc:15
Stack frame #1  pc 0226ccd8  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine Log in ../../third_party/tcmalloc/chromium/src/internal_logging.cc:120
Stack frame #2  pc 0227584c  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine InvalidFree in (null):0
Stack frame #3  pc 02277698  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine do_free_with_callback in ../../third_party/tcmalloc/chromium/src/tcmalloc.cc:1166
Stack frame #4  pc 02277898  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine do_free in ../../third_party/tcmalloc/chromium/src/tcmalloc.cc:1209
Stack frame #5  pc 0229f914  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine tc_free in ../../third_party/tcmalloc/chromium/src/tcmalloc.cc:1569
Stack frame #6  pc 0158af50  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine error in (null):0
Stack frame #7  pc 0158aff8  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine normalErrorHandler in ../../third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp:1305
Stack frame #8  pc 01166dac  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine __xmlRaiseError in ../../third_party/libxml/src/error.c:572
Stack frame #9  pc 0116b7a8  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine xmlFatalErr in (null):0
Stack frame #10  pc 0117e424  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine xmlParseTryOrFinish in ../../third_party/libxml/src/parser.c:11453
Stack frame #11  pc 0117ea88  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine xmlParseChunk in ../../third_party/libxml/src/parser.c:11767
Stack frame #12  pc 0158891c  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine parseChunk in (null):0
Stack frame #13  pc 01589da0  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine doWrite in ../../third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp:876
Stack frame #14  pc 01589f3c  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine append in ../../third_party/WebKit/Source/wtf/RefPtr.h:49
Stack frame #15  pc 00d07e70  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine setContent in ../../third_party/WebKit/Source/wtf/PassRefPtr.h:70
Stack frame #16  pc 015770bc  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine responseXML in ../../third_party/WebKit/Source/wtf/PassRefPtr.h:70
Stack frame #17  pc 017bdd20  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine responseXMLAttributeGetter in ../../third_party/WebKit/Source/wtf/PassRefPtr.h:47
Stack frame #18  pc 017bddc8  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine responseXMLAttributeGetterCallback in gen/blink/bindings/V8XMLHttpRequest.cpp:219
Stack frame #19  pc 00eb86d8  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine Call in ../../v8/src/arguments.cc:110
Stack frame #20  pc 01024b5c  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine GetPropertyWithCallback in ../../v8/src/objects.cc:443
Stack frame #21  pc 010304c8  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine GetProperty in ../../v8/src/objects.cc:971
Stack frame #22  pc 010305dc  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine GetProperty in ../../v8/src/objects.cc:845
Stack frame #23  pc 00fb12f8  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine Load in ../../v8/src/ic.cc:875
Stack frame #24  pc 00fb1b78  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine __RT_impl_LoadIC_Miss in ../../v8/src/ic.cc:2076
Stack frame #25  pc 00fb1bd0  /data/data/org.chromium.content_shell_apk/lib/libcontent_shell_content_view.so: Routine LoadIC_Miss in (null):0

Review URL: https://codereview.chromium.org/143903018

git-svn-id: svn://svn.chromium.org/blink/trunk@166520 bbb929c8-8fbe-4397-9dbb-9b2b20218538
  • Loading branch information
[email protected] committed Feb 5, 2014
1 parent 61a3370 commit 311405a
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Source/core/xml/parser/XMLDocumentParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,28 +1103,15 @@ void XMLDocumentParser::error(XMLErrors::ErrorType type, const char* message, va
if (isStopped())
return;

#if HAVE(VASPRINTF)
char* formattedMessage;
if (vasprintf(&formattedMessage, message, args) == -1)
return;
#else
char formattedMessage[1024];
vsnprintf(formattedMessage, sizeof(formattedMessage) - 1, message, args);
#endif

if (m_parserPaused) {
m_pendingCallbacks.append(adoptPtr(new PendingErrorCallback(type, reinterpret_cast<const xmlChar*>(formattedMessage), lineNumber(), columnNumber())));
#if HAVE(VASPRINTF)
free(formattedMessage);
#endif
return;
}

handleError(type, formattedMessage, textPosition());

#if HAVE(VASPRINTF)
free(formattedMessage);
#endif
}

void XMLDocumentParser::processingInstruction(const String& target, const String& data)
Expand Down

0 comments on commit 311405a

Please sign in to comment.