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

open the php file will crash the editor #40279

Closed
ljyf5593 opened this issue Dec 15, 2017 · 14 comments
Closed

open the php file will crash the editor #40279

ljyf5593 opened this issue Dec 15, 2017 · 14 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug php PHP support issues verified Verification succeeded
Milestone

Comments

@ljyf5593
Copy link

  • VSCode Version: Code - Insiders 1.20.0-insider (08ec160, 2017-12-15T05:15:38.886Z)
  • OS Version: Windows_NT x64 10.0.16299
  • Extensions:
Extension Author (truncated) Version
project-manager ale 0.23.1
vscode-intelephense-client bme 0.8.2
php-debug fel 1.12.1
rest-client hum 0.16.1
Go luk 0.6.69
sublime-keybindings ms- 3.0.3
php-docblocker nei 1.3.2
code-settings-sync Sha 2.8.7
vscode-multiclip sle 0.1.3
JavaScriptSnippets xab 1.5.0

Steps to Reproduce:

  1. open the test.php file
  2. crash

test.php file

<?php
$img = "data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAABQAAD/4QMraHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjMtYzAxMSA2Ni4xNDU2NjEsIDIwMTIvMDIvMDYtMTQ6NTY6MjcgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtc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5H7kfuR+5H7kfuR+5H7kfuR+5H7kfuR+5H7kfuR+5H7jVMWJi3A99lVpH//2gAIAQIDAT8Q+ch//9oACAEDAwE/EPnIf//Z";

Reproduces without extensions: Yes/No

@vscodebot vscodebot bot added the insiders label Dec 15, 2017
@vscodebot vscodebot bot added the php PHP support issues label Dec 15, 2017
@mxschmitt
Copy link
Member

  • VSCode Version: Code - Insiders 1.20.0-insider (08ec160, 2017-12-15T05:15:38.886Z)
  • OS Version: Windows_NT x64 6.1.7601
  • Extensions:
Extension Author (truncated) Version
markdown-checkbox bie 0.0.5
vscode-markdownlint Dav 0.12.0
vscode-eslint dba 1.4.3
githistory don 0.2.3
xml Dot 1.9.2
gitlens eam 6.4.0
tslint eg2 1.0.24
vscode-npm-script eg2 0.3.3
vscode-abap lar 0.1.0
Go luk 0.6.69
postscript max 1.0.0
code-beautifier mic 1.7.2
debugger-for-chrome msj 4.0.0
vscode-docker Pet 0.0.22
vscode-icons rob 7.19.0
vscode-table-formatter shu 1.2.1
addDocComments ste 0.0.8
html-preview-vscode tht 0.1.1
vscode-import-cost wix 2.5.1

I can confirm this bug. The window will freeze and after a few seconds the message appears:
image

@bmewburn
Copy link

  • VSCode Version: Code 1.18.1 (929bacb, 2017-11-16T18:34:22.110Z)
  • OS Version: Linux x64 4.9.0-4-amd64
  • Extensions: Extensions are disabled

I'm still on 1.18.1 and get the same. vscode-textmate endless loop?

@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Dec 15, 2017
@roblourens roblourens added this to the December 2017/January 2018 milestone Dec 15, 2017
@roblourens
Copy link
Member

roblourens commented Dec 18, 2017

Also reproes with latest grammar. Atom handles it fine. @aeschli I don't know where to start debugging this?

@ljyf5593
Copy link
Author

may be the php syntax highlight tigger this bug. if rename the test.php to test.js or other language is fine.

@roblourens
Copy link
Member

That's what I expect.

@roblourens
Copy link
Member

We spend all of our time creating an OnigString

image

@aeschli
Copy link
Contributor

aeschli commented Dec 19, 2017

@alexandrudima Looks like an issue in https://github.com/Microsoft/vscode-textmate.

@alexdima
Copy link
Member

alexdima commented Jan 10, 2018

Probably PHP has a regex that is very very slow on this particular string. One could debug by editing the oniguruma C++ code and logging every regex search call.

@chrmarti chrmarti removed the insiders label Jan 18, 2018
@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Jan 26, 2018

FYI, I get a similar freeze (infinite processing) when opening "C:\Program Files\Microsoft VS Code Insiders\resources\app\out\vs\workbench\node\extensionHostProcess.js" or /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js. It seems to involve onig_scanner.node , but I don't have the symbols.

I logged #42117 (not sure if it's a duplicate).

@aeschli
Copy link
Contributor

aeschli commented Jan 29, 2018

The regex that causes the freeze is
(?i)([a-z_\x{7f}-\x{7fffffff}\\][a-z0-9_\x{7f}-\x{7fffffff}\\]*)(?=\s*::)
Removing the (?i) or removing \x{7f}-\x{7fffffff} fixes the issue.

Interstingly it works in Atom, so maybe there is some trick we miss in vscode-textmate. I created microsoft/vscode-textmate#59

@roblourens As a workaround I suggest to massage the regex to remove (?i) and add A-Z instead

@roblourens
Copy link
Member

Thanks for investigating @aeschli!

I'm curious, did you find it by building Oniguruma, or were you able to find it another way, by bisecting the grammar or something?

@roblourens
Copy link
Member

And this very similar regex doesn't trigger it, which is interesting: (?i)(::)\\s*([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(\\()

@aeschli
Copy link
Contributor

aeschli commented Jan 29, 2018

@roblourens: @alexandrudima showed me how to add debug statements to oniguruma:

  • edit vscode/node_modules/oniguruma/src/onig-reg-exp.cc
  • on line 52 (above onig_search(...)) insert printf("Searching for %s in %s\n", source_.c_str(), data+position);
  • in node_modules/oniguruma run node-gyp build (you might have to also run npm install -g node-gyp)
  • run /script/code.sh and check the shell for output

@roblourens
Copy link
Member

Ok, sounds straightforward enough, thanks.

@aeschli aeschli added the verified Verification succeeded label Feb 1, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug php PHP support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants