[lldb-dev] SystemInitializerCommon::Initialize called twice with shared llvm build

Pavel Labath labath at google.com
Tue Jul 14 08:03:31 PDT 2015


Hi,

I have tried to follow your setup as closely as possible and I still
am not able to reproduce this. :/

Also, the backtrace you provided are quite strange also. The first one
terminates and lldb-server main, while the second one ends in lldb.
This is to be expected if they are from different processes since both
of them do initialization. Are you sure these backtraces are from the
same process? If so, then please find out why are both main()
functions being executed.

pl


On 14 July 2015 at 12:04, İsmail Dönmez <ismail at donmez.ws> wrote:
> And setting a break point on
> lldb_private::SystemInitializerCommon::Initialize() shows that 2
> initializations indeed:
>
> First one:
>
> #0  lldb_private::SystemInitializerCommon::Initialize (this=0x1ccec10)
> at ../tools/lldb/source/Initialization/SystemInitializerCommon.cpp:96
> #1  0x00007f76d64385cd in
> lldb_private::SystemInitializerFull::Initialize (this=0x1ccec10) at
> ../tools/lldb/source/API/SystemInitializerFull.cpp:226
> #2  0x00007f76d6612a3a in
> lldb_private::SystemLifetimeManager::Initialize (this=<optimized out>,
> initializer=..., plugin_callback=0x7f76d63ffbf0
> <LoadPlugin(std::__1::shared_ptr<lldb_private::Debugger> const&,
> lldb_private::FileSpec const&, lldb_private::Error&)>) at
> ../tools/lldb/source/Initialization/SystemLifetimeManager.cpp:43
> #3  0x00007f76d63ffbc7 in lldb::SBDebugger::Initialize () at
> ../tools/lldb/source/API/SBDebugger.cpp:123
> #4  0x00000000004063bb in main (argc=1, argv=0x7ffc50c8c948,
> envp=0x7f76d6438f80 <LLDBSwigPythonWatchpointCallbackFunction(char
> const*, char const*, lldb::StackFrameSP const&, lldb::WatchpointSP
> const&)>) at ../tools/lldb/tools/driver/Driver.cpp:1223
>
> Second one (this happens after I do "file ls" and "r") :
>
> #0  lldb_private::SystemInitializerCommon::Initialize (this=0x1096850)
> at ../tools/lldb/source/Initialization/SystemInitializerCommon.cpp:96
> #1  0x00007f11ba252a3a in
> lldb_private::SystemLifetimeManager::Initialize (this=<optimized out>,
> initializer=..., plugin_callback=0x0) at
> ../tools/lldb/source/Initialization/SystemLifetimeManager.cpp:43
> #2  0x00000000004160fe in initialize () at
> ../tools/lldb/tools/lldb-server/lldb-server.cpp:38
> #3  0x0000000000415fde in main (argc=6, argv=0x7ffc6179b168) at
> ../tools/lldb/tools/lldb-server/lldb-server.cpp:62
>
>
>
> On Tue, Jul 14, 2015 at 1:44 PM, İsmail Dönmez <ismail at donmez.ws> wrote:
>> Hi,
>>
>> On Tue, Jul 14, 2015 at 1:41 PM, Pavel Labath <labath at google.com> wrote:
>>> Hi,
>>>
>>> i've just tried a cmake build with BUILD_SHARED_LIBS=1 and it seems to
>>> work for me. Could you share the exact command you use to build? Also,
>>> are you using the latest version from svn?
>>
>> Yes this is the latest version from svn, but note that I build lldb
>> together with llvm/clang and compiler-rt, exact command line is:
>>
>> cmake -G "Ninja" \
>>     -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>>     -DBUILD_SHARED_LIBS=ON \
>>     -DLLVM_LIBDIR_SUFFIX=64 \
>>     -DLLVM_REQUIRES_RTTI=ON \
>>     -DLLVM_ENABLE_TIMESTAMPS=OFF \
>>     -DLLVM_ENABLE_ASSERTIONS=ON \
>>     -DLLVM_ENABLE_PIC=ON \
>>     -DLLVM_BINUTILS_INCDIR=/usr/include \
>>     -DLLVM_TARGETS_TO_BUILD=host \
>>     -DLLVM_ENABLE_FFI=ON \
>>     -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp \
>>     -DLLVM_ENABLE_LIBCXX=ON \
>>     ..




More information about the lldb-dev mailing list