Comments (3)
Yeah, this working as intended. Like @amaanq, Tree-sitter aborts on allocation failure (unless you explicitly override that allocation behavior). Attempting to recover from allocation failure is explicitly not something we plan to do. For most codebases, attempting to do that correctly is a SEGV waiting to happen.
from tree-sitter.
There is a check if the default ts allocator is used (which the cli does or if you specify -DTREE_SITTER_REUSE_ALLOCATOR) -
Line 5 in 8b28443
If you are opting out of the ts allocator, then whatever the user supplies is used, or just the function itself if not.
from tree-sitter.
Is it the intention that grammars should be complied with -DTREE_SITTER_REUSE_ALLOCATOR
by default? None of the bindings seem to do that, so we already have SIGSEGV pending on OOM in all bindings.
At the very least I think the fallback implementations based on libc should also abort on failures.
from tree-sitter.
Related Issues (20)
- tree-sitter highlight unexpected precedence HOT 3
- Query depends on choice alternatives order HOT 1
- About closed my issue #3240 HOT 1
- Tree-sitter sometimes discards a perfectly valid branch, resulting in ERROR, where valid parse tree exists HOT 4
- Assertion failed when using QueryCursor::matches HOT 2
- query choice operator is non-commutative HOT 2
- Playground should show anonymous nodes
- `TreeCursor::goto_first_child_for_byte` cannot find nodes after ERROR nodes
- `ts_node_parent` can still return wrong parent for a zero-width node HOT 3
- cli build fails HOT 1
- Compile-time kind and field ids that are generated by binding generation. HOT 8
- `failed to rename wasm output file` on different Drive letter HOT 3
- "Failed to locate a package.json file that has a "tree-sitter" section, please ensure you have one, and if you don't then consult the docs" HOT 2
- Test runner can't parse CRLF in some cases
- Add parent language name to grammar.json
- *** stack smashing detected ***: terminated Fatal error 6: Aborted HOT 44
- "generate_parser_in_directory" generates spurious "grammar.js" and "package.json" files when "grammar_path" is specified but not equal to "<repo_path>/grammar.js". HOT 3
- Compile error while following `Rust Tree-sitter` instruction HOT 3
- Parsing string literals in predicates isn't accounting for `\s` HOT 4
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 tree-sitter.