[llvm-bugs] [Bug 36430] New: Crash after 'breakpoint delete' and 'process continue'

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Feb 18 23:37:51 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36430

            Bug ID: 36430
           Summary: Crash after 'breakpoint delete' and 'process continue'
           Product: lldb
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: dantipov at nvidia.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 19893
  --> https://bugs.llvm.org/attachment.cgi?id=19893&action=edit
Sample to debug under lldb

$ gdb -q /home/dantipov/.local/llvm-6.0.0/bin/lldb
Reading symbols from /home/dantipov/.local/llvm-6.0.0/bin/lldb...done.
(gdb) set print thread-events off
(gdb) r t-thread2
Starting program: /home/dantipov/.local/llvm-6.0.0/bin/lldb t-thread2
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
(lldb) target create "t-thread2"
Current executable set to 't-thread2' (x86_64).
(lldb) version
lldb version 6.0.0 (http://llvm.org/svn/llvm-project/lldb/tags/RELEASE_600/rc2
revision 324869)
  clang revision 324869
  llvm revision 324869
(lldb) breakpoint set -n g
Breakpoint 1: where = t-thread2`g(int) + 7 at t-thread2.cc:9, address =
0x0000000000400d0e
(lldb) run
Detaching after fork from child process 5384.
Process 5387 launched: '/home/dantipov/tmp/t-thread2' (x86_64)
Process 5387 stopped
* thread #2, name = 't-thread2', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400d0e t-thread2`g(v=0) at t-thread2.cc:9
   6    g (int v)
   7    {
   8      (void) v;
-> 9    }
   10   
   11   void
   12   f (int v)
(lldb) process continue
Process 5387 resuming
Process 5387 stopped
* thread #3, name = 't-thread2', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400d0e t-thread2`g(v=1) at t-thread2.cc:9
   6    g (int v)
   7    {
   8      (void) v;
-> 9    }
   10   
   11   void
   12   f (int v)
(lldb) breakpoint delete
About to delete all breakpoints, do you want to do that?: [Y/n] Y
All breakpoints removed. (1 breakpoint)
(lldb) process continue
Process 5387 resuming

Thread 16 "intern-state" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffc9ffb700 (LWP 5388)]
0x00007ffff02b35d8 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
147           pointer    _M_ptr() const { return std::get<0>(_M_t); }

