| Summary: | Crash when filtering certain information from pyright LSP | ||
|---|---|---|---|
| Product: | [Applications] kate | Reporter: | Alex Lowe <lengau> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | quinten, waqar.17a |
| Priority: | NOR | ||
| Version First Reported In: | 23.08.4 | ||
| Target Milestone: | --- | ||
| Platform: | Kubuntu | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/utilities/kate/-/commit/eab99aae7207e8d669d0ec367a34fddd211fcbbb | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: |
Crash dump
Crash dump from crash when changing output type in `charmcraft/store/registry.py` Crash when using pyright 1.1.225 |
||
|
Description
Alex Lowe
2024-02-15 20:52:27 UTC
Created attachment 165842 [details] Crash dump from crash when changing output type in `charmcraft/store/registry.py` This crash dump is from a session where I was changing return type of `_extract_file` in charmcraft/store/registry.py. Pyright was reporting an invalid type form (Tuple expression not allowed in type annotation). I deleted the opening parenthesis of the tuple type and began typing "tuple". This crash is repeatable from this commit: https://github.com/canonical/charmcraft/commit/c5cae21182139db75ebd455b7398272994895c9e Hi, thanks for reporting the crash. I have tried to reproduce the crash using the following commit https://github.com/canonical/charmcraft/commit/6374ef9e1b6d6f88d7a048e63bb91b633b44c09b pyright version: pyright 1.1.193 Kate 23.08.4 I tried to change the method return type the same way you were doing i.e., remove `(` and started typing tuple but so far I haven't been able to reproduce the crash. I have also tried with kate master which is built with Qt6 and no crashes there as well. Are you using the same pyright version? Perhaps there is another case where it crashes? Thanks for responding Waqar! The pyright version you're using is quite old (2021 it seems): https://github.com/microsoft/pyright/releases/tag/1.1.193 I've tried with the oldest version I could get from pypi (1.1.225) and it still crashes for me. The crash is only reproducible when the Diagnostics tab is open, with LSP selected from the dropdown, and with Errors selected to the left of the filter box. It takes a few times messing with the annotations, but I can reliably reproduce it with all tried versions of pyright (1.1.225, 1.1.349, 1.1.352) by changing the return type of _extract_file to str, then to tuple[str, str], then back to str, then to tuple[str, str, str]. This occurs both in the current version in Kubuntu 24.04 (Version: 4:23.08.5-0ubuntu1) and in the version from snap (23.08.4 2023-12-10 (171)). I've attached another crash file using pyright 1.1.225. Created attachment 166828 [details]
Crash when using pyright 1.1.225
*** Bug 483870 has been marked as a duplicate of this bug. *** Git commit eab99aae7207e8d669d0ec367a34fddd211fcbbb by Waqar Ahmed. Committed on 18/03/2024 at 11:03. Pushed by cullmann into branch 'master'. diag: Fix filtering after removing previous items When this goes wrong we end up having an invalid idx in syncDiagnosticItems and crash (because there is no guard there atm) M +2 -0 apps/lib/diagnostics/diagnosticview.cpp https://invent.kde.org/utilities/kate/-/commit/eab99aae7207e8d669d0ec367a34fddd211fcbbb |