SublimeLinter / SublimeLinter-rubocop

SublimeLinter 3 plugin for Ruby, using rubocop.
MIT License
159 stars 40 forks source link

Crashes after Sublime Upgrade to Build 3170 #57

Closed stevenchanin closed 6 years ago

stevenchanin commented 6 years ago

Not sure this is a rubocop problem, but I'm seeing intermittent crashes when I run rspec tests from within sublime after upgrading to 3170.

For example, I just tried to run a single test (cmd-R) in a file called placer_spec.rb and I got the following in the sublime console:

SublimeLinter: #74 rubocop placer_spec.rb ERROR:
================================================

Linter crashed.

Traceback (most recent call last):
  File "/Users/steven/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter.sublime-package/lint/backend.py", line 87, in execute_lint_task
    errors = linter.lint(code, view_has_changed, settings) or []
  File "/Users/steven/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter.sublime-package/lint/linter.py", line 754, in lint
    output = self.run(cmd, code)  # type: util.popen_output
  File "/Users/steven/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter.sublime-package/lint/linter.py", line 1054, in run
    return self.communicate(cmd, code)
  File "/Users/steven/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter.sublime-package/lint/linter.py", line 1065, in communicate
    return self._communicate(cmd, code)
  File "/Users/steven/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter.sublime-package/lint/linter.py", line 1164, in _communicate
    out = proc.communicate(code)
  File "./python3.3/subprocess.py", line 920, in communicate
  File "./python3.3/subprocess.py", line 1556, in _communicate
  File "./python3.3/subprocess.py", line 1670, in _communicate_with_poll
  File "./python3.3/subprocess.py", line 1607, in close_unregister_and_remove
OSError: [Errno 9] Bad file descriptor

However, the next time I ran that test, I didn't get any complaints from rubocop/sublime linter. Sometimes I get that crash message running a rspec on a full file (cmd-T). And sometimes it works. I haven't seen a pattern.

Its also not clear to me why running a test(s) would trigger sublimelinter / rubocop at all?

Versions

Rubocop -- 0.55.0 RubyTest Package -- v2107.08.22.09.18.19 SublimeLinter -- v4.5.0 SublimeLinter-rubocop - v2.0.4

kaste commented 6 years ago

Exactly this stacktrace has an unresolved, upstream issue https://github.com/SublimeLinter/SublimeLinter/issues/1061

Its also not clear to me why running a test(s) would trigger sublimelinter / rubocop at all?

Maybe these commands trigger a save or a modified event.

Can you set "kill_old_processes": true, in your SublimeLinter user settings.

stevenchanin commented 6 years ago

Thanks very much for the quick response and the suggestion.

Ok. I just added "kill_old_processes": true to the SublimeLinter user settings. I'll let you know what I see today.

kaste commented 6 years ago

X-Link https://github.com/SublimeTextIssues/Core/issues/2293