hang instead of pthread_exit during interpreter shutdown#4874
hang instead of pthread_exit during interpreter shutdown#4874davidhewitt merged 13 commits intoPyO3:mainfrom
Conversation
CodSpeed Performance ReportMerging #4874 will not alter performanceComparing Summary
|
80f138a to
704ef0b
Compare
|
Yay it passes tests. |
pytests/tests/test_othermod.py
Outdated
| from pyo3_pytests import othermod | ||
|
|
||
| INTEGER32_ST = st.integers(min_value=(-(2**31)), max_value=(2**31 - 1)) | ||
| INTEGER32_ST = st.integers(min_value=(-(2**30)), max_value=(2**30 - 1)) |
There was a problem hiding this comment.
this change here is to avoid the test failing due to a high rate of assume failure (filter_too_much).
|
split the test_double fix to #4879 |
|
any update? |
Icxolu
left a comment
There was a problem hiding this comment.
This looks fine to me, but I would like at least one other maintainers opinion (maybe @davidhewitt?) before proceeding here.
|
Please forgive the delay, I will seek to review this on Friday, and ping me repeatedly from then if I do not achieve that! |
davidhewitt
left a comment
There was a problem hiding this comment.
Thanks, I think let's move forward with this. The cfg guards hack around the various edge cases and, as I read it, the interaction with pthread_exit and rust destructors was (and still is) UB, so this just creates a practical solution for now. Ultimately 3.14 will make this problem go away.
|
So the scary failure here is the CodSpeed regression? |
|
The failed stage is I assume it's probably fine and we should just skip the new test on debug builds? After all, we're trying to test a bad edge case. |
|
Agreed RE flaky benchmark, I will set that one to be ignored. |
This looks bad. Not sure it's our fault tho. Trying to investigate - if it's PyO3's fault, we should fix it. I want to know whether it's a CPython or a PyO3 problem. |
|
I didn't manage to debug it easily, will try more after Rust Nation. |
|
Looks like the failure does not reproduce on the builder either. I say merge this unless someone can reproduce the failure. |
|
ed: I can reproduce the assertion locally |
|
Backtrace: |
|
It looks like |
|
My feeling is that my change doesn't make the problem worse, and we should skip this test on debug builds. What's the way to do that? |
|
Understood, thanks for checking that. I've pushed something and will click auto-merge now 👍 |
|
As you can see in the python/cpython#131012 the assertion failure is currently expected on the CPython side. |
|
It looks like Any idea what the appropriate way to handle this is? Should we be using |
|
Replied in #4811 (review) |
This mimics the Python 3.14 behavior and avoids crashes in Rust 1.84.
See python/cpython#87135 and rust-lang/rust#135929 and the related pyo3-log issue vorner/pyo3-log#30
By submitting these contributions you agree for them to be dual-licensed under PyO3's MIT OR Apache-2.0 license.