lldb 6.0.0 segfaults on opening a core file

From: Roman Bogorodskiy <novel_at_FreeBSD.org>
Date: Mon, 22 Jan 2018 21:06:00 +0400
Hi,

Running on -CURRENT _at_ Jan 20 with llvm 6.0.0, I have the following issue opening
a core file with lldb:

$ lldb /usr/local/bin/python2.7 -c /tmp/python2.7_90218_0.core 
(lldb) target create "/usr/local/bin/python2.7" --core "/tmp/python2.7_90218_0.core"
Assertion failed: (template_counter >= 0), function ConsumeTemplateArgs, file /usr/src/contrib/llvm/tools/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp, line 245.

This nothing happens for a couple of minutes and then it dumps core.

Interestingly though, it can open its own core:

%> lldb /usr/bin/lldb -c /tmp/lldb_1129_0.core 
(lldb) target create "/usr/bin/lldb" --core "/tmp/lldb_1129_0.core"
Core file '/tmp/lldb_1129_0.core' (x86_64) was loaded.                                                                                                                                                             
(lldb) bt                                                                                                                                                                                                          
* thread #1, name = 'lldb', stop reason = signal SIGABRT                                                                                                                                                           
  * frame #0: 0x0000000803e642ea libc.so.7`__sys_thr_kill at thr_kill.S:3                                                                                                                                          
    frame #1: 0x0000000803e642b4 libc.so.7`__raise(s=6) at raise.c:54                                                                                                                                              
    frame #2: 0x0000000803e64229 libc.so.7`abort at abort.c:67                                                                                                                                                     
    frame #3: 0x0000000803ee38f1 libc.so.7`__assert(func=<unavailable>, file=<unavailable>, line=<unavailable>, failedexpr=<unavailable>) at assert.c:53                                                           
    frame #4: 0x00000000017fa8e5 lldb`::ConsumeTemplateArgs() at CPlusPlusNameParser.cpp:245                                                                                                                       
    frame #5: 0x00000000017f9f12 lldb`::ParseFullNameImpl() at CPlusPlusNameParser.cpp:551                                                                                                                         
    frame #6: 0x00000000017f97d9 lldb`::ParseFunctionImpl() at CPlusPlusNameParser.cpp:114                                                                                                                         
    frame #7: 0x00000000017f96f5 lldb`::ParseAsFunctionDefinition() at CPlusPlusNameParser.cpp:45                                                                                                                  
    frame #8: 0x00000000017ec364 lldb`::Parse() at CPlusPlusLanguage.cpp:202                                                                                                                                       
    frame #9: 0x00000000017ec3e7 lldb`lldb_private::CPlusPlusLanguage::MethodName::GetBasename(void) at CPlusPlusLanguage.cpp:218                                                                                  
    frame #10: 0x00000000016ffcba lldb`::InitNameIndexes() at Symtab.cpp:294                                                                                                                                       
    frame #11: 0x00000000017008b1 lldb`::PreloadSymbols() at Symtab.cpp:407                                                                                                                                        
    frame #12: 0x00000000018dce19 lldb`::PreloadSymbols() at Module.cpp:1416                                                                                                                                       
    frame #13: 0x00000000016b1e14 lldb`::GetSharedModule() at Target.cpp:2028                                                                                                                                      
    frame #14: 0x00000000019c14ed lldb`::LoadModuleAtAddress() at DynamicLoader.cpp:171                                                                                                                            
    frame #15: 0x000000000199fd35 lldb`::LoadAllCurrentModules() at DynamicLoaderPOSIXDYLD.cpp:537                                                                                                                 
    frame #16: 0x000000000199d9aa lldb`::DidAttach() at DynamicLoaderPOSIXDYLD.cpp:171                                                                                                                             
    frame #17: 0x0000000001698231 lldb`::LoadCore() at Process.cpp:2853                                                                                                                                            
    frame #18: 0x000000000184b85d lldb`::DoExecute() at CommandObjectTarget.cpp:371                                                                                                                                
    frame #19: 0x000000000181811f lldb`::Execute() at CommandObject.cpp:991                                                                                                                                        
    frame #20: 0x00000000018268f8 lldb`::HandleCommand() at CommandInterpreter.cpp:1683                                                                                                                            
    frame #21: 0x0000000001829e2a lldb`::IOHandlerInputComplete() at CommandInterpreter.cpp:2771                                                                                                                   
    frame #22: 0x00000000018e25ff lldb`::Run() at IOHandler.cpp:573                                                                                                                                                
    frame #23: 0x000000000190ab5f lldb`::ExecuteIOHandlers() at Debugger.cpp:961                                                                                                                                   
    frame #24: 0x000000000182a9a3 lldb`::RunCommandInterpreter() at CommandInterpreter.cpp:2971                                                                                                                    
    frame #25: 0x000000000192ce29 lldb`::RunCommandInterpreter() at SBDebugger.cpp:905                                                                                                                             
    frame #26: 0x0000000001677263 lldb`::MainLoop() at Driver.cpp:1105                                                                                                                                             
    frame #27: 0x00000000016779bc lldb`main at Driver.cpp:1253                                                                                                                                                     
    frame #28: 0x0000000001674095 lldb`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1.c:74                                                                                                                
(lldb) fr s 4                                                                                                                                                                                                      
frame #4: 0x00000000017fa8e5 lldb`::ConsumeTemplateArgs() at CPlusPlusNameParser.cpp:245                                                                                                                           
   242      }                                                                                                                                                                                                      
   243    }                                                                                                                                                                                                        
   244                                                                                                                                                                                                             
-> 245    assert(template_counter >= 0);                                                                                                                                                                           
   246    if (template_counter > 0) {                                                                                                                                                                              
   247      return false;                                                                                                                                                                                          
   248    }                                                                                                                                                                                                        
(lldb) expr template_counter                                                                                                                                                                                       
error: use of undeclared identifier 'template_counter' <-- is that because of some optimizations?
(lldb)

Is that a known problem? Or maybe something wrong with my system? I
don't use lldb very often, but I don't remember it crashing like that.

Roman Bogorodskiy

Received on Mon Jan 22 2018 - 16:06:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:14 UTC