-
-
Notifications
You must be signed in to change notification settings - Fork 842
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
free(): invalid pointer
crash on php_only
parser
#6573
Comments
Then you should report that with that parser; there's nothing we can do about it here. |
Not completely. Maybe it would be better to revert 4e21361 while the parser crashes on tree-sitter/tree-sitter-php@58054be. On the tree-sitter-php side I still haven't investigated how to get the same parser binary as created with nvim-treesitter. It differs from the build by |
You can check the code to see exactly how we build it. This needs to be fixed upstream; if you rely on the parser, just lock your nvim-treesitter version until then. |
Yet one note here (on Linux with gcc).
cc -o parser.so -I./src src/parser.c src/scanner.c -Os -shared -fPIC`
cc -Isrc -std=c11 -fPIC -c -o src/parser.o src/parser.c
cc -Isrc -std=c11 -fPIC -c -o src/scanner.o src/scanner.c
ar rv libtree-sitter-php_only.a src/parser.o src/scanner.o
ar: creating libtree-sitter-php_only.a
a - src/parser.o
a - src/scanner.o
cc -shared -Wl,-soname,libtree-sitter-php_only.so.0 src/parser.o src/scanner.o -o libtree-sitter-php_only.so
Should we assume that the way used by nvim-treesitter is always correct? |
I think they are functionally equivalent. You can test |
For some reason, 1. produces crashing binary unlike 2.
I'm confused: currently I have CLI written in Rust, from Debian package (0.20.8-5). It does not have |
Yeah, that's too old. Current is 0.22.5 (soon to be 6), with massive changes. That's what we target, exclusively. |
Indeed, in the new version |
I faced simlar issue. when trying to open some php files I get |
Please report that upstream; a valid compiler flag should not lead to a segfault. (Also, try a newer gcc, or clang.) |
Fixed in tree-sitter/tree-sitter-php@27afeb0 |
Thank you all for your involvement. After fixing the parser built by nvim-treesitter works for me as expected. |
Describe the bug
When using a parser from 4e21361 I get
free(): invalid pointer
crash on some file (details in the reproduction below).I cannot reproduce this failure with parser library compiled from cloned https://github.com/tree-sitter/tree-sitter-php sources and copied in place of the mentioned above. That's why I reported it here.
To Reproduce
With
init.lua
:run
For me it's enough to crash.
Expected behavior
No crash
Output of
:checkhealth nvim-treesitter
Output of
nvim --version
Additional context
The text was updated successfully, but these errors were encountered: