Skip to content
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

test failure with CPython 3.12b3: err::tests::fetching_panic_exception_resumes_unwind #3305

Closed
decathorpe opened this issue Jul 10, 2023 · 7 comments

Comments

@decathorpe
Copy link
Contributor

I'm trying to update the pyo3 packages on Fedora Linux to the latest version (v0.19.1), but I'm getting a weird test failure with CPython 3.12b3:

---- err::tests::fetching_panic_exception_resumes_unwind stdout ----
--- PyO3 is resuming a panic after fetching a PanicException from Python. ---
Python stack trace below:
note: panic did not contain expected string
      panic message: `"Unwrapped panic from Python code"`,
 expected substring: `"new panic"`

failures:
    err::tests::fetching_panic_exception_resumes_unwind

c.f. https://github.com/PyO3/pyo3/blob/v0.19.1/src/err/mod.rs#L855-L868

I'm not sure how or why this is happening, but it looks like PanicException message is no longer extracted successfully here:
https://github.com/PyO3/pyo3/blob/v0.19.1/src/err/mod.rs#L317-L321

@davidhewitt
Copy link
Member

Yes, we haven't got 3.12 passing in CI yet, I think realistically this will come in PyO3 0.20 which might be a month off. Is it helpful for you if we try to expedite and backport onto a 0.19.2 release?

@decathorpe
Copy link
Contributor Author

That would be very helpful, yes 👍 Let me know if I can help with something.

Note that I also need to support PyO3 v0.15, v0.16, v0.17, and v0.18 on top of Python 3.12 (mostly due to Python packages like cryptography using ancient PyO3 version to be compatible with debian stable or something) ... I'll likely need to do some patching to make that work, would you be interested in getting fixes out for those older branches as well?

@davidhewitt
Copy link
Member

Oof. I'll take a quick spin at fixing the 3.12 test suite now. (Might take a few days depending on how much is broken.)

TBH I think it will be a lot of work to backport proper releases for all those versions, as they will have multiple ways that their CI has bitrotted by now. I don't think I'll have capacity to do that, but if there's any information I can offer to help you with patching I will do my best to share it.

cryptography have updated their PyO3 dependency to 0.19 not too long ago, so you may be able to update that first to avoid some patching pain. I'd be interested in hearing what other packages require old PyO3 versions, potentially it would be better for the ecosystem if we collaborate to update those packages' PyO3 dependencies?

@decathorpe
Copy link
Contributor Author

Oof. I'll take a quick spin at fixing the 3.12 test suite now. (Might take a few days depending on how much is broken.)

Thanks, no hurry. :)

TBH I think it will be a lot of work to backport proper releases for all those versions, as they will have multiple ways that their CI has bitrotted by now. I don't think I'll have capacity to do that, but if there's any information I can offer to help you with patching I will do my best to share it.

I'll take a look how much work it would be to fix things on older branches - if it's doable, I'd of course not keep those patches for myself but submit PRs for them.

cryptography have updated their PyO3 dependency to 0.19 not too long ago, so you may be able to update that first to avoid some patching pain. I'd be interested in hearing what other packages require old PyO3 versions, potentially it would be better for the ecosystem if we collaborate to update those packages' PyO3 dependencies?

That's good to know! Sadly cryptography is known to subtly break things with every release, so it's not as easy as just updating it, since that will break a dozen other things. :( But yes, in general, it would be great if I didn't have to support 5 different versions of pyo3.

Right now, Packages in Fedora Linux that depend on different versions of pyo3 are:

@alex
Copy link
Contributor

alex commented Jul 11, 2023

@decathorpe FWIW if you're interested in discussing things we can be doing to reduce the maintenance burden with pyca/cryptography, @reaperhulk and I are happy to discuss and share the different constraints we operate under (and yes, the fact that many of our users are on distros with hilarious out of date software, and they wish to use this week's cryptography with last millenium's OS is, hilariously one of them).

@davidhewitt
Copy link
Member

davidhewitt commented Jul 11, 2023

Looks like #3306 is part of the story for 3.12b3. There is still an occasional refcounting failure in some tests which is probably due to the immortal objects changes (probably our FFI definitions need updating).

@decathorpe
Copy link
Contributor Author

Can confirm that this was fixed with pyo3 v0.19.2. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants