Install /projects/clang900-import then $ lldb $(which true) (lldb) target create "/usr/bin/true" Current executable set to '/usr/bin/true' (x86_64). (lldb) run Expected<T> must be checked before access or destruction. Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed). #0 0x0000000003af08fe PrintStackTrace /usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:533:13 #1 0x0000000003aeeac7 RunSignalHandlers /usr/src/contrib/llvm/lib/Support/Signals.cpp:69:18 #2 0x0000000003af0fe2 SignalHandler /usr/src/contrib/llvm/lib/Support/Unix/Signals.inc:0:3 #3 0x0000000804743390 handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0:3 Stack dump: 0. Program arguments: lldb /usr/bin/true 1. HandleCommand(command = "run") Abort trap Thread 1 received signal SIGABRT, Aborted. thr_kill () at thr_kill.S:4 4 thr_kill.S: No such file or directory. (gdb) info threads Id Target Id Frame * 1 LWP 101271 of process 51644 thr_kill () at thr_kill.S:4 3 LWP 101144 of process 51644 "dbg.evt-handler" _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 (gdb) thread apply all bt full Thread 3 (LWP 101144 of process 51644): #0 _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 No locals. #1 0x000000080473f670 in _thr_umtx_timedwait_uint (mtx=0x805558020, id=<optimized out>, clockid=<optimized out>, abstime=<optimized out>, shared=<optimized out>) at /usr/src/lib/libthr/thread/thr_umtx.c:236 tm_size = <optimized out> tm_p = <optimized out> timeout = <optimized out> #2 0x000000080474948b in cond_wait_user (cvp=<optimized out>, mp=<optimized out>, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:320 curthread = 0x805527e00 deferred = <optimized out> recurse = 0 error = <optimized out> sq = <optimized out> error2 = <optimized out> #3 cond_wait_common (cond=<optimized out>, mutex=<optimized out>, abstime=0x0, cancel=1) at /usr/src/lib/libthr/thread/thr_cond.c:380 curthread = <optimized out> cvp = 0x80559c040 mp = 0x804d2dc88 error = <optimized out> #4 0x00000008047f8002 in std::__1::__libcpp_condvar_wait (__cv=0x805558020, __m=0xf) at /usr/src/contrib/libc++/include/__threading_support:295 No locals. #5 std::__1::condition_variable::wait (this=0x805558020, lk=...) at /usr/src/contrib/libc++/src/condition_variable.cpp:44 ec = <optimized out> #6 0x0000000001aba4ab in GetEventInternal () at /usr/src/contrib/llvm/tools/lldb/source/Utility/Listener.cpp:363 No locals. e::Timeout<std::__1::ratio<1l, 1000000l> > const&) () at /usr/src/contrib/llvm/tools/lldb/source/Utility/Listener.cpp:400 No locals. #8 0x00000000019c6138 in DefaultEventHandler () at /usr/src/contrib/llvm/tools/lldb/source/Core/Debugger.cpp:1572 No locals. #9 0x00000000019c6439 in lldb_private::Debugger::EventHandlerThread(void*) () at /usr/src/contrib/llvm/tools/lldb/source/Core/Debugger.cpp:1625 No locals. #10 0x0000000001f1a800 in ThreadCreateTrampoline () at /usr/src/contrib/llvm/tools/lldb/source/Host/common/HostNativeThreadBase.cpp:69 No locals. #11 0x000000080473d716 in thread_start (curthread=0x805527e00) at /usr/src/lib/libthr/thread/thr_create.c:291 set = <optimized out> #12 0x0000000000000000 in ?? () No symbol table info available. Backtrace stopped: Cannot access memory at address 0x7fffdf7fd000 Thread 1 (LWP 101271 of process 51644): #0 thr_kill () at thr_kill.S:4 No locals. #1 0x0000000804a62e64 in __raise (s=6) at /usr/src/lib/libc/gen/raise.c:52 id = 101271 #2 0x00000008049d6de9 in abort () at /usr/src/lib/libc/stdlib/abort.c:67 act = <optimized out> #3 0x00000000019c7dc2 in fatalUncheckedExpected () at /usr/src/contrib/llvm/include/llvm/Support/Error.h:664 No locals. #4 0x0000000001e16569 in assertIsChecked () at /usr/src/contrib/llvm/include/llvm/Support/Error.h:671 No locals. #5 operator-> () at /usr/src/contrib/llvm/include/llvm/Support/Error.h:561 No locals. #6 StartLaunchOpThread () at /usr/src/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp:792 No locals. #7 0x0000000001e16262 in ProcessMonitor () at /usr/src/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp:721 No locals. #8 0x0000000001e11477 in DoLaunch () at /usr/src/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp:400 No locals. #9 0x00000000019edb9f in Launch () at /usr/src/contrib/llvm/tools/lldb/source/Target/Process.cpp:2579 No locals. #10 0x0000000001a29a2c in Launch () at /usr/src/contrib/llvm/tools/lldb/source/Target/Target.cpp:2905 No locals. #11 0x0000000001b43f70 in DoExecute () at /usr/src/contrib/llvm/tools/lldb/source/Commands/CommandObjectProcess.cpp:221 No locals. #12 0x0000000001a7eb01 in Execute () at /usr/src/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp:972 No locals. #13 0x0000000001a73e03 in HandleCommand () at /usr/src/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp:1779 No locals. #14 0x0000000001a77553 in IOHandlerInputComplete () at /usr/src/contrib/llvm/tools/lldb/source/Interpreter/CommandInterpreter.cpp:2828 No locals. #15 0x0000000001a8d3dc in Run () at /usr/src/contrib/llvm/tools/lldb/source/Core/IOHandler.cpp:577 No locals. #16 0x00000000019c3f5a in ExecuteIOHandlers () at /usr/src/contrib/llvm/tools/lldb/source/Core/Debugger.cpp:995 No locals. source/Interpreter/CommandInterpreter.cpp:3039 No locals. #18 0x0000000001da631d in RunCommandInterpreter () at /usr/src/contrib/llvm/tools/lldb/source/API/SBDebugger.cpp:1103 No locals. #19 0x0000000001925b16 in MainLoop () at /usr/src/contrib/llvm/tools/lldb/tools/driver/Driver.cpp:682 No locals. #20 0x0000000001926a29 in main () at /usr/src/contrib/llvm/tools/lldb/tools/driver/Driver.cpp:889 No locals. (gdb) frame 6 #6 StartLaunchOpThread () at /usr/src/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp:792 792 if (m_operation_thread->IsJoinable()) (gdb) list 787 788 // Thread setup and tear down. 789 void ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Status &error) { 790 static const char *g_thread_name = "freebsd.op"; 791 792 if (m_operation_thread->IsJoinable()) 793 return; 794 795 m_operation_thread = 796 ThreadLauncher::LaunchThread(g_thread_name, LaunchOpThread, args); (gdb) print m_operation_thread No symbol "m_operation_thread" in current context.
A commit references this bug: Author: dim Date: Wed Oct 9 19:51:42 UTC 2019 New revision: 353363 URL: https://svnweb.freebsd.org/changeset/base/353363 Log: Put in a band-aid fix for lldb 9 exiting with "Expected<T> must be checked before access or destruction" when launching executables, while we sort this out with upstream. Reported by: jbeich PR: 241137 MFC after: 1 month X-MFC-With: r353358 Changes: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h
A commit references this bug: Author: dim Date: Thu Oct 10 20:30:55 UTC 2019 New revision: 353415 URL: https://svnweb.freebsd.org/changeset/base/353415 Log: Revert r353363 in preparation for applying upstream fix: Put in a band-aid fix for lldb 9 exiting with "Expected<T> must be checked before access or destruction" when launching executables, while we sort this out with upstream. PR: 241137 MFC after: 1 month X-MFC-With: r353358 Changes: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h
A commit references this bug: Author: dim Date: Thu Oct 10 20:33:56 UTC 2019 New revision: 353416 URL: https://svnweb.freebsd.org/changeset/base/353416 Log: Pull in r374444 from upstream lldb trunk (by me): Fix process launch failure on FreeBSD after r365761 Summary: After rLLDB365761, and with `LLVM_ENABLE_ABI_BREAKING_CHECKS` enabled, launching any process on FreeBSD crashes lldb with: ``` Expected<T> must be checked before access or destruction. Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed). ``` This is because `m_operation_thread` and `m_monitor_thread` were wrapped in `llvm::Expected<>`, but this requires the objects to be correctly initialized before accessing them. To fix the crashes, use `llvm::Optional<>` for the members (as indicated by labath), and use local variables to store the return values of `LaunchThread` and `StartMonitoringChildProcess`. Then, only assign to the member variables after checking if the return values indicated success. Reviewers: devnexen, emaste, MaskRay, mgorny Reviewed By: devnexen Subscribers: jfb, labath, krytarowski, lldb-commits Differential Revision: https://reviews.llvm.org/D68723 PR: 241137 MFC after: 1 month X-MFC-With: r353358 Changes: head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp head/contrib/llvm/tools/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.h
I think this is resolved now?