Commit 5893aba
committed
gh-155725: Capture tracemalloc tracebacks without a thread state attached
Store traceback frame filenames as interned NUL terminated UTF-8 strings
instead of Python str objects, so that capturing a traceback no longer
uses or modifies Python objects. Threads without an attached thread state
now capture their Python traceback by walking the frames of the thread
state most recently bound to the thread; only threads which never had a
thread state record the traceback as "<unknown>".1 parent 69d37ec commit 5893aba
5 files changed
Lines changed: 256 additions & 87 deletions
File tree
- Doc/c-api
- Include/internal
- Lib/test
- Misc/NEWS.d/next/Core_and_Builtins
- Python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
781 | 781 | | |
782 | 782 | | |
783 | 783 | | |
784 | | - | |
785 | | - | |
786 | | - | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
787 | 788 | | |
788 | 789 | | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
| 790 | + | |
| 791 | + | |
793 | 792 | | |
794 | 793 | | |
795 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
88 | | - | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1047 | 1047 | | |
1048 | 1048 | | |
1049 | 1049 | | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
| 1050 | + | |
| 1051 | + | |
1057 | 1052 | | |
1058 | 1053 | | |
1059 | 1054 | | |
1060 | 1055 | | |
1061 | 1056 | | |
1062 | 1057 | | |
1063 | 1058 | | |
1064 | | - | |
1065 | | - | |
| 1059 | + | |
| 1060 | + | |
1066 | 1061 | | |
1067 | 1062 | | |
1068 | 1063 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments