LLDB Assertion failed

Hi all,

I just compiled the lastest version of LLDB on ubuntu. But when I executed the lldb in the bin directory, it print the following and exit:

lldb: /home/szm/workSpace/studio/llvm/include/llvm/Support/CommandLine.h:673: void llvm::cl::parser::addLiteralOption(const char*, const DT&, const char*) [with DT = llvm::ScheduleDAGInstrs* ()(llvm::MachineSchedContext); DataType = llvm::ScheduleDAGInstrs* ()(llvm::MachineSchedContext)]: Assertion `findOption(Name) == Values.size() && “Option already exists!”’ failed.
Aborted (core dumped)

And the same for lldm-mi.

Also, if I create a simple program that uses LLDB API and run it, it’ll complain that:

error while loading shared libraries: liblldb.so.3.7.0: cannot open shared object file: No such file or directory

But liblldb.so.3.7.0 exists, even if I copy the file to the same directory.

Hi Ziming,

Can you share your exact checkout and build steps as a script?


I build LLDB following this tutorial on the website.

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb
cd …/…
mkdir build && cd build
cmake …/llvm
make -j4

But while executing make, I encountered an error saying:

Python script sym-linking LLDB Python API
Program error: Invalid parameters entered, -h for help.
You entered:
[’–buildConfig=’, ‘–srcRoot=/home/szm/workSpace/studio/llvm/tools/lldb’, ‘–targetDir=/home/szm/workSpace/studio/llvm-build2/tools/lldb/source/…/scripts’, ‘–cfgBldDir=/home/szm/workSpace/studio/llvm-build2/tools/lldb/source/…/scripts’, ‘–prefix=/home/szm/workSpace/studio/llvm-build2’, ‘–cmakeBuildConfiguration=.’, ‘-m’] (-1)
make[2]: *** [lib/liblldb.so.3.7.0] Error 255
make[1]: *** [tools/lldb/source/CMakeFiles/liblldb.dir/all] Error 2
make: *** [all] Error 2

But the compilation can go on if I type make again.


After a recent change, one is having to specify CMAKE_BUILD_TYPE explicitly:

cmake -DCMAKE_BUILD_TYPE=Debug ../llvm

Can you point out the change that caused that? I encountered the same issue and I’d like to take a look.

My guess would be the change that switched from shell scripts to python files to configure swig.

I think the problem is in source/CMakeLists.txt, specifically this line:

                COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py --buildConfig=${CMAKE_BUILD_TYPE} "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts" "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts" "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}" -m

The problem is "--buildConfig=${CMAKE_BUILD_TYPE}". If CMAKE_BUILD_TYPE is not set, you call finishSwigWrapperClasses.py with "--buildConfig=", which breaks the script. In my local Windows build I changed CMAKE_BUILD_TYPE to CMAKE_CFG_INTDIR. I don't know if that's correct, but it fixed my build calling the swig scripts.

That’s strange. I personally don’t specify a value for CMAKE_BUILD_TYPE, but when I look in CMakeCache.txt, I still have this line:


Do you have this line in your CMakeCache.txt and still experience this assertion?