[lldb-dev] "bad_alloc" crash after downloading dependent modules.

Aidan Dodds aidan at codeplay.com
Wed Jun 10 08:12:15 PDT 2015


Hi Folks,

I have been seeing a crash when connecting lldb tip to a remote arm 
lldb-server platform running on android.
The crash occurs directly after all the remote modules have been downloaded.
I have attached a transcript of a session which shows the error and 
displays a backtrace after the crash.

The same crash can be reproduced on both linux and windows.

Might I be doing something wrong with my setup / build?
Is 32bit Arm + Android a stable target for lldb / lldb-server or is this 
somewhat unstable?

I should point out that if I connect to lldb-server in gdbserver mode 
rather then platform this problem doesn't present itself.
That's perhaps because in that case the platform defaults to 
remote-linux rather then remote-android.

Thanks,
Aidan
-------------- next part --------------
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from lldb-3.7.0...done.
(gdb) r
Starting program: /home/aidan/rs/build/bin/lldb-3.7.0 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffed0cf700 (LWP 15257)]
(lldb) platform select remote-android
  Platform: remote-android
 Connected: no
(lldb) platform connect connect://localhost:1234
  Platform: remote-android
    Triple: arm--linux-android
OS Version: 3.10.40 (3.10.40-g54c3891)
    Kernel: #1 SMP PREEMPT Wed Dec 10 21:35:39 UTC 2014
  Hostname: localhost
 Connected: yes
