Commit 27434c6
authored
When using blocking mode in the remote debugging profiler, ptrace calls
to seize threads can fail with EPERM if the thread has exited between
listing and attaching, is in a special kernel state, or is already being
traced. Previously this raised a RuntimeError that was caught by the
Python sampling loop,and retried indefinitely since EPERM is
a persistent condition that will not resolve on its own.
Treat EPERM the same as ESRCH by returning 1 (skip this thread) instead
of -1 (fatal error). This allows profiling to continue with the threads
that can be traced rather than entering an endless retry loop printing
the same error message repeatedly.
1 parent 2c39b9d commit 27434c6
File tree
2 files changed
+11
-2
lines changed- Misc/NEWS.d/next/Library
- Modules/_remote_debugging
2 files changed
+11
-2
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
635 | 641 | | |
636 | 642 | | |
637 | 643 | | |
638 | 644 | | |
639 | 645 | | |
640 | 646 | | |
641 | 647 | | |
642 | | - | |
643 | | - | |
| 648 | + | |
| 649 | + | |
644 | 650 | | |
645 | 651 | | |
646 | 652 | | |
| |||
0 commit comments