xtherk / rust-jni-example

An example demonstrating how to use Rust to write Java JNI/JVMTI
GNU General Public License v3.0
3 stars 0 forks source link

demo在mac arm上执行异常 #2

Open kelpiezqc opened 3 hours ago

kelpiezqc commented 3 hours ago

java version "1.8.0_431" Java(TM) SE Runtime Environment (build 1.8.0_431-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.431-b10, mixed mode)

运行main时日志为

[2024-11-15T20:35:44.666] DEBUG Attached thread main (ThreadId(1)). 1 threads attached [2024-11-15T20:35:44.670] DEBUG VM option: -Djava.library.path=. [2024-11-15T20:35:44.670] DEBUG VM option: -XX:+DisableAttachMechanism [2024-11-15T20:35:44.670] DEBUG VM option: -Dfile.encoding=UTF-8 [2024-11-15T20:35:44.670] DEBUG VM option: -Xms128M [2024-11-15T20:35:44.670] DEBUG VM option: -Xmx128M [2024-11-15T20:35:44.670] DEBUG Runtime vm param check pass! 进程已结束,退出代码为 139 (interrupted by signal 11:SIGSEGV)

定位原因为 https://github.com/xtherk/rust-jni-example/blob/master/src/main.rs#L106 此处没有真正取到jvmti,而L108这里没能check出来,最终在L110崩溃

kelpiezqc commented 3 hours ago

我是arm的环境,也许与你的开发环境有些差异

xtherk commented 21 minutes ago

我是arm的环境,也许与你的开发环境有些差异

不好意思,我没mac,不然能查一下问题。我是在windows x64环境下开发的