Skip to content
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

Crash on drag-selection near an error #745

Open
Feacur opened this issue Apr 13, 2021 · 11 comments · May be fixed by #747
Open

Crash on drag-selection near an error #745

Feacur opened this issue Apr 13, 2021 · 11 comments · May be fixed by #747

Comments

@Feacur
Copy link

Feacur commented Apr 13, 2021

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'
@Feacur Feacur changed the title Crash on text near an error being drag-selected Crash on drag-selection near an error Apr 13, 2021
@niosus
Copy link
Owner

niosus commented Apr 14, 2021

Ok, thanks for reporting. I will try to have a look as soon as I find the time.

@niosus
Copy link
Owner

niosus commented Apr 14, 2021

Judging from the log it should be not too hard to fix.

@niosus niosus linked a pull request Apr 18, 2021 that will close this issue
@niosus
Copy link
Owner

niosus commented Apr 18, 2021

@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?

dragging_error.mp4

@Feacur
Copy link
Author

Feacur commented Apr 18, 2021

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:
image
...
image

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.

@Feacur
Copy link
Author

Feacur commented Apr 18, 2021

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

@niosus
Copy link
Owner

niosus commented Apr 18, 2021

This is all really weird. With all the things you commented out you would not get the popups at all, right?

@Feacur
Copy link
Author

Feacur commented Apr 18, 2021

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.

@niosus
Copy link
Owner

niosus commented Apr 21, 2021

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.

@Feacur Feacur closed this as completed Apr 22, 2021
@Feacur Feacur reopened this Apr 22, 2021
@Feacur
Copy link
Author

Feacur commented Apr 22, 2021

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)

@niosus
Copy link
Owner

niosus commented May 2, 2021

@Feacur I've tried reproducing this on my Windows machine and it just won't crash. Is your machine special in any way?

@Feacur
Copy link
Author

Feacur commented May 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants