Skip to content

Recurrent but not reproducible crash when writing to cache #12475

@aberres

Description

@aberres

Crash Report

Recently we (different team members) are now and then running into a mypy crash which can only be resolved by deleting .mypy_cache. We have no idea yet how to reproduce it - it likely is triggered after changing branches. But we could so far not figure out the problematic code path.

Traceback

Traceback (most recent call last):
  File "/Users/abc/venv/weplan3.10/bin/mypy", line 8, in <module>
    sys.exit(console_entry())
  File "/Users/abc/venv/weplan3.10/lib/python3.10/site-packages/mypy/__main__.py", line 12, in console_entry
    main(None, sys.stdout, sys.stderr)
  File "mypy/main.py", line 96, in main
  File "mypy/main.py", line 173, in run_build
  File "mypy/build.py", line 180, in build
  File "mypy/build.py", line 256, in _build
  File "mypy/build.py", line 2727, in dispatch
  File "mypy/build.py", line 3071, in process_graph
  File "mypy/build.py", line 3189, in process_stale_scc
  File "mypy/build.py", line 2311, in write_cache
  File "mypy/build.py", line 1488, in write_cache
  File "mypy/nodes.py", line 344, in serialize
  File "mypy/nodes.py", line 3364, in serialize
  File "mypy/nodes.py", line 3301, in serialize
  File "mypy/nodes.py", line 2827, in serialize
  File "mypy/nodes.py", line 3364, in serialize
  File "mypy/nodes.py", line 3301, in serialize
  File "mypy/nodes.py", line 953, in serialize
  File "mypy/types.py", line 1086, in serialize
  File "mypy/types.py", line 1482, in serialize
  File "mypy/types.py", line 611, in serialize
  File "mypy/types.py", line 1079, in serialize
  File "mypy/nodes.py", line 2676, in fullname
AttributeError: attribute '_fullname' of 'TypeInfo' undefined

To Reproduce

Well yeah, seems to be some constellation of stars and cache state.

Your Environment

  • Mypy version used: mypy 0.941 (I think it happened with 0.931 as well)
  • Mypy command-line flags: Just a bunch of packages passed with -p and a config file.
  • Mypy configuration options from mypy.ini (and other config files):
[mypy]
ignore_missing_imports = True
color_output = True
pretty = True
show_error_codes = True
check_untyped_defs = True
warn_unreachable = True
error_summary = True
# https://github.com/python/mypy/issues/9091
no_implicit_optional = True

# pip install sqlalchemy2-stubs
plugins = sqlalchemy.ext.mypy.plugin
  • Python version used: 3.10
  • Operating system and version: macOS Big Sur

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions