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

Snippet can freeze the editor #30407

Closed
basil2style opened this issue Jul 11, 2017 · 14 comments
Closed

Snippet can freeze the editor #30407

basil2style opened this issue Jul 11, 2017 · 14 comments
Assignees
Labels
candidate Issue identified as probable candidate for fixing in the next release freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority snippets verified Verification succeeded

Comments

@basil2style
Copy link

I found out that latest VScode freezes and not opening any projects.
Reinstalling VScode 1.13 solved the problem.

  • VSCode Version: 1.14
  • OS Version: Mac sierra 10.12.5
@chrmarti
Copy link
Contributor

Could you retry with code --verbose and append the output here?

@piersadrian
Copy link

Here's mine:

[main 1:56:08 PM] Starting VS Code in verbose mode
[main 1:56:08 PM] from: /Applications/Visual Studio Code.app/Contents/Resources/app
[main 1:56:08 PM] args: { _: [],
  help: false,
  h: false,
  version: false,
  v: false,
  wait: false,
  w: false,
  diff: false,
  d: false,
  goto: false,
  g: false,
  'new-window': false,
  n: false,
  'unity-launch': false,
  'reuse-window': false,
  r: false,
  performance: false,
  p: false,
  'prof-startup': false,
  verbose: true,
  logExtensionHostCommunication: false,
  'disable-extensions': false,
  disableExtensions: false,
  'list-extensions': false,
  'show-versions': false,
  nolazy: false,
  'skip-getting-started': false }
[main 1:56:09 PM] IPC#vscode-machineId
[52878:0711/135610.165590:INFO:CONSOLE(28)] "Overwriting extension <<.erb>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.165664:INFO:CONSOLE(28)] "Overwriting extension <<.rhtml>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.169747:INFO:CONSOLE(28)] "Overwriting extension <<.jsx>> to now point to mime <<text/x-jsx>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.169824:INFO:CONSOLE(28)] "Overwriting extension <<.jsx>> to now point to mime <<text/javascript>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.169864:INFO:CONSOLE(28)] "Overwriting extension <<.jsx>> to now point to mime <<text/javascript>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.169899:INFO:CONSOLE(28)] "Overwriting extension <<.erb>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.169934:INFO:CONSOLE(28)] "Overwriting extension <<.rhtml>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.169967:INFO:CONSOLE(28)] "Overwriting extension <<.erb>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.170002:INFO:CONSOLE(28)] "Overwriting extension <<.rhtml>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.494634:INFO:CONSOLE(28)] "[/Users/piersadrian/.vscode/extensions/TwentyChung.jsx-snippets-0.0.1]: The "class"-snippet very likely confuses snippet-variables and snippet-placeholders. See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details.", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.501582:INFO:CONSOLE(28)] "[/Users/piersadrian/.vscode/extensions/atefth.ruby-on-rails-snippets-0.0.1]: The "fi"-snippet very likely confuses snippet-variables and snippet-placeholders. See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details.", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[52878:0711/135610.502832:INFO:CONSOLE(28)] "[/Users/piersadrian/.vscode/extensions/atefth.ruby-on-rails-snippets-0.0.1]: The "ft"-snippet very likely confuses snippet-variables and snippet-placeholders. See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details.", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)

Looks like --disable-extensions solves this problem, so it may be a specific extension. Don't have time right now to bisect my extension list...

@alexkrolick
Copy link

[main 1:07:35 PM] Starting VS Code in verbose mode
[main 1:07:35 PM] from: /Applications/Visual Studio Code.app/Contents/Resources/app
[main 1:07:35 PM] args: { _: [],
  help: false,
  h: false,
  version: false,
  v: false,
  wait: false,
  w: false,
  diff: false,
  d: false,
  goto: false,
  g: false,
  'new-window': false,
  n: false,
  'unity-launch': false,
  'reuse-window': false,
  r: false,
  performance: false,
  p: false,
  'prof-startup': false,
  verbose: true,
  logExtensionHostCommunication: false,
  'disable-extensions': false,
  disableExtensions: false,
  'list-extensions': false,
  'show-versions': false,
  nolazy: false,
  'skip-getting-started': false }
