Commit 962243c
committed
ci: trace imports and swallowed exceptions into the crash log
The stack from the last round places the fault inside an extension
module's initialisation, two exec_module frames below cuda.core._context,
but does not name it. PYTHONVERBOSE was meant to: it announces every
import, so its last line would be the module. It could not deliver --
its output goes through the interpreter's C-level stdio, which buffers
when redirected to a file, and the child's tail stopped at `import
'colorama'` several hundred lines before the crash.
The crash log does not have that problem. It is line buffered, and both
of its lines survived every run so far, so the same question goes through
that file instead. A meta path finder records each name and returns None,
leaving the real finders to do the work; because the write lands before
the module begins executing, a fault during an extension's init leaves
that module as the last IMPORT line.
sys.unraisablehook goes to the same file. A Cython `cdef ... noexcept`
function cannot propagate an exception, so one raised inside it is
printed and cleared and whatever it was computing keeps its default --
in _resource_handles.pyx, a NULL driver function pointer that faults only
when something later calls through it. Recording unraisables in sequence
with the IMPORT lines puts a swallowed error next to the module that
swallowed it. The previous hook still runs, so stderr is unchanged.
Both are off unless PYTEST_CRASHLOG is set, and tracing starts before
pytest.main because the fault happens before pytest_configure would run.1 parent 9138df0 commit 962243c
2 files changed
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
67 | 124 | | |
68 | 125 | | |
69 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
| |||
0 commit comments