-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyo3: bump to version 0.14.0 #6154
Conversation
You're not dependabot! |
Uh oh, segfault! Bug in the new pyo3? |
9aa7c6f
to
d235357
Compare
Maybe, trying to isolate what's happening. |
Looks like the failure is pypy specific. |
d235357
to
e2ad0ef
Compare
Yeah, this is the backtrace I'm seeing: (lldb) bt all
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
* frame #0: 0x00000001063613f8 _rust.pypy37-pp73-darwin.so`pyo3::types::list::_$LT$impl$u20$pyo3..conversion..IntoPy$LT$pyo3..instance..Py$LT$pyo3..types..any..PyAny$GT$$GT$$u20$for$u20$alloc..vec..Vec$LT$T$GT$$GT$::into_py::h296574e22a733a5d + 104
frame #1: 0x000000010634bcce _rust.pypy37-pp73-darwin.so`cryptography_rust::asn1::_$LT$impl$u20$pyo3..class..impl_..PyClassDescriptors$LT$cryptography_rust..asn1..TestCertificate$GT$$u20$for$u20$pyo3..class..impl_..PyClassImplCollector$LT$cryptography_rust..asn1..TestCertificate$GT$$GT$::py_class_descriptors::METHODS::__wrap::_$u7b$$u7b$closure$u7d$$u7d$::hf8a4c5bfd6f9f5c5 (.llvm.16029029693464088663) + 382
frame #2: 0x0000000106349164 _rust.pypy37-pp73-darwin.so`cryptography_rust::asn1::_$LT$impl$u20$pyo3..class..impl_..PyClassDescriptors$LT$cryptography_rust..asn1..TestCertificate$GT$$u20$for$u20$pyo3..class..impl_..PyClassImplCollector$LT$cryptography_rust..asn1..TestCertificate$GT$$GT$::py_class_descriptors::METHODS::__wrap::h87cc0ef8b89c0036 (.llvm.6430969857765583387) + 116
frame #3: 0x0000000100804748 libpypy3-c.dylib`___lldb_unnamed_symbol17573$$libpypy3-c.dylib + 144 |
I guess the next step would be to try to minimize this and report to pyo3. (cc: @davidhewitt) |
This should reproduce it:
|
FYI this probably isn't limited to pypy, I've reproduced a crash locally with cpython 3.8 and 3.9. Working on getting traces from that. |
Hmm, is this test supposed to crash a python process?
|
nope
…On Sat, Jul 3, 2021 at 10:50 PM James Hilliard ***@***.***> wrote:
Hmm, is this test supposed to crash a python process?
pytest tests/hazmat/backends/test_openssl_memleak.py::TestAssertNoMemoryLeaks::test_errors
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
--
All that is necessary for evil to succeed is for good people to do nothing.
|
Hmm, well that one crashes on cpython...but the test still passes somehow, weird. |
Uh oh; thanks for reporting! I'll start investigation now... |
I think this one's not related to PyO3. It looks like I'm able to get this minimal repro to segfault on from cryptography.hazmat.bindings._openssl import ffi, lib
@ffi.callback("void *(size_t, const char *, int)")
def malloc(size, path, line):
ptr = lib.Cryptography_malloc_wrapper(size, path, line)
return ptr
@ffi.callback("void *(void *, size_t, const char *, int)")
def realloc(ptr, size, path, line):
new_ptr = lib.Cryptography_realloc_wrapper(ptr, size, path, line)
return new_ptr
@ffi.callback("void(void *, const char *, int)")
def free(ptr, path, line):
pass
result = lib.Cryptography_CRYPTO_set_mem_functions(malloc, realloc, free)
assert result == 1
# Trigger a bunch of initialization stuff.
from cryptography.hazmat.backends.openssl.backend import backend
raise ZeroDivisionError Backtrace for that one suggests
Wild guess: it's running cleanup after the interpreter has finalized, but because of the installed memory functions it's invoking now-dead Python objects? Anyway, I'll swap to look at the other test instead now... |
I can also repro the PyPy crash. This is the top of the backtrace:
Looks like PyO3/pyo3#1664 is probably the cause of the breakage. I think Gotta take the dog for a morning walk and then will prepare a patchfix when I get back! 🐶 |
Can you try with PyO3/pyo3#1713, to make sure this fixes it? |
Locally it seems to fix it for me (though I only ran the failing test rather than the full CI). I think it's worth moving ahead with PyO3 0.14.1. |
Yeah, are you planning to put that up as a hotfix release shortly? |
Shall we do a test run here, with CI pointed at git? |
Sure, not exactly sure how to actually do that, you should be able to push to my branch though. |
Done! |
Ok, we appear green here. This will be mergable once 0.14.1 is released. Thanks for everyone's work here! |
PyO3 0.14.1 has been released. Thanks again to all involved in this! |
f69f4eb
to
56a7c67
Compare
Looks like all the tests are passing. |
New method call APIs! That x509 PR will need some rebasing after this… |
No description provided.