我正在使用rxtx库连接到串口。 为此,我使用不同的选项卡设置了一个gui。 第一个选项卡显示在rxtx库版本2.2pre2上调用gnu.io.CommPortIdentifier.getPortIdentifiers()的可用设备(os是最稳定的ubuntu linux 32位)。
开始时这样做非常有效。但是,如果我切换到另一个选项卡并再次返回,则应更新列表(从选项卡的StateChange接口的stateChanged功能调用)。如果我这样做,那么jvm会崩溃。我也试过使用rxtx 2.1.7,但仍然存在同样的问题。
知道为什么会这样吗?
错误日志: 当前线程(0x823c8800):JavaThread“AWT-EventQueue-0”[_thread_in_native,id = 5578,stack(0x8220d000,0x8225e000)]
siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x00002a0a
Registers:
EAX=0x8206890c, EBX=0x001a9684, ECX=0x00000000, EDX=0x00000000
ESP=0x8225b96c, EBP=0x8225ba38, ESI=0x8225ba90, EDI=0x823c8800
EIP=0x00002a0a, EFLAGS=0x00210286, CR2=0x00002a0a
Top of Stack: (sp=0x8225b96c)
0x8225b96c: 001a5a4d 823c8928 8225ba90 00000000
0x8225b97c: 823c8800 018fdff4 823c8800 8206890c
0x8225b98c: 013bedcc 8225b9b8 82c1a43c 00000001
0x8225b99c: 82c1a43c 8225b9bc 00000001 018fdff4
0x8225b9ac: 823c8800 00000000 850c8ed0 01362bcd
0x8225b9bc: 018fdff4 823c8800 823c8800 8225ba58
0x8225b9cc: 013911bc 850c0360 00000010 00000001
0x8225b9dc: 823c8800 018fdff4 8225c3e4 823c2768
Instructions: (pc=0x00002a0a)
0x000029ea:
[error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xb]
Register to memory mapping:
EAX=0x8206890c is an unknown value
EBX=
[error occurred during error reporting (printing register info), id 0xb]
Stack: [0x8220d000,0x8225e000], sp=0x8225b96c, free space=314k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x00002a0a
j gnu.io.RXTXCommDriver.testRead(Ljava/lang/String;I)Z+0
j gnu.io.RXTXCommDriver.registerValidPorts([Ljava/lang/String;[Ljava/lang/String;I)V+202
j gnu.io.RXTXCommDriver.registerScannedPorts(I)V+1416
j gnu.io.RXTXCommDriver.initialize()V+42
j gnu.io.CommPortIdentifier.getPortIdentifiers()Ljava/util/Enumeration;+57
j de.hanneseilers.jftdiserial.core.connectors.RXTXConnector.getAvailableDevices()Ljava/util/List;+8
j de.hanneseilers.jftdiserial.core.FTDISerial.getAvailableDevices()Ljava/util/List;+11
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.updateDevicesModel()V+26
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.access$0(Lde/northernstars/mr/botcontrol/core/tabsections/TabSectionSettings;)V+1
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings$1.itemStateChanged(Ljava/awt/event/ItemEvent;)V+56
j javax.swing.JComboBox.fireItemStateChanged(Ljava/awt/event/ItemEvent;)V+35
j javax.swing.JComboBox.selectedItemChanged()V+64
j javax.swing.JComboBox.contentsChanged(Ljavax/swing/event/ListDataEvent;)V+28
j javax.swing.AbstractListModel.fireContentsChanged(Ljava/lang/Object;II)V+65
j javax.swing.DefaultComboBoxModel.setSelectedItem(Ljava/lang/Object;)V+38
j javax.swing.DefaultComboBoxModel.addElement(Ljava/lang/Object;)V+55
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.updateLibsModel()V+41
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.stateChanged(Ljavax/swing/event/ChangeEvent;)V+21
j javax.swing.JTabbedPane.fireStateChanged()V+186
j javax.swing.JTabbedPane$ModelListener.stateChanged(Ljavax/swing/event/ChangeEvent;)V+4
j javax.swing.DefaultSingleSelectionModel.fireStateChanged()V+57
j javax.swing.DefaultSingleSelectionModel.setSelectedIndex(I)V+14
j javax.swing.JTabbedPane.setSelectedIndexImpl(IZ)V+97
j javax.swing.JTabbedPane.setSelectedIndex(I)V+13
j javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(Ljava/awt/event/MouseEvent;)V+77
j java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+54
j javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
j java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
j java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+581
j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V+327
j java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+126
j java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
j java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+41
j java.awt.EventQueue.access$200(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
j java.awt.EventQueue$3.run()Ljava/lang/Void;+12
j java.awt.EventQueue$3.run()Ljava/lang/Object;+1
v ~StubRoutines::call_stub
V [libjvm.so+0x49118f] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x57f
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j gnu.io.RXTXCommDriver.testRead(Ljava/lang/String;I)Z+0
j gnu.io.RXTXCommDriver.registerValidPorts([Ljava/lang/String;[Ljava/lang/String;I)V+202
j gnu.io.RXTXCommDriver.registerScannedPorts(I)V+1416
j gnu.io.RXTXCommDriver.initialize()V+42
j gnu.io.CommPortIdentifier.getPortIdentifiers()Ljava/util/Enumeration;+57
j de.hanneseilers.jftdiserial.core.connectors.RXTXConnector.getAvailableDevices()Ljava/util/List;+8
j de.hanneseilers.jftdiserial.core.FTDISerial.getAvailableDevices()Ljava/util/List;+11
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.updateDevicesModel()V+26
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.access$0(Lde/northernstars/mr/botcontrol/core/tabsections/TabSectionSettings;)V+1
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings$1.itemStateChanged(Ljava/awt/event/ItemEvent;)V+56
j javax.swing.JComboBox.fireItemStateChanged(Ljava/awt/event/ItemEvent;)V+35
j javax.swing.JComboBox.selectedItemChanged()V+64
j javax.swing.JComboBox.contentsChanged(Ljavax/swing/event/ListDataEvent;)V+28
j javax.swing.AbstractListModel.fireContentsChanged(Ljava/lang/Object;II)V+65
j javax.swing.DefaultComboBoxModel.setSelectedItem(Ljava/lang/Object;)V+38
j javax.swing.DefaultComboBoxModel.addElement(Ljava/lang/Object;)V+55
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.updateLibsModel()V+41
j de.northernstars.mr.botcontrol.core.tabsections.TabSectionSettings.stateChanged(Ljavax/swing/event/ChangeEvent;)V+21
j javax.swing.JTabbedPane.fireStateChanged()V+186
j javax.swing.JTabbedPane$ModelListener.stateChanged(Ljavax/swing/event/ChangeEvent;)V+4
j javax.swing.DefaultSingleSelectionModel.fireStateChanged()V+57
j javax.swing.DefaultSingleSelectionModel.setSelectedIndex(I)V+14
j javax.swing.JTabbedPane.setSelectedIndexImpl(IZ)V+97
j javax.swing.JTabbedPane.setSelectedIndex(I)V+13
j javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(Ljava/awt/event/MouseEvent;)V+77
j java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+54
j javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23
j java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81
j java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18
j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+581
j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V+327
j java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+126
j java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50
j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12
j java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+41
j java.awt.EventQueue.access$200(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
j java.awt.EventQueue$3.run()Ljava/lang/Void;+12
j java.awt.EventQueue$3.run()Ljava/lang/Object;+1
v ~StubRoutines::call_stub
j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0
j java.security.ProtectionDomain$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
j java.security.ProtectionDomain$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+6
j java.awt.EventQueue$4.run()Ljava/lang/Void;+11
j java.awt.EventQueue$4.run()Ljava/lang/Object;+1
v ~StubRoutines::call_stub
j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0
j java.security.ProtectionDomain$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+73
j java.awt.EventDispatchThread.pumpOneEventForFilters(I)V+245
j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+35
j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j java.awt.EventDispatchThread.run()V+9
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x82056000 JavaThread "TimerQueue" daemon [_thread_blocked, id=5579, stack(0x81faf000,0x82000000)]
0xb7507c00 JavaThread "DestroyJavaVM" [_thread_blocked, id=5564, stack(0xb76de000,0xb772f000)]
=>0x823c8800 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=5578, stack(0x8220d000,0x8225e000)]
0x823c7400 JavaThread "AWT-Shutdown" [_thread_blocked, id=5577, stack(0x8225e000,0x822af000)]
0x823c5c00 JavaThread "AWT-XAWT" daemon [_thread_in_native, id=5576, stack(0x822af000,0x82300000)]
0x823b3400 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=5575, stack(0x82607000,0x82658000)]
0x82c2b800 JavaThread "Service Thread" daemon [_thread_blocked, id=5573, stack(0x826d9000,0x8272a000)]
0x82c29c00 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=5572, stack(0x8272a000,0x827ab000)]
0x82c27800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=5571, stack(0x827ab000,0x8282c000)]
0x82c26000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5570, stack(0x8282c000,0x8287d000)]
0x82c14400 JavaThread "Finalizer" daemon [_thread_blocked, id=5569, stack(0x82baf000,0x82c00000)]
0x82c12c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=5568, stack(0x82d25000,0x82d76000)]
Other Threads:
0x82c10400 VMThread [stack: 0x84b24000,0x84ba5000] [id=5567]
0x82c2d400 WatcherThread [stack: 0x82658000,0x826d9000] [id=5574]
VM state:not at safepoint (normal execution)
rxtx在jFTDIserial(https://github.com/hanneseilers/jFTDIserial)中用于自构建java库,用于通过其他几个库连接到串行端口。 jFTDIserial在独立测试中完美运行。
答案 0 :(得分:0)
从第二个jFTDiserial库实例覆盖rxtx的本机库时出现错误。