Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lldb crashes when running tests in API/commands/expression/import-std-module/ on MacOS #92325

Open
ZequanWu opened this issue May 15, 2024 · 1 comment
Labels

Comments

@ZequanWu
Copy link
Contributor

Context: #90663 (comment)
Repro steps:

$ autoninja -C out/cmake check-lldb
...
********************
UNRESOLVED: lldb-api :: commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py (3 of 1175)
******************** TEST 'lldb-api :: commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py' FAILED ********************
Script:
--
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/zequanwu/work/llvm/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Users/zequanwu/work/llvm/out/cmake/./bin/llvm-objcopy --env LLVM_LIBS_DIR=/Users/zequanwu/work/llvm/out/cmake/./lib --env LLVM_INCLUDE_DIR=/Users/zequanwu/work/llvm/out/cmake/include --env LLVM_TOOLS_DIR=/Users/zequanwu/work/llvm/out/cmake/./bin --libcxx-include-dir /Users/zequanwu/work/llvm/out/cmake/include/c++/v1 --libcxx-library-dir /Users/zequanwu/work/llvm/out/cmake/lib --arch arm64 --build-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex --lldb-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/zequanwu/work/llvm/out/cmake/./bin/lldb --compiler /Users/zequanwu/work/llvm/out/cmake/./bin/clang --dsymutil /Users/zequanwu/work/llvm/out/cmake/./bin/dsymutil --llvm-tools-dir /Users/zequanwu/work/llvm/out/cmake/./bin --lldb-obj-root /Users/zequanwu/work/llvm/out/cmake/tools/lldb --lldb-libs-dir /Users/zequanwu/work/llvm/out/cmake/./lib /Users/zequanwu/work/llvm/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content -p TestDbgInfoContentDequeFromStdModule.py
--
Exit Code: -6

Command Output (stdout):
--
lldb version 19.0.0git ([email protected]:ZequanWu/llvm-project.git revision e1ed138a67a92ef1ff0214ca198094be13045090)
  clang revision e1ed138a67a92ef1ff0214ca198094be13045090
  llvm revision e1ed138a67a92ef1ff0214ca198094be13045090

--
Command Output (stderr):
--
Assertion failed: (0 && "Invalid SLocOffset or bad function choice"), function getFileIDLoaded, file SourceManager.cpp, line 865.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

--

********************
UNRESOLVED: lldb-api :: commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py (6 of 1175)
******************** TEST 'lldb-api :: commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py' FAILED ********************
Script:
--
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/zequanwu/work/llvm/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Users/zequanwu/work/llvm/out/cmake/./bin/llvm-objcopy --env LLVM_LIBS_DIR=/Users/zequanwu/work/llvm/out/cmake/./lib --env LLVM_INCLUDE_DIR=/Users/zequanwu/work/llvm/out/cmake/include --env LLVM_TOOLS_DIR=/Users/zequanwu/work/llvm/out/cmake/./bin --libcxx-include-dir /Users/zequanwu/work/llvm/out/cmake/include/c++/v1 --libcxx-library-dir /Users/zequanwu/work/llvm/out/cmake/lib --arch arm64 --build-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex --lldb-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/zequanwu/work/llvm/out/cmake/./bin/lldb --compiler /Users/zequanwu/work/llvm/out/cmake/./bin/clang --dsymutil /Users/zequanwu/work/llvm/out/cmake/./bin/dsymutil --llvm-tools-dir /Users/zequanwu/work/llvm/out/cmake/./bin --lldb-obj-root /Users/zequanwu/work/llvm/out/cmake/tools/lldb --lldb-libs-dir /Users/zequanwu/work/llvm/out/cmake/./lib /Users/zequanwu/work/llvm/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content -p TestDbgInfoContentListFromStdModule.py
--
Exit Code: -6

Command Output (stdout):
--
lldb version 19.0.0git ([email protected]:ZequanWu/llvm-project.git revision e1ed138a67a92ef1ff0214ca198094be13045090)
  clang revision e1ed138a67a92ef1ff0214ca198094be13045090
  llvm revision e1ed138a67a92ef1ff0214ca198094be13045090

--
Command Output (stderr):
--
Assertion failed: (0 && "Invalid SLocOffset or bad function choice"), function getFileIDLoaded, file SourceManager.cpp, line 865.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

--

