Skip to content

dmypy deameon crash after switching branches #14234

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
aljazerzen opened this issue Dec 2, 2022 · 5 comments
Closed

dmypy deameon crash after switching branches #14234

aljazerzen opened this issue Dec 2, 2022 · 5 comments
Labels
crash pending Issues that may be closed topic-daemon dmypy

Comments

@aljazerzen
Copy link

Crash Report

  • run dmypy on a codebase
  • git switch (i.e. major changes to the codebase)
  • dmypy run

Traceback

Daemon crashed!
Traceback (most recent call last):
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/dmypy_server.py", line 229, in serve
    resp = self.run_command(command, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/dmypy_server.py", line 272, in run_command
    return method(self, **data)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/dmypy_server.py", line 331, in cmd_run
    return self.check(sources, is_tty, terminal_width)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/dmypy_server.py", line 393, in check
    messages = self.fine_grained_increment_follow_imports(sources)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/dmypy_server.py", line 568, in fine_grained_increment_follow_imports
    messages = fine_grained_manager.update(changed, [])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/server/update.py", line 245, in update
    result = self.update_one(changed_modules, initial_set, removed_set, blocking_error)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/server/update.py", line 328, in update_one
    result = self.update_module(next_id, next_path, next_id in removed_set)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/server/update.py", line 393, in update_module
    result = update_module_isolated(module, path, manager, previous_modules, graph,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/server/update.py", line 615, in update_module_isolated
    state.type_check_first_pass()
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/build.py", line 2186, in type_check_first_pass
    self.type_checker().check_first_pass()
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 318, in check_first_pass
    self.accept(d)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 426, in accept
    report_internal_error(err, self.errors.file, stmt.line, self.errors, self.options)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/errors.py", line 902, in report_internal_error
    raise err
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 424, in accept
    stmt.accept(self)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/nodes.py", line 739, in accept
    return visitor.visit_func_def(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 774, in visit_func_def
    self._visit_func_def(defn)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 778, in _visit_func_def
    self.check_func_item(defn, name=defn.name)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 840, in check_func_item
    self.check_func_def(defn, typ, name)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 1025, in check_func_def
    self.accept(item.body)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 426, in accept
    report_internal_error(err, self.errors.file, stmt.line, self.errors, self.options)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/errors.py", line 902, in report_internal_error
    raise err
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 424, in accept
    stmt.accept(self)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/nodes.py", line 1086, in accept
    return visitor.visit_block(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 2151, in visit_block
    self.accept(s)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 426, in accept
    report_internal_error(err, self.errors.file, stmt.line, self.errors, self.options)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/errors.py", line 902, in report_internal_error
    raise err
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 424, in accept
    stmt.accept(self)
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/nodes.py", line 1402, in accept
    return visitor.visit_match_stmt(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 4097, in visit_match_stmt
    pattern_types = [self.pattern_checker.accept(p, subject_type) for p in s.patterns]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checker.py", line 4097, in <listcomp>
    pattern_types = [self.pattern_checker.accept(p, subject_type) for p in s.patterns]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checkpattern.py", line 107, in accept
    result = o.accept(self)
             ^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/patterns.py", line 137, in accept
    return visitor.visit_class_pattern(self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aljaz/EdgeDB/venv/lib/python3.11/site-packages/mypy/checkpattern.py", line 466, in visit_class_pattern
    assert type_info is not None
AssertionError

To Reproduce

It doesn't happen always, but I'd say 40% of the time. I don't know if it is related to our codebase.

Your Environment

  • Mypy version used: 0.941
  • Mypy command-line flags: see below
  • Mypy configuration options from mypy.ini (and other config files): see below
  • Python version used: 3.11.0
  • Operating system and version: Linux, Ubuntu 20.04
[tool.mypy]
python_version = "3.10"
plugins = "edb/tools/mypy/plugin.py"
follow_imports = "normal"
ignore_missing_imports = true
warn_redundant_casts = true
warn_unused_configs = true
show_column_numbers = true
show_error_codes = true

... omitted dir specific options ...

(see full mypy config here: https://github.com/edgedb/edgedb/blob/d985f5086769461463c037de7dbd32e219ad8573/pyproject.toml#L103-L174)

@AlexWaygood
Copy link
Member

AlexWaygood commented Dec 2, 2022

Mypy 0.941 is a very old version of mypy — can you confirm that this still crashes on mypy 0.991? (Ideally if you could try the master branch as well, that would be great — there have been a few daemon-related fixes recently that haven't been released yet. E.g. #12744 has reportedly fixed quite a few daemon-related crashes.)

@aljazerzen
Copy link
Author

Woah, you are fast!

I'll switch to 0.991 and report back if this is still happening.

@hauntsaninja hauntsaninja added the pending Issues that may be closed label Dec 19, 2022
@AlexWaygood
Copy link
Member

@aljazerzen, were you able to reproduce this on 0.991 or master? If not we should probably close the issue :)

@aljazerzen
Copy link
Author

No, it hasn't happened since, this can be closed.

Thanks for help!

@AlexWaygood
Copy link
Member

No worries, thanks for filing the issue and following up!

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash pending Issues that may be closed topic-daemon dmypy
Projects
None yet
Development

No branches or pull requests

3 participants