Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Tree Sitter Parser sometimes crashes Atom on large file #18777

Closed
1 task done
stdio2016 opened this issue Feb 2, 2019 · 6 comments
Closed
1 task done

Tree Sitter Parser sometimes crashes Atom on large file #18777

stdio2016 opened this issue Feb 2, 2019 · 6 comments

Comments

@stdio2016
Copy link

stdio2016 commented Feb 2, 2019

Prerequisites

Description

Tree Sitter Parser sometimes crashes Atom on large file

Steps to Reproduce

Edit by @rsese to clarify repro steps and expected/actual behavior

  1. atom --safe
  2. Make Tree-sitter is enabled at Settings > Core > Use Tree Sitter Parsers
  3. Open and copy https://github.com/stdio2016/shapeclear-html/blob/3d23132d07dbff365be4dc1ab3a9bebfeefd40d1/lib/phaser.js
  4. Create a new file and paste
  5. Save the file as a JavaScript file e.g. test.js
  6. Close the file
  7. Reopen the file

If there's no crash, repeat steps 6 and 7.

Expected behavior:
No crash.

Syntax highlighting on phaser.js, or just no syntax highlighting because the file is too large

Actual behavior: [What actually happens]

Sometimes a crash at step (5) or if the save succeeds at step (7).

sometimes crashes, even on safe mode

Reproduces how often: [What percentage of the time does it reproduce?]

maybe 50%, random crash

Versions

Atom : 1.34.0
Electron: 2.0.16
Chrome : 61.0.3163.100
Node : 8.9.3

apm 2.1.3
npm 6.2.0
node 8.9.3 x64
atom 1.34.0
python 2.7.15
git 2.16.2.windows.1
visual studio 2015

Additional Information

On windows 10 version 1803.
Visual Studio says the crash is in tree sitter parser.

@stdio2016
Copy link
Author

stdio2016 commented Feb 2, 2019

Can't debug with Visual Studio because I don't have debug symbols

edit by @rsese to remove link to .dmp file since they can potentially expose sensitive data

@rsese
Copy link
Contributor

rsese commented Feb 4, 2019

Thanks for the report! And thanks for sharing a specific file that causes the crash - doesn't reproduce with 1.34.0 on macOS 10.12.6 but I can reproduce with 1.34.0 on Windows 10 (both in safe mode).

@rsese
Copy link
Contributor

rsese commented Mar 28, 2019

x-ref: #18996. Couldn't get a sample file there but just noting a report where Atom crashes on a long file (Python in that case) related to Tree-sitter.

@maxbrunsfeld maxbrunsfeld self-assigned this Apr 17, 2019
@AlanCoding
Copy link

I was having repeat crashes on very specific lines. I would start typing a particular series of characters, and it would crash. I would tell it to restart, and I would type those same characters on the same line... and it would crash again. I have plenty of crash reports. From Googling the content in the crash reports I arrived at #18996, then here.

I'm working on an open source project, so I'm happy to share the fine and the line. See line 264 here:

https://gist.github.com/AlanCoding/ad561a8b9174df351a3a291c2eb7eb0b

(original issue referenced a 3MB file, and I have a 100kB file here, if you need file context, see branch)

This is the 2nd time I hit this repeat-crash scenario with this same file. It was some other line, with me typing some other code the last time. In both cases it was reproducible.

The first time I tried various things like safe mode, closing all other tabs and windows, and then re-installed Atom, none of which fixed the problem. I edited via other means and then started using it again until I got this 2nd line causing the deterministic crash.

I disabled the tree-sitter parser setting, as you suggested, and the crash no longer happens. (Thanks!)

some details from the report

Application Specific Information:
terminating with uncaught exception of type std::length_error: vector
abort() called
10  tree_sitter_python_binding.node	0x0000<redacted> (anonymous namespace)::Scanner::deserialize(char const*, unsigned int) + 495
11  tree_sitter_runtime_binding.node	0x0000<redacted> ts_parser_parse + 3486
12  tree_sitter_runtime_binding.node	0x0000<redacted> 0x0000<redacted> + 28753

Let me know if there's any more info from the dump file you'd like, and how to get it to you.

Atom 1.36.1
Chrome 74.0.3729.131

@50Wliu
Copy link
Contributor

50Wliu commented May 9, 2019

@AlanCoding I believe your crash has been fixed in Atom 1.37.0 beta, which will be arriving on the stable channel soon!

@stdio2016
Copy link
Author

cannot reproduce in atom 1,43.0 x64
is fixed?

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

No branches or pull requests

5 participants