我为 LibClang API 编写了 java 包装器。clang_visitChildren 的包装器适用于相对较小的 c 源文件(少于 200 个一级子文件)。但它在 550-560 一级子区域中因更大的源文件而崩溃。我的回调返回 1(即一级循环,不是递归的)。消息如下:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f41a907adea, pid=21347, tid=139920175146752
#
# JRE version: OpenJDK Runtime Environment (7.0_95) (build 1.7.0_95-b00)
# Java VM: OpenJDK 64-Bit Server VM (24.95-b01 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 2.6.4
# Distribution: Ubuntu 14.04.3 LTS, package 7u95-2.6.4-0ubuntu0.14.04.1
# Problematic frame:
# J 63 C2 com.sun.jna.Native.getNativeSize(Ljava/lang/Class;Ljava/lang/Object;)I (145 bytes) @ 0x00007f41a907adea [0x00007f41a907aac0+0x32a]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/itrub/ruslan/hs_err_pid21347.log
Compiled method (c2) 440 63 ! com.sun.jna.Native::getNativeSize (145 bytes)
total in heap [0x00007f41a907a850,0x00007f41a907c070] = 6176
relocation [0x00007f41a907a970,0x00007f41a907aac0] = 336
main code [0x00007f41a907aac0,0x00007f41a907b3e0] = 2336
stub code [0x00007f41a907b3e0,0x00007f41a907b428] = 72
oops [0x00007f41a907b428,0x00007f41a907b4c0] = 152
scopes data [0x00007f41a907b4c0,0x00007f41a907bca0] = 2016
scopes pcs [0x00007f41a907bca0,0x00007f41a907bff0] = 848
dependencies [0x00007f41a907bff0,0x00007f41a907bff8] = 8
handler table [0x00007f41a907bff8,0x00007f41a907c040] = 72
nul chk table [0x00007f41a907c040,0x00007f41a907c070] = 48
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
# http://icedtea.classpath.org/bugzilla
#
有人可以就问题解决的可能方式给我很好的建议吗?