********************
UNRESOLVED: lldb-api :: commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py (7 of 1175)
******************** TEST 'lldb-api :: commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py' FAILED ********************
Script:
--
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/zequanwu/work/llvm/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Users/zequanwu/work/llvm/out/cmake/./bin/llvm-objcopy --env LLVM_LIBS_DIR=/Users/zequanwu/work/llvm/out/cmake/./lib --env LLVM_INCLUDE_DIR=/Users/zequanwu/work/llvm/out/cmake/include --env LLVM_TOOLS_DIR=/Users/zequanwu/work/llvm/out/cmake/./bin --libcxx-include-dir /Users/zequanwu/work/llvm/out/cmake/include/c++/v1 --libcxx-library-dir /Users/zequanwu/work/llvm/out/cmake/lib --arch arm64 --build-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex --lldb-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/zequanwu/work/llvm/out/cmake/./bin/lldb --compiler /Users/zequanwu/work/llvm/out/cmake/./bin/clang --dsymutil /Users/zequanwu/work/llvm/out/cmake/./bin/dsymutil --llvm-tools-dir /Users/zequanwu/work/llvm/out/cmake/./bin --lldb-obj-root /Users/zequanwu/work/llvm/out/cmake/tools/lldb --lldb-libs-dir /Users/zequanwu/work/llvm/out/cmake/./lib /Users/zequanwu/work/llvm/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content -p TestDbgInfoContentVectorFromStdModule.py
--
Exit Code: -6

Command Output (stdout):
--
lldb version 19.0.0git ([email protected]:ZequanWu/llvm-project.git revision e1ed138a67a92ef1ff0214ca198094be13045090)
  clang revision e1ed138a67a92ef1ff0214ca198094be13045090
  llvm revision e1ed138a67a92ef1ff0214ca198094be13045090

--
Command Output (stderr):
--
Assertion failed: (0 && "Invalid SLocOffset or bad function choice"), function getFileIDLoaded, file SourceManager.cpp, line 865.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

--

This repros on trunk version. My cmake invocation is:

cmake -GNinja -B out/cmake \
      -DCMAKE_BUILD_TYPE=Release \
      -DLLVM_ENABLE_ASSERTIONS=ON \
      -DLLVM_ENABLE_PROJECTS='clang;lld;lldb;compiler-rt' \
      -DCMAKE_C_COMPILER=$CLANG_BASE_PATH/bin/clang \
      -DCMAKE_CXX_COMPILER=$CLANG_BASE_PATH/bin/clang++ \
      -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk \
      -DDARWIN_macosx_CACHED_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk\
      -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'\
      -DLLDB_ENABLE_PYTHON=ON \
      llvm

I guess it has the same underlying issue for the crash I see when running check-lldb with change #90663.

@ZequanWu ZequanWu added the lldb label May 15, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented May 15, 2024

@llvm/issue-subscribers-lldb

Author: Zequan Wu (ZequanWu)

Context: https://github.com//pull/90663#issuecomment-2113578107 Repro steps: ``` $ autoninja -C out/cmake check-lldb ... ******************** UNRESOLVED: lldb-api :: commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py (3 of 1175) ******************** TEST 'lldb-api :: commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py' FAILED ******************** Script: -- /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/zequanwu/work/llvm/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Users/zequanwu/work/llvm/out/cmake/./bin/llvm-objcopy --env LLVM_LIBS_DIR=/Users/zequanwu/work/llvm/out/cmake/./lib --env LLVM_INCLUDE_DIR=/Users/zequanwu/work/llvm/out/cmake/include --env LLVM_TOOLS_DIR=/Users/zequanwu/work/llvm/out/cmake/./bin --libcxx-include-dir /Users/zequanwu/work/llvm/out/cmake/include/c++/v1 --libcxx-library-dir /Users/zequanwu/work/llvm/out/cmake/lib --arch arm64 --build-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex --lldb-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/zequanwu/work/llvm/out/cmake/./bin/lldb --compiler /Users/zequanwu/work/llvm/out/cmake/./bin/clang --dsymutil /Users/zequanwu/work/llvm/out/cmake/./bin/dsymutil --llvm-tools-dir /Users/zequanwu/work/llvm/out/cmake/./bin --lldb-obj-root /Users/zequanwu/work/llvm/out/cmake/tools/lldb --lldb-libs-dir /Users/zequanwu/work/llvm/out/cmake/./lib /Users/zequanwu/work/llvm/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content -p TestDbgInfoContentDequeFromStdModule.py -- Exit Code: -6

Command Output (stdout):

lldb version 19.0.0git ([email protected]:ZequanWu/llvm-project.git revision e1ed138)
clang revision e1ed138
llvm revision e1ed138

--
Command Output (stderr):

