~/talk

Advanced Python Debugging Techniques Using GDB

Talkat PyOhio 2016 · 2016-07-30..07-31· [python]
links:none on file
slides:none on file

Shows how to attach gdb to a Python PID and use the cpython python-gdb support (python gdb.py) and gcore to inspect live or core-dumped interpreters, requiring debug symbols. Demonstrates concrete fixes: a 40,000-job thread pool stalls because requests has no default timeout; a custom work-queue races by checking empty then get under 10 threads; a ctypes wrapper dereferences NULL when key is None causing a segfault; a readers/writers deadlock arises when an exception leaves a lock unreleased.

AI-written summary · about

  1. 0:00Introduction to GDB
  2. 1:00The necessity of GDB
  3. 2:53GDB integration and setup
  4. 4:48Preparing production servers
  5. 7:10Debugging remote processes
  6. 9:58Core GDB commands
  7. 13:06Example 1: Network deadlock
  8. 22:29Example 2: Queue race condition
  9. 29:36Example 3: CTypes segmentation
  10. 34:08Example 4: Reader-writer deadlock
  11. 39:58Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.