我在使用Java开发串口通讯的项目时,遇到了一个很头疼的问题。目前项目在Windows32&64上已经跑通了,但是在Linux上总是报错,看样子是因为串口包Rxtx引起JVM异常。Log如下:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f83aa558d9d, pid=21887, tid=0x00007f83aa316700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [librxtxSerial.so+0x6d9d] read_byte_array+0x3d
#
# 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:
# /root/Workspaces/MyEclipse 2017/telegram/hs_err_pid21887.log
#
# If you would like to submit a bug report, please visit:
# http://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.
#
搜了很多相关的帖子,但情况依然存在。
根据Log内容,也输入了$ ulimit -c unlimited 指令,也在MyEclipse.ni 里添加过DefaultType,同时可以保证IDE的Java环境和系统环境是一致的。
已经被这个问题搞得内分泌失调了,感谢各位伸出援手手。