Comments (4)
Ah, I can reproduce with 0.20.1. Can you please use 0.20.4 instead? 0.20.1 is quite old
from py-tree-sitter.
I cannot reproduce - I just built tree-sitter-c with cc parser.c -o parser.so -ltree-sitter -fPIC -shared
If you can provide some more info or some kind of debugging info like a backtrace that'd be helpful.
from py-tree-sitter.
Hi, Thanks for taking this up. Here is the stack trace output. I have tried the above code with python 3.8 here. Maybe you could please use the pip version of tree-sitter (pip install tree_sitter==0.20.1) . Thank you.
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `python debug.py'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f2634ea8859 in __GI_abort () at abort.c:79
#2 0x00007f2634f1326e in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f263503d298 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3 0x00007f2634f1b2fc in malloc_printerr (str=str@entry=0x7f263503f1e0 "munmap_chunk(): invalid pointer") at malloc.c:5347
#4 0x00007f2634f1b54c in munmap_chunk (p=) at malloc.c:2830
#5 0x00007f2634306e14 in ts_subtree_release (self=..., pool=) at tree_sitter/core/lib/src/./subtree.c:609
#6 ts_subtree_release (pool=0x7fff06380c80, self=...) at tree_sitter/core/lib/src/./subtree.c:588
#7 0x00007f263431494c in ts_tree_delete (self=0x1124aa0) at tree_sitter/core/lib/src/./tree.c:31
#8 0x00007f26342f49e1 in tree_dealloc (self=0x7f26343f33d0) at tree_sitter/binding.c:568
#9 0x00000000005aced3 in ?? ()
#10 0x00000000005b0174 in ?? ()
#11 0x00000000006a180c in ?? ()
#12 0x00000000005afc89 in ?? ()
#13 0x000000000067a583 in PyImport_Cleanup ()
#14 0x000000000067423f in Py_FinalizeEx ()
#15 0x00000000006b418d in Py_RunMain ()
#16 0x00000000006b43fd in Py_BytesMain ()
#17 0x00007f2634eaa083 in __libc_start_main (main=0x4c4510
at ../csu/libc-start.c:308
#18 0x00000000005da67e in _start ()
below is the complete minimal code to reproduce the error.
import sys
from tree_sitter import Language, Parser
Language.build_library(
"build/my-languages.so",
["vendor/tree-sitter-c"],
)
file_to_parse ='./arc-tbl.h'
with open(file_to_parse, 'rb') as f:
code = f.read()
library_path = 'build/my-languages.so'
C_LANGUAGE = Language(library_path, 'c')
parser = Parser()
parser.set_language(C_LANGUAGE)
tree = parser.parse(code)
from py-tree-sitter.
Thanks, latest version works fine.
from py-tree-sitter.
Related Issues (20)
- Swift: Incompatible Language Version 10. Must be between 13 and 14 HOT 1
- Takes 0.8 seconds to import tree_sitter HOT 3
- Query doesn't work correctly when using read_callable HOT 11
- Miss distutils in Windows HOT 1
- Documentation is required.
- Is it possible to understand if an object is an instance of a certain class that may be defined in another file?
- How to use tree-sitter in Windows 10? HOT 6
- Special case not managed by the parser, when an expression is split without a backslash and the second line is dedented. HOT 4
- Example mismatch HOT 1
- Captures are not grouped HOT 3
- How to sync node after code edit? HOT 1
- README.md needs updates
- query failing in py-tree-sitter but compiling in tree-sitter playground HOT 1
- a __main__.py to build `vendor/tree-sitter-X` from command line HOT 1
- [bug] Cannot build a library in a directory containing two parsers. HOT 5
- The Python parser appears to be parsing comments and strings with unmatched parentheses as code HOT 2
- py-tree-sitter is 10x slower than lezer-parser HOT 9
- FileNotFoundError: [Errno 2] No such file or directory: 'tree-sitter-java/src/parser.c' HOT 2
- UTF-16 encoding support is wanted HOT 1
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 py-tree-sitter.