[main 1:07:36 PM] IPC#vscode-machineId
[65808:0711/130736.752052:INFO:CONSOLE(28)] "Overwriting extension <<.erb>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[65808:0711/130736.752192:INFO:CONSOLE(28)] "Overwriting extension <<.rhtml>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[65808:0711/130736.754473:INFO:CONSOLE(28)] "Overwriting extension <<.js>> to now point to mime <<text/x-javascript>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[65808:0711/130736.755396:INFO:CONSOLE(28)] "Overwriting extension <<.erb>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[65808:0711/130736.755456:INFO:CONSOLE(28)] "Overwriting extension <<.rhtml>> to now point to mime <<text/x-erb>>", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[65808:0711/130736.768313:INFO:CONSOLE(28)] "[/Users/alex/.vscode/extensions/TimonVS.ReactSnippetsStandard-1.1.0]: Unknown language in `contributes.snippets.language`. Provided value: jsx", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[65808:0711/130737.257434:INFO:CONSOLE(28)] "[/Users/alex/.vscode/extensions/atefth.ruby-on-rails-snippets-0.0.1]: The "fi"-snippet very likely confuses snippet-variables and snippet-placeholders. See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details.", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[65808:0711/130737.257884:INFO:CONSOLE(28)] "[/Users/alex/.vscode/extensions/atefth.ruby-on-rails-snippets-0.0.1]: The "ft"-snippet very likely confuses snippet-variables and snippet-placeholders. See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax for more details.", source: file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/electron-browser/workbench.main.js (28)
[VS Code]: detected unresponsive

@alexkrolick
Copy link

Removing just ruby-on-rails-snippets-0.0.1 seems to fix it for me

@piersadrian
Copy link

@alexkrolick that did it for me, thanks!

@chrmarti chrmarti assigned jrieken and unassigned bpasero Jul 11, 2017
@chrmarti
Copy link
Contributor

@jrieken Can reproduce, the source is at https://github.com/atefth/ruby-on-rails-snippets-vs-code.

@chrmarti chrmarti added the freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues label Jul 11, 2017
@Tyriar Tyriar added the important Issue identified as high-priority label Jul 12, 2017
@bradrich
Copy link

I am not using the ruby-on-rails extension and I am also experiencing issues that are causing the application to become unresponsive. Running --verbose showed several issues that had the confuses snippet message within them. After removing those extensions, the application still becomes unresponsive, even though there are no further errors being shown. --disable-extensions does fix the problem.

Is there a way to enable extensions one-by-one until the problematic extension is found?

@rebornix
Copy link
Member

rebornix commented Jul 12, 2017

@jrieken one good snippet that leads to the freeze


"con": {
   "prefix": "con",
   "body": "class ${1:${TM_FILENAME/(?:\\A|_)([A-Za-z0-9]+)(?:\\.rb)?/(?2::\\u$1)/g}} < ${2:Application}Controller\n  $3\nend",
   "description": "Create controller class",
   "scope": "source.ruby"
}

and the infinite while loop https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts#L166..L171

@chrmarti
Copy link
Contributor

@bradrich Unfortunately extensions can only be uninstalled when starting with --disable-extensions. You could list them with --list-extensions and uninstall/install from the command line (see --help). Could you post the list of installed extensions here?

@karuna
Copy link

karuna commented Jul 12, 2017

@rebornix thanks. I am removing ruby.json on my config folder and it works just fine now.

@karuna
Copy link

karuna commented Jul 12, 2017

@bradrich also if you have user snippets for ruby language it may cause crash.

@bpasero bpasero mentioned this issue Jul 12, 2017
@meanphil
Copy link

Removing the atefth.ruby-on-rails-snippets extension fixed it for me. i.e.:

# code  --uninstall-extension atefth.ruby-on-rails-snippets
Uninstalling atefth.ruby-on-rails-snippets...
Extension 'atefth.ruby-on-rails-snippets' was successfully uninstalled!

@AlbinOS
Copy link

AlbinOS commented Jul 12, 2017

From my side I had to remove the ruby extension and reboot my Mac and it works now.

@jrieken jrieken changed the title VScode 1.14 freezes on my Mac Snippet can freeze the editor Jul 12, 2017
@jrieken jrieken added the candidate Issue identified as probable candidate for fixing in the next release label Jul 12, 2017
@jrieken jrieken added this to the June Recovery 2017 milestone Jul 12, 2017
jrieken added a commit that referenced this issue Jul 12, 2017
@jrieken
Copy link
Member

jrieken commented Jul 12, 2017

Fix on master and cherry picked to release/1.14.

The underlying issue is an unhappy recursion of snippets: Repeating placeholders get expanded when having no value, so ${1:foo}bar$1 will be inserted as foobarfoo. Now, if a subsequent reference of a placeholder occurs inside the first definition, like ${1:foo${VAR:bar$1baz}} our logic creates a cycle in the parse tree. Further operations then walk the tree indefinitely.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
candidate Issue identified as probable candidate for fixing in the next release freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues important Issue identified as high-priority snippets verified Verification succeeded
Projects
None yet
Development

No branches or pull requests