This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug threads/20725] New: thread_list grows very large, impacting inferior performance


https://sourceware.org/bugzilla/show_bug.cgi?id=20725

            Bug ID: 20725
           Summary: thread_list grows very large, impacting inferior
                    performance
           Product: gdb
           Version: 7.12
            Status: NEW
          Severity: normal
          Priority: P2
         Component: threads
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---

I have a test case for bug 20719 which creates and exits many threads.  When
running under GDB with a conditional breakpoint which is reached continuously
but with the condition false, each iteration of the test case runs slower and
slower.

Performance is back to the expected level after running “info threads”.

I attached to GDB itself and ran this:

def thread_list_length():
  n = 0
  p = gdb.parse_and_eval('thread_list')
  while p != 0:
    n += 1
    p = p['next']
  return n
print(thread_list_length())

As far as I can tell, thread_list grows without bounds.  Basic profiling
suggests that GDB spends a lot of time in find_thread_ptid as a result.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]