Crash in "intern-state" thread after removing breakpoints and continue

Hello,

I'm facing the following 6.0.0-rc1 crash on Linux/X86:

#0 0x00007ffff0e027b6 in std::__uniq_ptr_impl<lldb_private::ThreadSpec, std::default_delete<lldb_private::ThreadSpec> >::_M_ptr (this=0x28)
     at /usr/include/c++/7/bits/unique_ptr.h:147
#1 0x00007ffff0e01cbe in std::unique_ptr<lldb_private::ThreadSpec, std::default_delete<lldb_private::ThreadSpec> >::get (this=0x28) at /usr/include/c++/7/bits/unique_ptr.h:337
#2 0x00007ffff0e00860 in lldb_private::BreakpointOptions::GetThreadSpecNoCreate (this=0x0)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointOptions.cpp:524
#3 0x00007ffff0df6474 in lldb_private::BreakpointLocation::ValidForThisThread (this=0x61ad90, thread=0x7fffd40018f0)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointLocation.cpp:387
#4 0x00007ffff0df8c2b in lldb_private::BreakpointLocationCollection::ValidForThisThread (this=0x55e020, thread=0x7fffd40018f0)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointLocationCollection.cpp:152
#5 0x00007ffff0e10dd8 in lldb_private::BreakpointSite::ValidForThisThread (this=0x55dfd0, thread=0x7fffd40018f0)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointSite.cpp:146
#6 0x00007ffff14d602c in lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo (this=0x5f1a40, tid=27530, expedited_register_map=..., signo=5 '\005',
     thread_name=..., reason=..., description=..., exc_type=0, exc_data=..., thread_dispatch_qaddr=18446744073709551615, queue_vars_valid=false,
     associated_with_dispatch_queue=lldb_private::eLazyBoolCalculate, dispatch_queue_t=18446744073709551615, queue_name=..., queue_kind=lldb::eQueueKindUnknown, queue_serial=0)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:1880
#7 0x00007ffff14da439 in lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo (this=0x5f1a40, stop_packet=...)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:2371
#8 0x00007ffff14da598 in lldb_private::process_gdb_remote::ProcessGDBRemote::RefreshStateAfterStop (this=0x5f1a40)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:2407
#9 0x00007ffff110378c in lldb_private::Process::ShouldBroadcastEvent (this=0x5f1a40, event_ptr=0x7fffdc014a00)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3658
#10 0x00007ffff110411d in lldb_private::Process::HandlePrivateEvent (this=0x5f1a40, event_sp=...) at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3907
#11 0x00007ffff1104959 in lldb_private::Process::RunPrivateStateThread (this=0x5f1a40, is_secondary_thread=false)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:4106
#12 0x00007ffff11044b2 in lldb_private::Process::PrivateStateThread (arg=0x614210) at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3999
#13 0x00007ffff0f7a6e7 in lldb_private::HostNativeThreadBase::ThreadCreateTrampoline (arg=0x616250)
     at /home/dantipov/llvm/6.0.0/source/tools/lldb/source/Host/common/HostNativeThreadBase.cpp:66
#14 0x00007ffff7bbf36d in start_thread () from /lib64/libpthread.so.0
#15 0x00007fffef3d6b4f in clone () from /lib64/libc.so.6

Test program (bug.cc) and recipe to reproduce (bug.txt) attached.
7.0.0 SVN trunk looks also affected, but stable 5.0.1 isn't.

I've also requested an account at https://bugs.llvm.org, and will
create bug report as soon as my registration will be approved.

Dmitry

bug.cc (1.12 KB)

bug.txt (15.2 KB)