Comments (13)
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.
from nvim-treesitter.
I think they are functionally equivalent. You can test tree-sitter build -o php_only.so
to see how that behaves. (Nvim-treesitter will switch to that in 1.0 anyway.)
from nvim-treesitter.
I don't know if it will help, I found that error occurs on injections (and when compiled with -Os
of course).
reproducer:
<?php
$query = <<<SQL
select * from users;
SQL;
from nvim-treesitter.
Then you should report that with that parser; there's nothing we can do about it here.
from nvim-treesitter.
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 make -C php_only
there. That's (at least) why I can't report a bug there for now.
from nvim-treesitter.
Yet one note here (on Linux with gcc).
- nvim-treesitter builds the parser with
cc -o parser.so -I./src src/parser.c src/scanner.c -Os -shared -fPIC`
- make's output on the project shows another way of building the binary that doesn't crash:
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
- The CLI seems to build its own parser binary (stored in ~/.cache folder) in an unknown way, which makes reproduction difficult (tree-sitter/tree-sitter#3336).
Should we assume that the way used by nvim-treesitter is always correct?
from nvim-treesitter.
I think they are functionally equivalent.
For some reason, 1. produces crashing binary unlike 2.
tree-sitter build -o php_only.so
I'm confused: currently I have CLI written in Rust, from Debian package (0.20.8-5). It does not have build
subcommand. I tried tree-sitter generate --build
. It resulted with ~/.cache/tree-sitter/lib/php_only.so
but without details about compiling.
from nvim-treesitter.
Yeah, that's too old. Current is 0.22.5 (soon to be 6), with massive changes. That's what we target, exclusively.
from nvim-treesitter.
Indeed, in the new version build
exists and builds the correct binary.
from nvim-treesitter.
I faced simlar issue. when trying to open some php files I get munmap_chunk(): invalid pointer
. after bisecting and looking at tree-sitter-php
's makefile and nvim-treesitter
's source code, I found out that if we don't include compiler flag -Os
(optimize for size), then error would not occur.
from nvim-treesitter.
Please report that upstream; a valid compiler flag should not lead to a segfault. (Also, try a newer gcc, or clang.)
from nvim-treesitter.
Fixed in tree-sitter/tree-sitter-php@27afeb0
from nvim-treesitter.
Thank you all for your involvement. After fixing the parser built by nvim-treesitter works for me as expected.
from nvim-treesitter.
Related Issues (20)
- highlight = { enable = false } does not work on .lua files HOT 1
- [PHP] Bad indent when chaining methods HOT 2
- Error during "tree-sitter generate" HOT 2
- Bugs Happend When Encounter Math Equations in Markdown or Latex. HOT 1
- No highlighting for svelte HOT 2
- Treesitter not showing italics and bold in markdown files HOT 2
- (latex) Highlight even multiple `&` as a delimiter
- Add VHDL support HOT 1
- Help file tags are disappearing on MacOS neovim with treesitter HOT 3
- SIGSEV error during parsing html HOT 2
- `:TOhtml` does not preserve semantic highlighting HOT 1
- ECMAScript: remove several `@variable.builtins`
- Suggested modification to current roadmap
- vimwiki parser issue HOT 11
- Unable to enable indent only for specific languages HOT 3
- Impossible pattern in highlighter.win for tex files HOT 1
- Doxygen syntax - embedded parameters like `\p len` aren't highlighted HOT 1
- HTML file causes neovim segv HOT 6
- Links and images are underlined with dashes in markdown HOT 22
- latest update to vimdoc error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-treesitter.