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
Release callback dicts by registry membership, never by type-guessing
9.5.39's finalization guard missed the real bug: the crash fires during a
plain lv.deinit() call with the interpreter fully alive (gdb: the frames
above py_lvgl_deinit are PyObject_Vectorcall, not Py_FinalizeEx - atexit
hooks run before CPython sets the finalizing flag anyway). py_lv_delete_cb
sweeps every event descriptor on a dying object, including registrations
LVGL itself made, and probing a foreign C pointer with PyDict_Check reads
ob_type from non-PyObject memory - the observed segfault.
A pointer is now releasable iff this runtime recorded it when it created
the per-registration dict (both PyDict_New sites register; release is
registry-remove + DECREF; lookups replace every type probe). Foreign
user_data is never touched. The finalizing skip stays as a belt.
Proof: the analog_clock reproducer (TestPyPI pydevices-desktop + this
build, SDL_VIDEODRIVER=dummy) segfaulted rc=139 on 9.5.38/9.5.39 and now
exits 0, three runs under MALLOC_PERTURB_; suite 6/6 green.
0 commit comments