Skip to content

Segmentation fault under Python 3.9.12 #102329

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

Closed
YaoJiayi opened this issue Feb 28, 2023 · 6 comments
Closed

Segmentation fault under Python 3.9.12 #102329

YaoJiayi opened this issue Feb 28, 2023 · 6 comments

Comments

@YaoJiayi
Copy link

Crash report

The following code snippet crashes with core dumped:

import unittest
from test import support
import sys

class Tests(unittest.TestCase):
    def test_bug(self):
        modules = set()
        for name, module in sys.modules.items():
            modules.add(module)
        new_tuples = tuple(modules)
        new_set = set(new_tuples)
        print('')
        print('sys.modules:')
        print('')
        import pprint
        pprint.pprint(modules)
        print('')
        print('len(sys.modules):', len(modules))


def test_main():
    support.run_unittest(Tests)

if __name__ == '__main__':
    test_main()

Error messages

(<object object at 0x7f0fe7b6d6a0>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>, <NULL>)
Segmentation fault (core dumped)

Your environment

  • CPython versions tested on: Python 3.9.12
  • Operating system and architecture: Linux hx-rs4810gs 5.15.0-57-generic 63~20.04.1-Ubuntu SMP Wed Nov 30 13:40:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
@YaoJiayi YaoJiayi added the type-crash A hard crash of the interpreter, possibly with a core dump label Feb 28, 2023
@zware
Copy link
Member

zware commented Feb 28, 2023

I can't reproduce this on Linux 6.0.12-76060006-generic #202212290932~1674139725~22.04~ca93ccf SMP PREEMPT_DYNAMIC Thu J x86_64 with Python 3.9.14. Can you reproduce with any other version?

@YaoJiayi
Copy link
Author

I've just tried Python 3.8.16. It has the same error message.

@terryjreedy
Copy link
Member

Please reduce the code to the minimum needed to get a crash and then indicate which line it crashes on.

@YaoJiayi
Copy link
Author

It seems that "from test import support" produces the crash.

@zware
Copy link
Member

zware commented Feb 28, 2023

Is that your own test.support module, or the private helper from the standard library test suite?

@sobolevn
Copy link
Member

I cannot reproduce this crash on macos with python 3.9.15, 3.10.2, and 3.12-dev :(

@zware zware added the pending The issue will be closed if no feedback is provided label Feb 28, 2023
@YaoJiayi YaoJiayi closed this as completed Mar 1, 2023
@zware zware closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2023
@zware zware removed type-crash A hard crash of the interpreter, possibly with a core dump pending The issue will be closed if no feedback is provided labels Mar 1, 2023
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

4 participants