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

SqlToolsService crashes with StackOverFlow exception #340

Closed
kburtram opened this issue Nov 12, 2016 · 1 comment
Closed

SqlToolsService crashes with StackOverFlow exception #340

kburtram opened this issue Nov 12, 2016 · 1 comment
Labels

Comments

@kburtram
Copy link
Member

  • MSSQL Extension Version: 0.1.5
  • VSCode Version: 1.7+
  • OS Version: All

Steps to Reproduce:

  1. Open SQL file with certain contents to trigger SqlParser stack overflow (I'll attach repro script once issue isolated)

Expected: Parser doesn't cause stackover flow

Workaround: Turning off diagnostics should avoid this stack overflow crash using this user setting "mssql.intelliSense.enableErrorChecking": false

@kburtram
Copy link
Member Author

kburtram commented Dec 1, 2016

The issue here is if there is a lot of non-SQL content in a SQL file (such as 1000s of lines of XML or CSV) then the parser will build a long parse chain for this content. Since the content doesn't contain a terminating token the parse tree will grow very deep. The error recovery algorithm recursively descends this tree and about 10000 or 15000 levels deep the process crashes.

I think in SSMS we mitigate this using a larger stack size. I'll see if it's possible to do the same in .Net Core, otherwise, we need to add some upper limit on how deep the algorithm will traverse the tree.

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

No branches or pull requests

2 participants