(gdb) bt
#0  0x00007ffff02b35d8 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  0x00007ffff02b2ae0 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  0x00007ffff02b1682 in
lldb_private::BreakpointOptions::GetThreadSpecNoCreate (this=0x0)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointOptions.cpp:524
#3  0x00007ffff02a7296 in lldb_private::BreakpointLocation::ValidForThisThread
(this=0x61d980, thread=0x7fffb8003a30)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointLocation.cpp:387
#4  0x00007ffff02a9a4d in
lldb_private::BreakpointLocationCollection::ValidForThisThread (this=0x66dd90,
thread=0x7fffb8003a30)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointLocationCollection.cpp:152
#5  0x00007ffff02c1bfa in lldb_private::BreakpointSite::ValidForThisThread
(this=0x66dd40, thread=0x7fffb8003a30)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointSite.cpp:146
#6  0x00007ffff0987714 in
lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo
(this=0x64bdc0, tid=5486, 
    expedited_register_map=std::map with 24 elements = {...}, signo=5 '\005',
thread_name="t-thread2", reason="breakpoint", description="", exc_type=0, 
    exc_data=std::vector of length 0, capacity 0,
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  0x00007ffff098bb21 in
lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo
(this=0x64bdc0, stop_packet=...)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:2371
#8  0x00007ffff098bc80 in
lldb_private::process_gdb_remote::ProcessGDBRemote::RefreshStateAfterStop
(this=0x64bdc0)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:2407
#9  0x00007ffff05b45ae in lldb_private::Process::ShouldBroadcastEvent
(this=0x64bdc0, event_ptr=0x7fffc4001230)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3658
#10 0x00007ffff05b4f3f in lldb_private::Process::HandlePrivateEvent
(this=0x64bdc0, event_sp=std::shared_ptr (count 2, weak 0) 0x7fffc4001230)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3907
#11 0x00007ffff05b577b in lldb_private::Process::RunPrivateStateThread
(this=0x64bdc0, is_secondary_thread=false)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:4106
#12 0x00007ffff05b52d4 in lldb_private::Process::PrivateStateThread
(arg=0x6730d0) at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3999
#13 0x00007ffff042b509 in
lldb_private::HostNativeThreadBase::ThreadCreateTrampoline (arg=0x6733d0)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Host/common/HostNativeThreadBase.cpp:66
#14 0x00007ffff7bbd61b in start_thread (arg=0x7fffc9ffb700) at
pthread_create.c:465
#15 0x00007fffee79598f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:95

(gdb) bt full
#0  0x00007ffff02b35d8 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
No locals.
#1  0x00007ffff02b2ae0 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
No locals.
#2  0x00007ffff02b1682 in
lldb_private::BreakpointOptions::GetThreadSpecNoCreate (this=0x0)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointOptions.cpp:524
No locals.
#3  0x00007ffff02a7296 in lldb_private::BreakpointLocation::ValidForThisThread
(this=0x61d980, thread=0x7fffb8003a30)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointLocation.cpp:387
No locals.
#4  0x00007ffff02a9a4d in
lldb_private::BreakpointLocationCollection::ValidForThisThread (this=0x66dd90,
thread=0x7fffb8003a30)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointLocationCollection.cpp:152
        guard = {_M_device = @0x66dda8}
        pos = std::shared_ptr (count 1, weak 1) 0x61d980
        begin = std::shared_ptr (count 1, weak 1) 0x61d980
        end = <error reading variable: Cannot access memory at address 0x59>
#5  0x00007ffff02c1bfa in lldb_private::BreakpointSite::ValidForThisThread
(this=0x66dd40, thread=0x7fffb8003a30)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Breakpoint/BreakpointSite.cpp:146
        guard = {_M_device = @0x66ddd0}
#6  0x00007ffff0987714 in
lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo
(this=0x64bdc0, tid=5486, 
    expedited_register_map=std::map with 24 elements = {...}, signo=5 '\005',
thread_name="t-thread2", reason="breakpoint", description="", exc_type=0, 
    exc_data=std::vector of length 0, capacity 0,
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
        pc = 4197646
        bp_site_sp = std::shared_ptr (count 3, weak 1) 0x66dd40
        handled = true
        did_exec = false
        memory_thread_sp = std::shared_ptr (count 4, weak 1) 0x7fffb8003a30
        gdb_thread = 0x7fffb8003a30
        iter = 5486
        thread_sp = std::shared_ptr (count 4, weak 1) 0x7fffb8003a30
#7  0x00007ffff098bb21 in
lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo
(this=0x64bdc0, stop_packet=...)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:2371
        value = {static npos = 18446744073709551615, Data = 0x7fffc4003545
"breakpoint;", Length = 10}
        reason = "breakpoint"
        associated_with_dispatch_queue = lldb_private::eLazyBoolCalculate
        signo = 5 '\005'
        exc_type = 0
        exc_data = std::vector of length 0, capacity 0
        thread_dispatch_qaddr = 18446744073709551615
        dispatch_queue_t = 18446744073709551615
        queue_name = ""
        queue_serial_number = 0
        expedited_register_map = std::map with 24 elements = {[0] = '0'
<repeats 16 times>, [1] = "110d4", '0' <repeats 11 times>, [2] =
"504f2df7ff7f0000", 
          [3] = '0' <repeats 16 times>, [4] = '0' <repeats 16 times>, [5] =
"60ededf6ff7f0000", [6] = "90ededf6ff7f0000", [7] = "90ededf6ff7f0000", [8] =
"b4d12bf7ff7f0000", 
          [9] = "20d22bf7ff7f0000", [10] = "07", '0' <repeats 14 times>, [11] =
'0' <repeats 16 times>, [12] = "c0efedf6ff7f0000", [13] = '0' <repeats 16
times>, 
          [14] = "a0e0ffffff7f0000", [15] = "c0f9edf6ff7f0000", [16] = "0e0d4",
'0' <repeats 11 times>, [17] = "4602", '0' <repeats 12 times>, 
          [18] = "33", '0' <repeats 14 times>, [19] = '0' <repeats 16 times>,
[20] = '0' <repeats 16 times>, [21] = "2b", '0' <repeats 14 times>, [22] = '0'
<repeats 16 times>, 
          [23] = '0' <repeats 16 times>}
        thread_sp = std::shared_ptr (count 4, weak 1) 0x7fffb8003a30
        tid = 5486
        key = {static npos = 18446744073709551615, Data = 0x7fffc400353e
"reason:breakpoint;", Length = 6}
        queue_kind = lldb::eQueueKindUnknown
        stop_id = 7
        thread_name = "t-thread2"
        description = ""
        queue_vars_valid = false
        stop_type = 84 'T'
#8  0x00007ffff098bc80 in
lldb_private::process_gdb_remote::ProcessGDBRemote::RefreshStateAfterStop
(this=0x64bdc0)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:2407
        stop_info = {<StringExtractor> = {_vptr.StringExtractor =
0x7ffff7622c18 <vtable for StringExtractorGDBRemote+16>, 
            m_packet =
"T05thread:156e;hexname:742d74687265616432;threads:150b,156e,156f;jstopinfo:5b7b226e616d65223a22742d74687265616432222c22746964223a353338377d2c7b226e616d65223a22742d74687265616432222c22726561736f6e223a2"...,
m_index = 18446744073709551615}, m_validator = 0x0, m_validator_baton =
0x64c380}
        i = 0
        guard = {_M_device = @0x64cd28}
        nItems = 1
        guard = {_M_device = @0x64bfd8}
#9  0x00007ffff05b45ae in lldb_private::Process::ShouldBroadcastEvent
(this=0x64bdc0, event_ptr=0x7fffc4001230)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3658
        state = lldb::eStateStopped
        return_value = true
        log = 0x0
#10 0x00007ffff05b4f3f in lldb_private::Process::HandlePrivateEvent
(this=0x64bdc0, event_sp=std::shared_ptr (count 2, weak 0) 0x7fffc4001230)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3907
        log = 0x0
        new_state = lldb::eStateStopped
        should_broadcast = false
        __FUNCTION__ = "HandlePrivateEvent"
#11 0x00007ffff05b577b in lldb_private::Process::RunPrivateStateThread
(this=0x64bdc0, is_secondary_thread=false)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:4106
        event_sp = std::shared_ptr (count 2, weak 0) 0x7fffc4001230
        internal_state = lldb::eStateStopped
        control_only = false
        log = 0x0
        __FUNCTION__ = "RunPrivateStateThread"
        exit_now = false
        interrupt_requested = false
#12 0x00007ffff05b52d4 in lldb_private::Process::PrivateStateThread
(arg=0x6730d0) at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Target/Process.cpp:3999
        args_up =
std::unique_ptr<lldb_private::Process::PrivateStateThreadArgs> containing
0x6730d0
        result = 0x7fffc9ffaf80
#13 0x00007ffff042b509 in
lldb_private::HostNativeThreadBase::ThreadCreateTrampoline (arg=0x6733d0)
    at
/home/dantipov/llvm/6.0.0/source/tools/lldb/source/Host/common/HostNativeThreadBase.cpp:66
        info = 0x6733d0
        thread_fptr = 0x7ffff05b5288
<lldb_private::Process::PrivateStateThread(void*)>
        thread_arg = 0x6730d0
        log = 0x0
#14 0x00007ffff7bbd61b in start_thread (arg=0x7fffc9ffb700) at
pthread_create.c:465
        pd = 0x7fffc9ffb700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736582366976,
-5400878001657553863, 140736582365056, 0, 140737488331808, 140736582367680,
5400847216983858233, 
                5400895008859413561}, mask_was_saved = 0}}, priv = {pad = {0x0,
0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
#15 0x00007fffee79598f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:95

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180219/5af2adf3/attachment-0001.html>


More information about the llvm-bugs mailing list