Crash on drag-selection near an error
System info:
- Sublime Text version:
Version 3.2.2, Build 3211 - Which system are you on:
Windows 10 Home, 10.0.19042 Build 19042 - Clang version:
10, x86_64-pc-windows-msvc, posix
What happens:
Sublime Text crashes if you select text too hard with mouse at the error line with a popup. Just drag-select some text there a lot.
I used SublimeLog plugin to get the crash trace.
Minimal example: any, but #744 will do too
Log that illustrates the issue:
=> => => [13 Apr 2021, 13:41:39] Console logging activated (C:\Users\Feacu\.subl.log).
Exception in thread Thread-1:
Traceback (most recent call last):
File "./python3.3/threading.py", line 901, in _bootstrap_inner
File "./python3.3/threading.py", line 858, in run
File "C:\Users\Feacu\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\utils\thread_pool.py", line 126, in __animate_progress
self.__progress_status.show_as_ready()
File "C:\Users\Feacu\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\utils\progress_status.py", line 49, in show_as_ready
BaseProgressStatus.PROGRESS_MASK.format(progress=self.msg_ready))
File "C:\Users\Feacu\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\utils\progress_status.py", line 36, in set_status
view.set_status(BaseProgressStatus.MSG_TAG, message)
AttributeError: 'NoneType' object has no attribute 'set_status'
Ok, thanks for reporting. I will try to have a look as soon as I find the time.
Judging from the log it should be not too hard to fix.
@Feacur I added a PR, but I could not reproduce this. Granted I did try this on by Linux machine, but still. Just in case I was doing smth wrong, am I "selecting too hard" right?
https://user-images.githubusercontent.com/1893598/115149346-eb034a80-a063-11eb-81bb-7cf6ac0e19d4.mp4
Yes, exactly like that =)
The crash persist even with the PR, although now without the said trace. I'll test a bit more searching for the source[s] of it; without any additional leads, there is no much use to this issue anyway.
For me it looks like this:
...

P.S.: don't worry much about that, 'cause for me Sublime Text 3 hard-crashes several times a week (due to itself, LSP, or some other plugins, I don't even know). VSCode, while eating more RAM and being an electron app, is so much more stable in my experience.
Ok, superficially traced the offender:
# /EasyClangComplete/EasyClangComplete.py
def on_selection_modified_async(self, view):
# ...
# /EasyClangComplete/plugin/error_vis/popup_error_vis.py
def show_popup_if_needed(self, view, row):
# ...
# /EasyClangComplete/plugin/error_vis/popups.py
def show(self, view, location=-1, on_navigate=None):
# ...
... without these popups [spamming, while user drag-selects stuff,] everything's going just fine. Also, I've noticed info popups take completely different paths to occur, unlike warning and error ones.
I suppose, mdpopups or [Sublime itself down the line] objects the avalanche of calls.
Ah, one more trace, albeit I wonder how come I've got it (there IS a null check before that line):
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 610, in on_selection_modified_async
callback.on_selection_modified_async(v)
File "C:\Users\Feacu\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\EasyClangComplete.py", line 363, in on_selection_modified_async
if not SublBridge.is_valid_view(view):
File "C:\Users\Feacu\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\utils\subl\subl_bridge.py", line 228, in is_valid_view
if not path.exists(view.file_name()):
File "./python3.3/genericpath.py", line 18, in exists
TypeError: can't specify None for path argument
This is all really weird. With all the things you commented out you would not get the popups at all, right?
Yeah: should I only disable popup.show(view) call in the popup_error_vis.py, everything comes stable. Obviously, without the said popups, which is a mild inconvenience; but ECC: Show all errors and gutter icons still function all right, so not everything's lost. Besides, keyboard controls aren't affected by the issue, so normally I wouldn't get the crash.
I see. This is really strange. I will probably also try to run this on Windows just to see if I am able to reproduce it there. The popups are most probably generated in different ways on linux and windows. Until then, it is weird. On my machine, sublime text never crashes unless there is a legitimate bug in the plugin code, so it might be related to your configuration.
Sure, it might be. I did disable all the other plugins before taking the screenshots; but it still leaves the rest of my machine to interfere with the editor.
(also, ugh, sorry, I've accidentally misclicked the [close issue] button and got no prompt)
@Feacur I've tried reproducing this on my Windows machine and it just won't crash. Is your machine special in any way?
Most likely it is, as any other PC
- there is a fair lot of dev tools, for sure
- some system settings and permissions may differ
- drivers/hardware/running services/whatnot
I can't pinpoint any other particular cause, unless I dig deeper the callstack into mdpopups, for instance. This issue might well be unrelated to ECC: I'm getting crashes with LSP + clangd, too; some of them are popup-related and quite similar, but generaly of unknown nature.
Anyway, thank you for trying to reproduce it at your side and for your time.