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
I think I have found the culprit, the offset for the __dict__ attribute was incorrect when the non-dummy ThreadChecker is used. The last field of PyCell is currently the ThreadChecker, so if both unsendable and dict are specified, the ThreadChecker takes up 8 bytes. Subtracting T::Dict::OFFSET from the size of the struct then returns a pointer to the beginning of the ThreadChecker instead of the dictionary. Moving the ThreadChecker before the WeakRef and Dict pointers in PyCell solves the segfaults. From what I can tell, this didn't cause any failing tests.
A
#[pyclass(dict, unsendable)]
crashes with a segmentation fault when trying to call a method.🌍 Environment
rustc --version
): rustc 1.44.1 (c7087fe00 2020-06-17)version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
: Yes💥 Reproducing
lib.rs
Cargo.toml
Crashing python code
backtrace
The crash occurs before the method is called, so
select_one called
is never printed.I used the following command inside the virtualenv for reproducing:
The text was updated successfully, but these errors were encountered: