[lldb-dev] lldb crash while debugging wxWidgets application that was built with g++

Greg Clayton gclayton at apple.com
Tue Apr 8 14:49:29 PDT 2014


On Apr 8, 2014, at 2:42 PM, Eran Ifrah <eran.ifrah at gmail.com> wrote:

> I tried your suggestion:
> 
> Process 17807 stopped
> * thread #1: tid = 17807, 0x00000000006666b8 codelite`clMainFrame::OnAbout(this=0x0000000002ef0d80, (null)=0x00007fff2d666cd0) + 26 at frame.cpp:1791, name = 'codelite', stop reason = breakpoint 2.1
>     frame #0: 0x00000000006666b8 codelite`clMainFrame::OnAbout(this=0x0000000002ef0d80, (null)=0x00007fff2d666cd0) + 26 at frame.cpp:1791
>    1788
>    1789 void clMainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
>    1790 {
> -> 1791     wxString mainTitle;
>    1792     mainTitle = CODELITE_VERSION_STR;
>    1793
>    1794     AboutDlg dlg(this, mainTitle);
> (lldb)  image lookup --type wxClientDataContainer

Yep, so there is no actual definition for "wxClientDataContainer" in your executable. The whole premise of the GCC changes were that the definition would be available elsewhere, but in this case that isn't the case.

> (lldb)
> 
> and ofc, attempting to inspect mainTitle, resulted in crash
> 
> (lldb) p mainTitle
> error: libwx_gtk2u_unofficial_core-3.0.so.0 DWARF DIE at 0x030ac4cc for class 'wxSizer' has a base class 'wxClientDataContainer' that is a forward declaration, not a complete definition.
> Please file a bug against the compiler and include the preprocessed output for /home/david/devel/packages/wx/3.0-2/wxwidgets3.0-3.0.0/objs_gtk_sh/../src/common/sizer.cpp
> lldb: ../tools/clang/lib/AST/RecordLayoutBuilder.cpp:2844: const clang::ASTRecordLayout& clang::ASTContext::getASTRecordLayout(const clang::RecordDecl*) const: Assertion `D && "Cannot get layout of forward declarations!"' failed.

Yes, this is expected with the current LLDB.

> Program received signal SIGABRT, Aborted.
> Solution #2 is not an option for me, since the crash occurs in an external library which I did not build it myself and I am fetching it from an apt repository
> 
> BTW, I am guessing that this won't be a problem on OSX? where everything is compiled with clang?

Yes, by default on darwin clang doesn't use this debug info minimizing trick. On linux you will need to disable it if you have a clang that supports this optimization.

This compiler optimization is really lame. It does save space, but it causes the compiler to emit incomplete debug info. If your base class (wxClientDataContainer) has any member variables or methods, you won't be able to see any of the members that are missing and you won't be able to call any wxClientDataContainer methods.

Greg



More information about the lldb-dev mailing list