Assertion failed: (0 && "Invalid SLocOffset or bad function choice"), function getFileIDLoaded, file SourceManager.cpp, line 865.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

--


UNRESOLVED: lldb-api :: commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py (6 of 1175)
******************** TEST 'lldb-api :: commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py' FAILED ********************
Script:

/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/zequanwu/work/llvm/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Users/zequanwu/work/llvm/out/cmake/./bin/llvm-objcopy --env LLVM_LIBS_DIR=/Users/zequanwu/work/llvm/out/cmake/./lib --env LLVM_INCLUDE_DIR=/Users/zequanwu/work/llvm/out/cmake/include --env LLVM_TOOLS_DIR=/Users/zequanwu/work/llvm/out/cmake/./bin --libcxx-include-dir /Users/zequanwu/work/llvm/out/cmake/include/c++/v1 --libcxx-library-dir /Users/zequanwu/work/llvm/out/cmake/lib --arch arm64 --build-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex --lldb-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/zequanwu/work/llvm/out/cmake/./bin/lldb --compiler /Users/zequanwu/work/llvm/out/cmake/./bin/clang --dsymutil /Users/zequanwu/work/llvm/out/cmake/./bin/dsymutil --llvm-tools-dir /Users/zequanwu/work/llvm/out/cmake/./bin --lldb-obj-root /Users/zequanwu/work/llvm/out/cmake/tools/lldb --lldb-libs-dir /Users/zequanwu/work/llvm/out/cmake/./lib /Users/zequanwu/work/llvm/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content -p TestDbgInfoContentListFromStdModule.py

Exit Code: -6

Command Output (stdout):

lldb version 19.0.0git ([email protected]:ZequanWu/llvm-project.git revision e1ed138)
clang revision e1ed138
llvm revision e1ed138

--
Command Output (stderr):

Assertion failed: (0 && "Invalid SLocOffset or bad function choice"), function getFileIDLoaded, file SourceManager.cpp, line 865.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

--


UNRESOLVED: lldb-api :: commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py (7 of 1175)
******************** TEST 'lldb-api :: commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py' FAILED ********************
Script:

/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/zequanwu/work/llvm/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=/Users/zequanwu/work/llvm/out/cmake/./bin/llvm-objcopy --env LLVM_LIBS_DIR=/Users/zequanwu/work/llvm/out/cmake/./lib --env LLVM_INCLUDE_DIR=/Users/zequanwu/work/llvm/out/cmake/include --env LLVM_TOOLS_DIR=/Users/zequanwu/work/llvm/out/cmake/./bin --libcxx-include-dir /Users/zequanwu/work/llvm/out/cmake/include/c++/v1 --libcxx-library-dir /Users/zequanwu/work/llvm/out/cmake/lib --arch arm64 --build-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex --lldb-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/zequanwu/work/llvm/out/cmake/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/zequanwu/work/llvm/out/cmake/./bin/lldb --compiler /Users/zequanwu/work/llvm/out/cmake/./bin/clang --dsymutil /Users/zequanwu/work/llvm/out/cmake/./bin/dsymutil --llvm-tools-dir /Users/zequanwu/work/llvm/out/cmake/./bin --lldb-obj-root /Users/zequanwu/work/llvm/out/cmake/tools/lldb --lldb-libs-dir /Users/zequanwu/work/llvm/out/cmake/./lib /Users/zequanwu/work/llvm/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content -p TestDbgInfoContentVectorFromStdModule.py

Exit Code: -6

Command Output (stdout):

lldb version 19.0.0git ([email protected]:ZequanWu/llvm-project.git revision e1ed138)
clang revision e1ed138
llvm revision e1ed138

--
Command Output (stderr):

Assertion failed: (0 && "Invalid SLocOffset or bad function choice"), function getFileIDLoaded, file SourceManager.cpp, line 865.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

--


This repros on trunk version. My cmake invocation is:

cmake -GNinja -B out/cmake
-DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_ASSERTIONS=ON
-DLLVM_ENABLE_PROJECTS='clang;lld;lldb;compiler-rt'
-DCMAKE_C_COMPILER=$CLANG_BASE_PATH/bin/clang
-DCMAKE_CXX_COMPILER=$CLANG_BASE_PATH/bin/clang++
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
-DDARWIN_macosx_CACHED_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'
-DLLDB_ENABLE_PYTHON=ON
llvm


I guess it has the same underlying issue for the crash I see when running check-lldb with change https://github.com/llvm/llvm-project/pull/90663.
</details>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants