llvm / llvm/llvm-project

[lldb] Sporadic crashes in `lldb_private::HostThreadPosix::Reset` in CI

Open
#191,372 3 comments 0 reactions 0 assignees View on GitHub
crash lldb
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Over the past week I've seen sporadic failures in pre-commit CI caused by a crash in `lldb_private::HostThreadPosix::Reset`. I believe I've seen the same thing on post-commit CI.

```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
#0 0x0000fffaaca21b44 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /__w/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
#1 0x0000fffaaca1efe4 store /usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/atomic:279:2
#2 0x0000fffaaca1efe4 llvm::sys::RunSignalHandlers() /__w/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:110:16
#3 0x0000fffaaca22a64 SignalHandler(int, siginfo_t*, void*) /__w/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
#4 0x0000fffab303b968 (linux-vdso.so.1+0x968)
#5 0x0000fffab2d86814 pthread_detach (/lib/aarch64-linux-gnu/libc.so.6+0x86814)
#6 0x0000fffaac2c8a54 lldb_private::HostThreadPosix::Reset() /__w/llvm-project/llvm-project/lldb/source/Host/posix/HostThreadPosix.cpp:56:25
#7 0x0000fffaac2c89c8 lldb_private::HostThreadPosix::Join(void**) /__w/llvm-project/llvm-project/lldb/source/Host/posix/HostThreadPosix.cpp:38:1
#8 0x0000fffaac25ad48 lldb_private::ThreadedCommunication::StopReadThread(lldb_private::Status*) /__w/llvm-project/llvm-project/lldb/source/Core/ThreadedCommunication.cpp:211:16
#9 0x0000fffaac3c9040 lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) /__w/llvm-project/llvm-project/lldb/source/Target/Process.cpp:3781:5
#10 0x0000fffaac3c26f4 lldb_private::Process::HandlePrivateEvent(std::shared_ptr&) /__w/llvm-project/llvm-project/lldb/source/Target/Process.cpp:4120:7
#11 0x0000fffaac3ca884 lldb_private::Process::RunPrivateStateThread() /__w/llvm-project/llvm-project/lldb/source/Target/Process.cpp:4314:41
#12 0x0000fffaac3d8488 std::_Function_handler::_M_invoke(std::_Any_data const&) /usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290:2
#13 0x0000fffaac2b6de8 ~_Function_base /usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:243:11
#14 0x0000fffaac2b6de8 ~HostThreadCreateInfo /__w/llvm-project/llvm-project/lldb/include/lldb/Host/ThreadLauncher.h:30:10
#15 0x0000fffaac2b6de8 operator() /usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:99:2
#16 0x0000fffaac2b6de8 ~unique_ptr /usr/lib/gcc/aarch64-linux-gnu/13/../../../../include/c++/13/bits/unique_ptr.h:404:4
#17 0x0000fffaac2b6de8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) /__w/llvm-project/llvm-project/lldb/source/Host/common/HostNativeThreadBase.cpp:63:1
#18 0x0000fffab2d8595c (/lib/aarch64-linux-gnu/libc.so.6+0x8595c)
#19 0x0000fffab2debb4c (/lib/aarch64-linux-gnu/libc.so.6+0xebb4c)
Fatal Python error: Segmentation fault

Thread 0x0000fffab3032720 (most recent call first):
File "/__w/llvm-project/llvm-project/build/local/lib/python3.12/dist-packages/lldb/__init__.py", line 10881 in Kill
File "/__w/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1793 in invoke
File "/__w/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2316 in tearDown
File "/usr/lib/python3.12/unittest/case.py", line 594 in _callTearDown
File "/usr/lib/python3.12/unittest/case.py", line 637 in run
File "/usr/lib/python3.12/unittest/case.py", line 690 in __call__
File "/usr/lib/python3.12/unittest/suite.py", line 122 in run
File "/usr/lib/python3.12/unittest/suite.py", line 84 in __call__
File "/usr/lib/python3.12/unittest/suite.py", line 122 in run
File "/usr/lib/python3.12/unittest/suite.py", line 84 in __call__
File "/usr/lib/python3.12/unittest/runner.py", line 240 in run
File "/__w/llvm-project/llvm-project/lldb/packages/Python/lldbsuite/test/dotest.py", line 1181 in run_suite
File "/__w/llvm-project/llvm-project/lldb/test/API/dotest.py", line 8 in
```

Example: https://github.com/llvm/llvm-project/actions/runs/24235948402/job/70758444122

Contributor guide

Open the contributing guide

Research direction

Start with lldb/source/Host/posix/HostThreadPosix.cpp at HostThreadPosix::Reset and Join, then trace the StopReadThread and process event paths named in the backtrace. Use the linked AArch64 CI run and the reported pre- or post-commit failures as reproduction evidence. Done means the sporadic CI crash is reproduced and the relevant LLDB test or CI run completes without the segmentation fault.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, github-actions, linux, python
Domain
ci-cd, devtools, operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.