Bug 95852 - Crash backtraces should contain demangled function names and line numbers
Summary: Crash backtraces should contain demangled function names and line numbers
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-05 07:40 PDT by Csaba Osztrogonác
Modified: 2013-06-25 07:00 PDT (History)
4 users (show)

See Also:


Attachments
WIP patch (1.75 KB, patch)
2013-02-15 07:09 PST, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2012-09-05 07:40:49 PDT
example crash log from the Qt debug bot now:
---------------------------------------------
ASSERTION FAILED: isEndOfParagraph(endOfParagraphToMove)
/home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/Source/WebCore/editing/CompositeEditCommand.cpp(1137) : void WebCore::CompositeEditCommand::moveParagraph(const WebCore::VisiblePosition&, const WebCore::VisiblePosition&, const WebCore::VisiblePosition&, bool, bool)
1   0x7f1d164d3dfc /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd36dfc) [0x7f1d164d3dfc]
2   0x7f1d165316b6 /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd946b6) [0x7f1d165316b6]
3   0x7f1d1652fb1c /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd92b1c) [0x7f1d1652fb1c]
4   0x7f1d1652ed7b /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd91d7b) [0x7f1d1652ed7b]
5   0x7f1d164cc359 /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd2f359) [0x7f1d164cc359]
6   0x7f1d164cbd52 /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd2ed52) [0x7f1d164cbd52]
7   0x7f1d1650fc73 /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd72c73) [0x7f1d1650fc73]
8   0x7f1d1651327a /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd7627a) [0x7f1d1651327a]
9   0x7f1d163bb43d /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xc1e43d) [0x7f1d163bb43d]
10  0x7f1d1719255c /home/webkitbuildbot/slaves/debug64bit/buildslave/qt-linux-64-debug/build/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0x19f555c) [0x7f1d1719255c]
11  0x7f1cca0d0265 [0x7f1cca0d0265]


example crash log after the fix:
---------------------------------

ASSERTION FAILED: isEndOfParagraph(endOfParagraphToMove)
/home/oszi/WebKit/Source/WebCore/editing/CompositeEditCommand.cpp(1137) : void WebCore::CompositeEditCommand::moveParagraph(const WebCore::VisiblePosition&, const WebCore::VisiblePosition&, const WebCore::VisiblePosition&, bool, bool)
addr2line -e /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5.0.0 -f -C 0xd35104 0xd929be 0xd90e24 0xd90083 0xd2d661 0xd2d05a 0xd70f7b 0xd74582 0xc1c745 0x19f3694 0x7fcf5ad842651   0xd35104 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd35104) [0x7fcfa7501104]
WebCore::CompositeEditCommand::moveParagraph(WebCore::VisiblePosition const&, WebCore::VisiblePosition const&, WebCore::VisiblePosition const&, bool, bool)
/home/oszi/WebKit/Source/WebCore/editing/CompositeEditCommand.cpp:1137

2   0xd929be /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd929be) [0x7fcfa755e9be]
WebCore::InsertListCommand::listifyParagraph(WebCore::VisiblePosition const&, WebCore::QualifiedName const&)
/home/oszi/WebKit/Source/WebCore/editing/InsertListCommand.cpp:385

3   0xd90e24 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd90e24) [0x7fcfa755ce24]
WebCore::InsertListCommand::doApplyForSingleParagraph(bool, WebCore::QualifiedName const&, WebCore::Range*)
/home/oszi/WebKit/Source/WebCore/editing/InsertListCommand.cpp:250

4   0xd90083 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd90083) [0x7fcfa755c083]
WebCore::InsertListCommand::doApply()
/home/oszi/WebKit/Source/WebCore/editing/InsertListCommand.cpp:186

5   0xd2d661 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd2d661) [0x7fcfa74f9661]
WebCore::CompositeEditCommand::apply()
/home/oszi/WebKit/Source/WebCore/editing/CompositeEditCommand.cpp:205

6   0xd2d05a /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd2d05a) [0x7fcfa74f905a]
WebCore::applyCommand(WTF::PassRefPtr<WebCore::CompositeEditCommand>)
/home/oszi/WebKit/Source/WebCore/editing/CompositeEditCommand.cpp:162

7   0xd70f7b /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd70f7b) [0x7fcfa753cf7b]
WebCore::executeInsertUnorderedList(WebCore::Frame*, WebCore::Event*, WebCore::EditorCommandSource, WTF::String const&)
/home/oszi/WebKit/Source/WebCore/editing/EditorCommand.cpp:569

8   0xd74582 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xd74582) [0x7fcfa7540582]
WebCore::Editor::Command::execute(WTF::String const&, WebCore::Event*) const
/home/oszi/WebKit/Source/WebCore/editing/EditorCommand.cpp:1690

9   0xc1c745 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0xc1c745) [0x7fcfa73e8745]
WebCore::Document::execCommand(WTF::String const&, bool, WTF::String const&)
/home/oszi/WebKit/Source/WebCore/dom/Document.cpp:4595

10  0x19f3694 /home/oszi/WebKit/WebKitBuild/Debug/lib/libQtWebKit.so.5(+0x19f3694) [0x7fcfa81bf694]
WebCore::jsDocumentPrototypeFunctionExecCommand(JSC::ExecState*)
/home/oszi/WebKit/WebKitBuild/Debug/Source/WebCore/generated/JSDocument.cpp:2633

11  0x7fcf5ad84265 [0x7fcf5ad84265]
??
??:0
Comment 1 Csaba Osztrogonác 2012-09-05 07:55:36 PDT
Now backtraces are dumped by WTFPrintBacktrace() in Source/WTF/wtf/Assertions.cpp.

It uses libc's backtrace_symbols() which uses the dynamic symbol 
table (.dynsym section added by -rdynamic linker flag). But 
unfortunately it doesn't contain line numbers. 

We can get line numbers from .symtab section with with libbfd 
or an external tool based on libbfd, which is addr2line. In my
opinion using addr2line is simpler than implementing addr2line
again with taking account of addr2lines GPL license.

Unfortunately an addr2line call takes 20 secs on the 1.3Gb sized 
libQtWebKit.so ... which makes the test timeout instead of crash.
So we need a batching mechanism to call addr2line only once per
binary.
Comment 2 Csaba Osztrogonác 2013-02-15 07:09:31 PST
Created attachment 188562 [details]
WIP patch
Comment 3 Csaba Osztrogonác 2013-02-15 07:09:56 PST
I don't have time for it nowadays, feel free to pick it up.