[Lldb-commits] [lldb] Fix the modal private state thread we use for running expressions on the private state thread (PR #179799)

via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 6 10:04:00 PST 2026


jimingham wrote:

I'm cleaning this up.  The uninitialized variable was also unused, so it was only making UBSan unhappy, and not the functioning of the code.

Jim

> On Feb 6, 2026, at 7:08 AM, Michael Buch ***@***.***> wrote:
> 
> 
> Michael137
>  left a comment 
> (llvm/llvm-project#179799)
>  <https://github.com/llvm/llvm-project/pull/179799#issuecomment-3860967781>
> Looks like this patch is making UBSAN very unhappy: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/3799
> 
> Bunch of tests are failing with:
> 
> 11:49:38  /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/source/Target/Process.cpp:3919:52: runtime error: load of value 190, which is not a valid value for type 'bool'
> 11:49:38  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/source/Target/Process.cpp:3919:52 
> 11:49:38  PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
> 11:49:38  Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
> 11:49:38  0  liblldb.23.0.99git.dylib           0x000000013b11b2b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 268
> 11:49:38  1  liblldb.23.0.99git.dylib           0x000000013b115d08 llvm::sys::RunSignalHandlers() + 136
> 11:49:38  2  liblldb.23.0.99git.dylib           0x000000013b11d440 SignalHandler(int, __siginfo*, void*) + 1140
> 11:49:38  3  libsystem_platform.dylib           0x000000019de27744 _sigtramp + 56
> 11:49:38  4  libsystem_pthread.dylib            0x000000019de1d888 pthread_kill + 296
> 11:49:38  5  libsystem_c.dylib                  0x000000019dd22850 abort + 124
> 11:49:38  6  libclang_rt.asan_osx_dynamic.dylib 0x0000000100abc294 __sanitizer::Atexit(void (*)()) + 0
> 11:49:38  7  libclang_rt.asan_osx_dynamic.dylib 0x0000000100abb7c4 __sanitizer::Die() + 104
> 11:49:38  8  libclang_rt.asan_osx_dynamic.dylib 0x0000000100ad3fdc __ubsan_handle_implicit_conversion + 0
> 11:49:38  9  liblldb.23.0.99git.dylib           0x000000013a1dd900 std::__1::__function::__func<lldb_private::Process::PrivateStateThread::StartupThread()::$_0, std::__1::allocator<lldb_private::Process::PrivateStateThread::StartupThread()::$_0>, void* ()>::operator()() + 124
> Could you take a look?
> 
> It's pointing to following line:
> 
> bool Process::PrivateStateThread::StartupThread() {
>   llvm::Expected<HostThread> private_state_thread =
>       ThreadLauncher::LaunchThread(
>           m_thread_name,
>           [this] {
>             return m_process.RunPrivateStateThread(m_is_secondary_thread);
>           },
>           8 * 1024 * 1024);
> It's most likely because m_is_secondary_thread isn't being initialised anywhere. So we're reading garbage
> 
>> Reply to this email directly, view it on GitHub <https://github.com/llvm/llvm-project/pull/179799#issuecomment-3860967781>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ADUPVW3S3ZG5ESLJIWERJLD4KSU6XAVCNFSM6AAAAACUARGOE6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQNRQHE3DONZYGE>.
> You are receiving this because you modified the open/close state.
> 



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


More information about the lldb-commits mailing list