Bug 2303832 - python-greenlet: segmentation fault with python 3.13
Summary: python-greenlet: segmentation fault with python 3.13
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-greenlet
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Nils Philippsen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2302520
TreeView+ depends on / blocked
 
Reported: 2024-08-09 09:40 UTC by Sergio Correia
Modified: 2024-08-11 06:13 UTC (History)
9 users (show)

Fixed In Version: python-greenlet-3.0.3-7.fc41
Clone Of:
Environment:
Last Closed: 2024-08-11 06:13:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sergio Correia 2024-08-09 09:40:46 UTC
While testing in rawhide and python 3.13rc1, we encountered a segfault when running some python-greenlet tests.

As this behavior started with 3.13rc1 (no issues with the previous 3.13 beta, 3.13.0b4), it seemed at first a regression in (c)python, and I opened the following upstream issue to try to get more information: https://github.com/python/cpython/issues/122772

It's not clear (to me) where the actual problem lies, but I just noticed that a "simple" rebuild of python-greenlet in rawhide seems to "fix" the issue, so I am opening this issue here.

The reproducer used is the test_oops.py file, which has the following content:


import unittest
from contextvars import copy_context
from greenlet import getcurrent, greenlet

class Oops_test(unittest.TestCase):
    def test_oops(self):
        let = greenlet(copy_context().run)
        let.switch(getcurrent().switch)

Reproducible: Sometimes

Steps to Reproduce:
1. Install python greenlet: "dnf install python-greenlet"
2. Make sure to have the test_oops.py reproducer file (its content is availble in the "Details" section)
3. Run the test: "python3 -m unittest test_oops" 

Note that it does not crash every single time, so you may have to run step #3 a couple of times before it actually crashes. In here, it doesn't really take long to do so.
Actual Results:  
python3 -m unittest test_oops
Segmentation fault (core dumped)

Expected Results:  
python3 -m unittest test_oops
.
----------------------------------------------------------------------
Ran 1 test in 0.000s

OK

As mentioned in the details section, a rebuild of python-greenlet component appears to "resolve" the issue.

The version where the issue was encountered is python3-greenlet-3.0.3-6.fc41.x86_64

Comment 1 Nils Philippsen 2024-08-10 09:43:26 UTC
(In reply to Sergio Correia from comment #0)
> While testing in rawhide and python 3.13rc1, we encountered a segfault when
> running some python-greenlet tests.
> 
> As this behavior started with 3.13rc1 (no issues with the previous 3.13
> beta, 3.13.0b4), it seemed at first a regression in (c)python, and I opened
> the following upstream issue to try to get more information:
> https://github.com/python/cpython/issues/122772
> 
> It's not clear (to me) where the actual problem lies, but I just noticed
> that a "simple" rebuild of python-greenlet in rawhide seems to "fix" the
> issue, so I am opening this issue here.

Maybe an issue with one of the pre-RC header files. I’ve verified with a local rebuild that it fixes your reproducer, as well as building python-sqlalchemy, so I’ll kick off a rebuild of greenlet against RC1.


Note You need to log in before you can comment on or make changes to this bug.