bonede / tree-sitter-ng

Next generation Tree Sitter Java binding.
MIT License
72 stars 10 forks source link

Error while generating parse from Scala language #21

Closed andersonm3ai closed 3 months ago

andersonm3ai commented 5 months ago

Log.txt

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

EXCEPTION_ILLEGAL_INSTRUCTION (0xc000001d) at pc=0x00007ff8e7ba89e4, pid=16020, tid=5452

JRE version: Java(TM) SE Runtime Environment (21.0.2+13) (build 21.0.2+13-LTS-58) Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.2+13-LTS-58, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) Problematic frame: C [x86_64-windows-tree-sitter-scala.dll+0xc89e4]

No core dump will be written. Minidumps are not enabled by default on client versions of Windows

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.

bonede commented 5 months ago

Hi,

Could you share the failed Scala source code?

andersonm3ai commented 5 months ago

private static String codigoScala = "package casino\n" + "\n" + "import scala.annotation.tailrec\n" + "\n" + "object CasinoApp extends App {\n" + "\n" + " def solution(n: Int, k: Int): Int = {\n" + " @tailrec\n" + " def innerSolution(k: Int, nrOfrounds: Int, totalChipsRequired: Int): Int = {\n" + " if (totalChipsRequired == n) nrOfrounds\n" + " else if (k > 0 && totalChipsRequired == math.abs(n / 4)) innerSolution(k - 1, nrOfrounds + 1, totalChipsRequired 2)\n" + " else if (k > 0 && totalChipsRequired == math.abs(n / 2)) innerSolution(k - 1, nrOfrounds + 1, totalChipsRequired 2)\n" + " else innerSolution(k, nrOfrounds + 1, totalChipsRequired + 1)\n" + " }\n" + "\n" + " innerSolution(k, 0, 1)\n" + " }\n" + "\n" + " println(solution(10, 10)) //4\n" + " println(solution(18, 2)) //6\n" + " println(solution(8, 0)) //7\n" + "}";

andersonm3ai commented 4 months ago

??

bonede commented 4 months ago

v0.22.6a has fixed a few memory related issues, please upgrade to this version and try again.