DisposaBoy / GoSublime

A Golang plugin collection for SublimeText 3, providing code completion and other IDE-like features.
MIT License
3.42k stars 302 forks source link

GoSublime crashes Sublime version 3176 #842

Closed inancgumus closed 5 years ago

inancgumus commented 6 years ago

After plugins loaded it crashes the plugin host. I've removed almost all the plugins just to narrow down the issue, but it still fails.

Note: Packages directory is soft-linked to another directory.

startup, version: 3176 osx x64 channel: stable
...
plugins loaded
GoSublime r18.05.19-1: gs.init()
GoSublime r18.05.19-1: sh.init()
Package Control: Skipping automatic upgrade, last run at 2018-05-26 20:44:48, next run at 2018-05-26 21:44:48 or after
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

Full Log:

startup, version: 3176 osx x64 channel: stable
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/inanc/Library/Application Support/Sublime Text 3/Packages
state path: /Users/inanc/Library/Application Support/Sublime Text 3/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/inanc/Library/Application Support/Sublime Text 3/Installed Packages
ignored_packages: ["Vintage"]
generating syntax summary
dpi_scale is obsolete on this platform - use ui_scale instead
pre session restore time: 0.895752
using gpu buffer for window
startup time: 1.04059
no output from shell "/bin/bash" in 1000ms
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin 0_package_control_loader.00-package_control
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin GoSublime.GoSublime
reloading plugin GoSublime.gs9o
reloading plugin GoSublime.gscommands
reloading plugin GoSublime.gscomplete
reloading plugin GoSublime.gsdoc
reloading plugin GoSublime.gsev
reloading plugin GoSublime.gslint
reloading plugin GoSublime.gspalette
reloading plugin GoSublime.gstest
reloading plugin GoSublime.margo_sublime
plugins loaded
GoSublime r18.05.19-1: gs.init()
GoSublime r18.05.19-1: sh.init()
Package Control: Skipping automatic upgrade, last run at 2018-05-26 20:44:48, next run at 2018-05-26 21:44:48 or after
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted
inancgumus commented 6 years ago

Update:

When I comment these lines: 26 and 32; It loads up with other modules and works fine.

https://github.com/DisposaBoy/GoSublime/blob/2feba14a18576f203ad92c301055abb7bb00daa2/GoSublime.py#L24-L35

inancgumus commented 6 years ago

Here, in line 121, it throws an exception:

"TypeError: coercing to str: need bytes, bytearray or buffer-like object, NoneType found"

It maybe the cause of this problem.

https://github.com/DisposaBoy/GoSublime/blob/2feba14a18576f203ad92c301055abb7bb00daa2/gosubl/sh.py#L119-L125

DisposaBoy commented 6 years ago

This is bizarre... I think this might be the same as https://github.com/DisposaBoy/GoSublime/issues/840 so I'll respond there.

marianogappa commented 6 years ago

Hey; my ST3 has started crashing since the last update only when saving .go files. Does GoSublime use "subprocess32 module"? I'm afraid this renders ST3 unusable for me at the moment.

Could not import subprocess32 module, falling back to subprocess module
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted

My only debugging mechanism is fresh install and start installing plugins until it starts crashing again.

DisposaBoy commented 6 years ago

@marianogappa it doesn't import that module, but I don't know that python or the ST3 distro won't do that under the hood. If it crashes when saving .go files when GS is enabled, depending on your settup, it could be caused by a command be run.

If it's the same issue as #840, I was able to reproduce that by using the subprocess module directly on OSX but being a Linux user who doesn't even have a Mac keyboard, it's very difficult to debug what the problem might be let alone fix or work around it.

marianogappa commented 6 years ago

@DisposaBoy thanks for the insight. I think I can help narrow down the root cause, as later on the day I found out on certain conditions it doesn't crash or takes longer to crash. Will post here if I find something useful.

DisposaBoy commented 6 years ago

@marianogappa thanks. that would be very helpful.