[Lldb-commits] [lldb] [lldb] Don't rely on ScriptInterpreterPythonImpl::Initialize in the unit tests (PR #82096)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 21 09:01:06 PST 2024


DavidSpickett wrote:

This change has caused a failing test on Linux: https://lab.llvm.org/buildbot/#/builders/68/builds/69157

That's not the first build, because the bot was red for ages beforehand and I'm not going to check them all. I've bisected it on arm64 instead to confirm it and get a better traceback:
```
******************** TEST 'lldb-unit :: ScriptInterpreter/Python/./ScriptInterpreterPythonTests/32/39' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/david.spickett/build-llvm-aarch64/tools/lldb/unittests/ScriptInterpreter/Python/./ScriptInterpreterPythonTests-lldb-unit-831825-32-39.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=39 GTEST_SHARD_INDEX=32 /home/david.spickett/build-llvm-aarch64/tools/lldb/unittests/ScriptInterpreter/Python/./ScriptInterpreterPythonTests
--

Note: This is test shard 33 of 39.
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from PythonDataObjectsTest
[ RUN      ] PythonDataObjectsTest.TestPythonFile
/usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/optional:477: _Tp &std::_Optional_base_impl<lldb_private::FileSystem, std::_Optional_base<lldb_private::FileSystem, false, false>>::_M_get() [_Tp = lldb_private::FileSystem, _Dp = std::_Optional_base<lldb_private::FileSystem, false, false>]: Assertion 'this->_M_is_engaged()' failed.
 #0 0x0000aaaac51c9630 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/david.spickett/build-llvm-aarch64/tools/lldb/unittests/ScriptInterpreter/Python/./ScriptInterpreterPythonTests+0xaf630)
 #1 0x0000aaaac51c792c llvm::sys::RunSignalHandlers() (/home/david.spickett/build-llvm-aarch64/tools/lldb/unittests/ScriptInterpreter/Python/./ScriptInterpreterPythonTests+0xad92c)
 #2 0x0000aaaac51ca088 SignalHandler(int) (/home/david.spickett/build-llvm-aarch64/tools/lldb/unittests/ScriptInterpreter/Python/./ScriptInterpreterPythonTests+0xb0088)
 #3 0x0000ffffac90c5c0 (linux-vdso.so.1+0x5c0)
 #4 0x0000ffffabba9d78 raise /build/glibc-RIFKjK/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x0000ffffabb96aac abort /build/glibc-RIFKjK/glibc-2.31/stdlib/abort.c:81:7
 #6 0x0000ffffabde95d8 std::__glibcxx_assert_fail(char const*, int, char const*, char const*) (/lib/aarch64-linux-gnu/libstdc++.so.6+0xd75d8)
 #7 0x0000aaaac51fa924 lldb_private::FileSystem::Instance() (/home/david.spickett/build-llvm-aarch64/tools/lldb/unittests/ScriptInterpreter/Python/./ScriptInterpreterPythonTests+0xe0924)
 #8 0x0000aaaac5180b60 PythonDataObjectsTest_TestPythonFile_Test::TestBody() (/home/david.spickett/build-llvm-aarch64/tools/lldb/unittests/ScriptInterpreter/Python/./ScriptInterpreterPythonTests+0x66b60)
```

Seems like this Initialize had some side effects beyond Python itself?

https://github.com/llvm/llvm-project/pull/82096


More information about the lldb-commits mailing list