Skip to content

Debugging a segmentation fault #13431

Closed
Closed
@jace

Description

@jace

Bug Report

Some code I was working on last week is causing mypy to segfault. I tried retracing my steps to find the change that broke mypy, without luck.

Config:

  • Platform: macOS 12.4 on M1
  • Arch: arm64
  • Python: 3.9.13
  • mypy: 0.971
  • mypy plugins: none (segfault happens with all plugins disabled and is not linked to any imported modules)

mypy --tb and mypy --pdb are segfaulting without any info. gdb is not available on arm64. I get a bit more info using faulthandler, but all it indicates is the file:

$ python -X faulthandler -m mypy -v .
…
LOG:  Processing SCC singleton (coaster.views.classview) as inherently stale with stale deps (__future__ asyncio builtins coaster coaster.auth coaster.sqlalchemy coaster.typing coaster.utils coaster.views.misc flask flask.blueprints flask.typing functools sqlalchemy.orm.attributes sqlalchemy.orm.descriptor_props sqlalchemy.orm.mapper sqlalchemy.orm.properties sqlalchemy.orm.query types typing typing_extensions werkzeug.local werkzeug.routing werkzeug.wrappers)
Fatal Python error: Segmentation fault

Current thread 0x0000000102f10580 (most recent call first):
  File "/Users/jace/.virtualenvs/hasgeek/lib/python3.9/site-packages/mypy/__main__.py", line 12 in console_entry
  File "/Users/jace/.virtualenvs/hasgeek/lib/python3.9/site-packages/mypy/__main__.py", line 34 in <module>
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87 in _run_code
  File "/opt/homebrew/Cellar/python@3.9/3.9.13_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197 in _run_module_as_main
[1]    44130 segmentation fault  python -X faulthandler -m mypy -v .

The file in question is located at https://github.com/hasgeek/coaster/blob/369ce391f11850f10fc0ab42a52c196188436a50/coaster/views/classview.py

To Reproduce

  1. git clone https://github.com/hasgeek/coaster.git
  2. cd coaster
  3. git checkout 369ce391f11850f10fc0ab42a52c196188436a50
  4. mypy coaster/views/classview.py

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions