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

İsmail Dönmez ismail at donmez.ws
Tue Jul 14 03:53:59 PDT 2015


And backtrace looks like this:

#0  0x00007f80e416c638 in __GI_raise (sig=sig at entry=6) at
../sysdeps/unix/sysv/linux/raise.c:55
#1  0x00007f80e416da1a in __GI_abort () at abort.c:78
#2  0x00007f80e41653a7 in __assert_fail_base (fmt=<optimized out>,
assertion=assertion at entry=0x7f80e4db072e "!ErrorHandler && \"Error
handler already registered!\\n\"", file=file at entry=0x7f80e4db0765
"../lib/Support/ErrorHandling.cpp", line=line at entry=50,
function=function at entry=0x7f80e4db0786 "void
llvm::install_fatal_error_handler(fatal_error_handler_t, void *)") at
assert.c:92
#3  0x00007f80e4165452 in __GI___assert_fail (assertion=0x7f80e4db072e
"!ErrorHandler && \"Error handler already registered!\\n\"",
file=0x7f80e4db0765 "../lib/Support/ErrorHandling.cpp", line=50,
function=0x7f80e4db0786 "void
llvm::install_fatal_error_handler(fatal_error_handler_t, void *)") at
assert.c:101
#4  0x00007f80e4d5466a in llvm::install_fatal_error_handler
(handler=<optimized out>, user_data=<optimized out>) at
../lib/Support/ErrorHandling.cpp:50
#5  0x00007f80e56d57c7 in
lldb_private::SystemInitializerCommon::Initialize (this=<optimized
out>) at ../tools/lldb/source/Initialization/SystemInitializerCommon.cpp:101
#6  0x00007f80e54fb5cd in
lldb_private::SystemInitializerFull::Initialize (this=0x4751) at
../tools/lldb/source/API/SystemInitializerFull.cpp:226
#7  0x00007f80e56d5a3a in
lldb_private::SystemLifetimeManager::Initialize (this=<optimized out>,
initializer=..., plugin_callback=0x7f80e54c2bf0
<LoadPlugin(std::__1::shared_ptr<lldb_private::Debugger> const&,
lldb_private::FileSpec const&, lldb_private::Error&)>) at
../tools/lldb/source/Initialization/SystemLifetimeManager.cpp:43
#8  0x00007f80e54c2bc7 in lldb::SBDebugger::Initialize () at
../tools/lldb/source/API/SBDebugger.cpp:123
#9  0x00007f80e55309d8 in _wrap_SBDebugger_Initialize (args=<optimized
out>) at tools/lldb/scripts/LLDBWrapPython.cpp:23596
#10 0x00007f80df5d7fe7 in call_function (oparg=<optimized out>,
pp_stack=0x7ffc2ad26550) at Python/ceval.c:4035
#11 PyEval_EvalFrameEx () at Python/ceval.c:2681
#12 0x00007f80df5da642 in fast_function (nk=<optimized out>,
na=<optimized out>, n=0, pp_stack=0x7ffc2ad26690, func=0x7f80d8e68938)
at Python/ceval.c:4121
#13 call_function (oparg=<optimized out>, pp_stack=0x7ffc2ad26690) at
Python/ceval.c:4056
#14 PyEval_EvalFrameEx () at Python/ceval.c:2681
#15 0x00007f80df5d6862 in PyEval_EvalCodeEx () at Python/ceval.c:3267
#16 0x00007f80df5fa2a6 in PyEval_EvalCode (co=co at entry=0x7f80d8dac7b0,
globals=globals at entry=0x7f80e5e71168,
locals=locals at entry=0x7f80e5e71168) at Python/ceval.c:669
#17 0x00007f80df600be8 in PyImport_ExecCodeModuleEx () at Python/import.c:713
#18 0x00007f80df6008f7 in load_source_module () at Python/import.c:1103
#19 0x00007f80df600d37 in load_package () at Python/import.c:1170
#20 0x00007f80df5dca8d in import_submodule (fullname=0x19f4ca0 "lldb",
subname=<optimized out>, mod=0x7f80df87bf40 <_Py_NoneStruct>) at
Python/import.c:2704
#21 load_next (p_buflen=<synthetic pointer>, buf=0x19f4ca0 "lldb",
p_name=<synthetic pointer>, altmod=<optimized out>, mod=<optimized
out>) at Python/import.c:2519
#22 import_module_level (locals=<optimized out>, level=<optimized
out>, fromlist=0x7f80df87bf40 <_Py_NoneStruct>, globals=<optimized
out>, name=<optimized out>) at Python/import.c:2228
#23 PyImport_ImportModuleLevel () at Python/import.c:2292
#24 0x00007f80df5d5bf8 in builtin___import__ () at Python/bltinmodule.c:49
#25 0x00007f80df5c236b in PyObject_Call () at Objects/abstract.c:2529
#26 0x00007f80df5da890 in PyEval_CallObjectWithKeywords () at
Python/ceval.c:3904
#27 0x00007f80df5d82f7 in PyEval_EvalFrameEx () at Python/ceval.c:2348
#28 0x00007f80df5d6862 in PyEval_EvalCodeEx () at Python/ceval.c:3267
#29 0x00007f80df5fa2a6 in PyEval_EvalCode (co=co at entry=0x7f80e5f4cdb0,
globals=globals at entry=0x7f80e5f07d70,
locals=locals at entry=0x7f80e5f07d70) at Python/ceval.c:669
#30 0x00007f80df60437d in run_mod (mod=<optimized out>,
filename=filename at entry=0x7f80df60eaeb "<string>",
globals=globals at entry=0x7f80e5f07d70,
locals=locals at entry=0x7f80e5f07d70, flags=flags at entry=0x0,
arena=arena at entry=0x19c8520) at Python/pythonrun.c:1371
#31 0x00007f80df604414 in PyRun_StringFlags
(str=str at entry=0x7f80e59e2d46 "sys.dont_write_bytecode = 1; import
lldb.embedded_interpreter; from lldb.embedded_interpreter import
run_python_interpreter; from lldb.embedded_interpreter import
run_one_line", start=start at entry=257, globals=0x7f80e5f07d70,
locals=0x7f80e5f07d70, flags=flags at entry=0x0) at
Python/pythonrun.c:1334
#32 0x00007f80df5a70ed in PyRun_SimpleStringFlags
(command=0x7f80e59e2d46 "sys.dont_write_bytecode = 1; import
lldb.embedded_interpreter; from lldb.embedded_interpreter import
run_python_interpreter; from lldb.embedded_interpreter import
run_one_line", flags=0x0) at Python/pythonrun.c:975
#33 0x00007f80e5705823 in
lldb_private::ScriptInterpreterPython::InitializePrivate () at
../tools/lldb/source/Interpreter/ScriptInterpreterPython.cpp:3140
#34 0x00007f80e56d587a in
lldb_private::SystemInitializerCommon::Initialize (this=<optimized
out>) at ../tools/lldb/source/Initialization/SystemInitializerCommon.cpp:144
#35 0x00007f80e56d5a3a in
lldb_private::SystemLifetimeManager::Initialize (this=<optimized out>,
initializer=..., plugin_callback=0x0) at
../tools/lldb/source/Initialization/SystemLifetimeManager.cpp:43
#36 0x00000000004160fe in initialize () at
../tools/lldb/tools/lldb-server/lldb-server.cpp:38
#37 0x0000000000415fde in main (argc=6, argv=0x7ffc2ad26f78) 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