bonede / tree-sitter-ng

Next generation Tree Sitter Java binding.
MIT License
61 stars 8 forks source link

An exception occurred while parsing C++, causing the program to terminate #9

Closed markkwu closed 5 months ago

markkwu commented 6 months ago

The following is the error message:

#

A fatal error has been detected by the Java Runtime Environment:

#

SIGILL (0x4) at pc=0x00007f47a6e3bc09, pid=1, tid=231

#

JRE version: Java(TM) SE Runtime Environment 18.9 (11.0.21+9) (build 11.0.21+9-LTS-193)

Java VM: Java HotSpot(TM) 64-Bit Server VM 18.9 (11.0.21+9-LTS-193, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)

Problematic frame:

C [x86_64-linux-gnu-tree-sitter-cpp.so+0x38ec09] tree_sitter_cpp_external_scanner_deserialize+0x179

#

Core dump will be written. Default location: Core dumps may be processed with "/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e %P %I %h" (or dumping to /devops/zxpt/codeSearch/core.1)

#

If you would like to submit a bug report, please visit:

https://bugreport.java.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug.

#

--------------- S U M M A R Y ------------

Command Line: -Xms2g -Xmx4g /devops/zxpt/codeSearch/codeSearchService.jar

Host: Intel Xeon Processor (Skylake), 4 cores, 7G, CentOS Linux release 7.9.2009 (Core) Time: Wed Mar 27 10:39:09 2024 CST elapsed time: 1200.273676 seconds (0d 0h 20m 0s)

--------------- T H R E A D ---------------

Current thread (0x00007f47a801d000): JavaThread "analyzeCodeChildThread-348640746776690688-1" [_thread_in_native, id=231, stack(0x00007f47c0ee3000,0x00007f47c0fe4000)]

Stack: [0x00007f47c0ee3000,0x00007f47c0fe4000], sp=0x00007f47c0fe2210, free space=1020k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [x86_64-linux-gnu-tree-sitter-cpp.so+0x38ec09] tree_sitter_cpp_external_scanner_deserialize+0x179 C [x86_64-linux-gnu-tree-sitter.so+0x30b4e] ts_parser_reset+0x30e C [x86_64-linux-gnu-tree-sitter.so+0x2e339] ts_parser_set_language+0x399 C [x86_64-linux-gnu-tree-sitter.so+0xb4845] Java_org_treesitter_TSParser_ts_1parser_1set_1language+0x25 j org.treesitter.TSParser.ts_parser_set_language(JJ)Z+0 j org.treesitter.TSParser.setLanguage(Lorg/treesitter/TSLanguage;)Z+10 j com.iflytek.ast.commons.treesitter.parser.AbstractParser.parse(Lcom/iflytek/ast/commons/treesitter/param/PrepareData;Lcom/google/common/collect/Table;)V+28 j com.iflytek.ast.commons.treesitter.parser.AbstractParser.parseToTable(Lcom/iflytek/ast/commons/treesitter/param/PrepareData;)Lcom/google/common/collect/Table;+7 j com.iflytek.ast.commons.treesitter.parser.AbstractParser.parse(Ljava/lang/String;)Ljava/util/Map;+14 j com.aicode.codesearch.analyze.strategy.CppStrategy.codeAnalysis(Ljava/lang/String;)Ljava/util/List;+5 j com.aicode.codesearch.analyze.strategy.AbstractCodeAnalyzeStrategy.commonCodeAnalysis(Ljava/lang/Long;Ljava/lang/String;)Ljava/util/List;+7 j com.aicode.codesearch.analyze.CodeAnalyzeContext.lambda$processFile$0(Lcom/aicode/codesearch/enums/LanguageEnum;Ljava/lang/String;Ljava/nio/file/Path;Ljava/lang/String;)V+13 j com.aicode.codesearch.analyze.CodeAnalyzeContext$$Lambda$1040.run()V+20 j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+92 java.base@11.0.21 j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 java.base@11.0.21 j java.lang.Thread.run()V+11 java.base@11.0.21 v ~StubRoutines::call_stub V [libjvm.so+0x8548fa] JavaCalls::call_helper(JavaValue, methodHandle const&, JavaCallArguments, Thread)+0x27a V [libjvm.so+0x852ede] JavaCalls::call_virtual(JavaValue, Handle, Klass, Symbol, Symbol, Thread)+0x19e V [libjvm.so+0x8fef9f] thread_entry(JavaThread, Thread)+0x9f V [libjvm.so+0xdb5161] JavaThread::thread_main_inner()+0x131 V [libjvm.so+0xdb14dc] Thread::call_run()+0x13c V [libjvm.so+0xc1dc16] thread_native_entry(Thread*)+0xe6

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.treesitter.TSParser.ts_parser_set_language(JJ)Z+0 j org.treesitter.TSParser.setLanguage(Lorg/treesitter/TSLanguage;)Z+10 j com.iflytek.ast.commons.treesitter.parser.AbstractParser.parse(Lcom/iflytek/ast/commons/treesitter/param/PrepareData;Lcom/google/common/collect/Table;)V+28 j com.iflytek.ast.commons.treesitter.parser.AbstractParser.parseToTable(Lcom/iflytek/ast/commons/treesitter/param/PrepareData;)Lcom/google/common/collect/Table;+7 j com.iflytek.ast.commons.treesitter.parser.AbstractParser.parse(Ljava/lang/String;)Ljava/util/Map;+14 j com.aicode.codesearch.analyze.strategy.CppStrategy.codeAnalysis(Ljava/lang/String;)Ljava/util/List;+5 j com.aicode.codesearch.analyze.strategy.AbstractCodeAnalyzeStrategy.commonCodeAnalysis(Ljava/lang/Long;Ljava/lang/String;)Ljava/util/List;+7 j com.aicode.codesearch.analyze.CodeAnalyzeContext.lambda$processFile$0(Lcom/aicode/codesearch/enums/LanguageEnum;Ljava/lang/String;Ljava/nio/file/Path;Ljava/lang/String;)V+13 j com.aicode.codesearch.analyze.CodeAnalyzeContext$$Lambda$1040.run()V+20 j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+92 java.base@11.0.21 j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5 java.base@11.0.21 j java.lang.Thread.run()V+11 java.base@11.0.21 v ~StubRoutines::call_stub

siginfo: si_signo: 4 (SIGILL), si_code: 2 (ILL_ILLOPN), si_addr: 0x00007f47a6e3bc09

It seems that this line of code is reporting an error: TSParser parser = new TSParser(); parser.setLanguage(language);

Can you help me take a look at this issue?

bonede commented 6 months ago

Duplicate of #8

bonede commented 5 months ago

fixed in 0.22.5