WorkingDir: /data
(lldb) platform process attach -p 13582
[New Thread 0x7fffe7fff700 (LWP 15261)]
[New Thread 0x7fffe77fe700 (LWP 15262)]
(lldb) terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe77fe700 (LWP 15262)]
0x00007ffff0e5acc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff0e5acc9 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff0e5e0d8 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff12496b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff1247836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff1247863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff1247aa2 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff1247f8d in operator new(unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff34a49e4 in __gnu_cxx::new_allocator<unsigned char>::allocate (this=0x7fffe77fcf00, __n=27527888509075457) at /usr/include/c++/4.8/ext/new_allocator.h:104
#8  0x00007ffff34a4653 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_allocate (this=0x7fffe77fcf00, __n=27527888509075457) at /usr/include/c++/4.8/bits/stl_vector.h:168
#9  0x00007ffff3cf0fd7 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_create_storage (this=0x7fffe77fcf00, __n=27527888509075457) at /usr/include/c++/4.8/bits/stl_vector.h:181
#10 0x00007ffff3cf0ef4 in std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_Vector_base (this=0x7fffe77fcf00, __n=27527888509075457, __a=...) at /usr/include/c++/4.8/bits/stl_vector.h:136
#11 0x00007ffff3cf0e37 in std::vector<unsigned char, std::allocator<unsigned char> >::vector (this=0x7fffe77fcf00, __n=27527888509075457, __value=@0x7fffe77fcf7c: 0 '\000', __a=...) at /usr/include/c++/4.8/bits/stl_vector.h:283
#12 0x00007ffff3cff31d in std::vector<unsigned char, std::allocator<unsigned char> >::_M_fill_assign (this=0x7fffda5a31b8, __n=27527888509075457, __val=@0x7fffe77fcf7c: 0 '\000') at /usr/include/c++/4.8/bits/vector.tcc:223
#13 0x00007ffff3cff1d1 in std::vector<unsigned char, std::allocator<unsigned char> >::assign (this=0x7fffda5a31b8, __n=27527888509075457, __val=@0x7fffe77fcf7c: 0 '\000') at /usr/include/c++/4.8/bits/stl_vector.h:480
#14 0x00007ffff3cfee95 in lldb_private::DataBufferHeap::DataBufferHeap (this=0x7fffda5a31b0, n=27527888509075457, ch=0 '\000') at /home/aidan/rs/llvm/tools/lldb/source/Core/DataBufferHeap.cpp:30
#15 0x00007ffff3d4de68 in lldb_private::Module::GetMemoryObjectFile (this=0x7fffda620bd0, process_sp=..., header_addr=2676928512, error=..., size_to_read=27527888509075457) at /home/aidan/rs/llvm/tools/lldb/source/Core/Module.cpp:359
#16 0x00007ffff3f347ad in lldb_private::Process::ReadModuleFromMemory (this=0x7e5100, file_spec=..., header_addr=2676928512, size_to_read=27527888509075457) at /home/aidan/rs/llvm/tools/lldb/source/Target/Process.cpp:3034
#17 0x00007ffff4158877 in JITLoaderGDB::ReadJITDescriptorImpl<unsigned int> (this=0x7fffd800ad00, all_entries=true) at /home/aidan/rs/llvm/tools/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp:272
#18 0x00007ffff4157607 in JITLoaderGDB::ReadJITDescriptor (this=0x7fffd800ad00, all_entries=true) at /home/aidan/rs/llvm/tools/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp:209
#19 0x00007ffff4157216 in JITLoaderGDB::SetJITBreakpoint (this=0x7fffd800ad00, module_list=...) at /home/aidan/rs/llvm/tools/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp:137
#20 0x00007ffff4157011 in JITLoaderGDB::ModulesDidLoad (this=0x7fffd800ad00, module_list=...) at /home/aidan/rs/llvm/tools/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp:91
#21 0x00007ffff3fa500f in lldb_private::JITLoaderList::ModulesDidLoad (this=0x7fffd80093d0, module_list=...) at /home/aidan/rs/llvm/tools/lldb/source/Target/JITLoaderList.cpp:76
#22 0x00007ffff3f3d960 in lldb_private::Process::ModulesDidLoad (this=0x7e5100, module_list=...) at /home/aidan/rs/llvm/tools/lldb/source/Target/Process.cpp:6478
#23 0x00007ffff3f6ba7b in lldb_private::Target::ModulesDidLoad (this=0x7f25c0, module_list=...) at /home/aidan/rs/llvm/tools/lldb/source/Target/Target.cpp:1289
#24 0x00007ffff3f6b883 in lldb_private::Target::ModuleAdded (this=0x7f25c0, module_list=..., module_sp=...) at /home/aidan/rs/llvm/tools/lldb/source/Target/Target.cpp:1257
#25 0x00007ffff3d58619 in lldb_private::ModuleList::AppendImpl (this=0x7f28a0, module_sp=..., use_notifier=true) at /home/aidan/rs/llvm/tools/lldb/source/Core/ModuleList.cpp:111
#26 0x00007ffff3d58650 in lldb_private::ModuleList::Append (this=0x7f28a0, module_sp=...) at /home/aidan/rs/llvm/tools/lldb/source/Core/ModuleList.cpp:118
#27 0x00007ffff3f6d42e in lldb_private::Target::GetSharedModule (this=0x7f25c0, module_spec=..., error_ptr=0x0) at /home/aidan/rs/llvm/tools/lldb/source/Target/Target.cpp:1813
#28 0x00007ffff4224df1 in lldb_private::DynamicLoader::LoadModuleAtAddress (this=0x7fffd8009710, file=..., link_map_addr=3049056968, base_addr=3032113152) at /home/aidan/rs/llvm/tools/lldb/source/Core/DynamicLoader.cpp:185
#29 0x00007ffff402dfb2 in DynamicLoaderPOSIXDYLD::LoadAllCurrentModules (this=0x7fffd8009710) at /home/aidan/rs/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:530
#30 0x00007ffff402c743 in DynamicLoaderPOSIXDYLD::DidAttach (this=0x7fffd8009710) at /home/aidan/rs/llvm/tools/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp:183
#31 0x00007ffff3f36849 in lldb_private::Process::CompleteAttach (this=0x7e5100) at /home/aidan/rs/llvm/tools/lldb/source/Target/Process.cpp:3627
#32 0x00007ffff3f3593c in lldb_private::Process::AttachCompletionHandler::PerformAction (this=0x804e30, event_sp=...) at /home/aidan/rs/llvm/tools/lldb/source/Target/Process.cpp:3378
#33 0x00007ffff3f3898f in lldb_private::Process::HandlePrivateEvent (this=0x7e5100, event_sp=...) at /home/aidan/rs/llvm/tools/lldb/source/Target/Process.cpp:4420
#34 0x00007ffff3f390da in lldb_private::Process::RunPrivateStateThread (this=0x7e5100) at /home/aidan/rs/llvm/tools/lldb/source/Target/Process.cpp:4614
#35 0x00007ffff3f38d84 in lldb_private::Process::PrivateStateThread (arg=0x7e5100) at /home/aidan/rs/llvm/tools/lldb/source/Target/Process.cpp:4538
#36 0x00007ffff3ce9bbf in lldb_private::HostNativeThreadBase::ThreadCreateTrampoline (arg=0x804e10) at /home/aidan/rs/llvm/tools/lldb/source/Host/common/HostNativeThreadBase.cpp:81
#37 0x00007ffff14f5182 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#38 0x00007ffff0f1e47d in clone () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) 


More information about the lldb-dev mailing list