You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The import dtrace hooks pass call PyUnicode_AsUTF8 and pass the value to the probe without checking if the conversion succeeded, now dtrace doesn't seem to mind getting a null pointer (I don't know much about how that bit works tbh), but a stale exception is left around which triggers a debug assert:
Crash report
What happened?
This one is a bit niche! It also needs a python compiled with
--with-dtraceprobe.d:
test.py:
The import dtrace hooks pass call PyUnicode_AsUTF8 and pass the value to the probe without checking if the conversion succeeded, now dtrace doesn't seem to mind getting a null pointer (I don't know much about how that bit works tbh), but a stale exception is left around which triggers a debug assert:
cpython/Python/import.c
Lines 4106 to 4107 in e8158d1
Caution
EDIT: I found some more cases of drace code doing the same, This isn't just limited to import machinery:
cpython/Python/ceval.c
Lines 1198 to 1225 in 91d71dd
If I find more, I'll add them
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Output from running 'python -VV' on the command line:
Python 3.16.0a0 (heads/main:e8158d1a02d, Aug 20 2026, 15:09:24) [Clang 21.0.0 (clang-2100.3.27.1)]