Ola amigos
Possuo uma aplicação que faz comunicação com varias portas seriais e pra isso utilizo varias classes de comunicação que utilizão o API RXTXcomm 64bits.
Exemplo da conexão de cada classe:
public int send () throws Exception{
app.main.ocupado2 = 1;
SerialParameters params = defaultParameters;
mySerial =new SerialConnection (params);
mySerial.openConnection();
aThread=new Thread(this);
aThread.start() ;
return 0;
}[/code]
Estou tendo o seguinte erro após um tempo de operação:
[size=7][code]
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800087dd, pid=4308, tid=6692
#
# JRE version: 7.0_03-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (22.1-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [rxtxSerial.dll+0x87dd]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
--------------- T H R E A D ---------------
Current thread (0x0000000007d8c000): JavaThread "SwingWorker-pool-1-thread-1" daemon [_thread_in_native, id=6692, stack(0x000000000ad30000,0x000000000ae30000)]
siginfo: ExceptionCode=0xc0000005, writing address 0x0000000000000100
Registers:
RAX=0x0000000000000000, RBX=0x000000000af87dd0, RCX=0x0000000000000002, RDX=0x0000000000000000
RSP=0x000000000ae2ee00, RBP=0x000000000ae2f078, RSI=0x000000000a20947a, RDI=0x000000000af87980
R8 =0x0000000000000000, R9 =0x0000000000000000, R10=0x0000000000000049, R11=0x0000000000000001
R12=0x000000000ae2f080, R13=0x000000078003aa78, R14=0x000000000ae2f080, R15=0x0000000007d8c000
RIP=0x00000001800087dd, EFLAGS=0x0000000000010202
Top of Stack: (sp=0x000000000ae2ee00)
0x000000000ae2ee00: 000000000af87dd0 000000000a209470
0x000000000ae2ee10: 000000000ae2f078 000000006ca38c47
0x000000000ae2ee20: 000000000a209470 000000018000aab4
0x000000000ae2ee30: 0000000007d8c1d0 0000000000000106
0x000000000ae2ee40: 000000078003aa78 000000000ae2f080
0x000000000ae2ee50: 0000000007d869d0 000000000a209470
0x000000000ae2ee60: 000000000ae2f078 000000018000b7fe
0x000000000ae2ee70: 0000000007d8c000 000000006c3df4ad
0x000000000ae2ee80: 0000000007d8c1d0 00000007d80dcdf8
0x000000000ae2ee90: 0000000000000000 0000000007d8c1d0
0x000000000ae2eea0: 00001d8cced25cb7 000000007fffffdb
0x000000000ae2eeb0: 000000000ae2ef40 0000000700000042
0x000000000ae2eec0: 0000000007d8c1d0 0000000000000000
0x000000000ae2eed0: 000000000a209470 000000018000213d
0x000000000ae2eee0: 0000000007d8c1d0 000000018001c0b0
0x000000000ae2eef0: 0000000000000000 0000000180000000
Instructions: (pc=0x00000001800087dd)
0x00000001800087bd: 00 00 7e 3d 48 8b 87 08 01 00 00 48 89 bb 00 01
0x00000001800087cd: 00 00 48 89 83 08 01 00 00 48 8b 87 08 01 00 00
0x00000001800087dd: 48 89 98 00 01 00 00 48 89 9f 08 01 00 00 48 8b
0x00000001800087ed: c3 48 8b 5c 24 30 48 8b 74 24 38 48 83 c4 20 5f
Register to memory mapping:
RAX=0x0000000000000000 is an unknown value
RBX=0x000000000af87dd0 is an unknown value
RCX=0x0000000000000002 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x000000000ae2ee00 is pointing into the stack for thread: 0x0000000007d8c000
RBP=0x000000000ae2f078 is pointing into the stack for thread: 0x0000000007d8c000
RSI=0x000000000a20947a is an unknown value
RDI=0x000000000af87980 is an unknown value
R8 =0x0000000000000000 is an unknown value
R9 =0x0000000000000000 is an unknown value
R10=0x0000000000000049 is an unknown value
R11=0x0000000000000001 is an unknown value
R12=0x000000000ae2f080 is pointing into the stack for thread: 0x0000000007d8c000
R13=0x000000078003aa78 is an oop
{constMethod}
- klass: {other class}
- method: 0x000000078003aa80 {method} 'open' '(Ljava/lang/String;)I' in 'gnu/io/RXTXPort'
- exceptions: 0x000000077f201d40
R14=0x000000000ae2f080 is pointing into the stack for thread: 0x0000000007d8c000
R15=0x0000000007d8c000 is a thread
Stack: [0x000000000ad30000,0x000000000ae30000], sp=0x000000000ae2ee00, free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [rxtxSerial.dll+0x87dd] Java_gnu_io_RXTXPort_interruptEventLoop+0x130d
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j gnu.io.RXTXPort.open(Ljava/lang/String;)I+0
j gnu.io.RXTXPort.<init>(Ljava/lang/String;)V+125
j gnu.io.RXTXCommDriver.getCommPort(Ljava/lang/String;I)Lgnu/io/CommPort;+78
j gnu.io.CommPortIdentifier.open(Ljava/lang/String;I)Lgnu/io/CommPort;+171
j Modem.SerialConnection.openConnection()V+31
j Modem.Sender.send()I+25
J sms.main.router()V
j sms.main.access$1200(Lsms/main;)V+1
j sms.main$13.doInBackground()Ljava/lang/Object;+563
j javax.swing.SwingWorker$1.call()Ljava/lang/Object;+14
j java.util.concurrent.FutureTask$Sync.innerRun()V+29
j java.util.concurrent.FutureTask.run()V+4
j javax.swing.SwingWorker.run()V+4
j java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V+46
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x000000000a1d0000 JavaThread "Thread-18" daemon [_thread_blocked, id=3092, stack(0x000000000b350000,0x000000000b450000)]
0x000000000a1d0800 JavaThread "Thread-17" daemon [_thread_in_native, id=2964, stack(0x0000000008b90000,0x0000000008c90000)]
=>0x0000000007d8c000 JavaThread "SwingWorker-pool-1-thread-1" daemon [_thread_in_native, id=6692, stack(0x000000000ad30000,0x000000000ae30000)]
0x0000000007d73000 JavaThread "MySQL Statement Cancellation Timer" daemon [_thread_blocked, id=1352, stack(0x0000000009ef0000,0x0000000009ff0000)]
0x0000000007c3c000 JavaThread "TimerQueue" daemon [_thread_blocked, id=6492, stack(0x000000000a040000,0x000000000a140000)]
0x0000000001dcb800 JavaThread "DestroyJavaVM" [_thread_blocked, id=6228, stack(0x0000000001de0000,0x0000000001ee0000)]
0x000000000640f800 JavaThread "AWT-EventQueue-0" [_thread_blocked, id=6276, stack(0x0000000008ce0000,0x0000000008de0000)]
0x00000000063f3800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=6504, stack(0x00000000080e0000,0x00000000081e0000)]
0x00000000063ef000 JavaThread "AWT-Shutdown" [_thread_blocked, id=3396, stack(0x0000000007eb0000,0x0000000007fb0000)]
0x00000000063ee000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=2960, stack(0x00000000077b0000,0x00000000078b0000)]
0x0000000006347000 JavaThread "Service Thread" daemon [_thread_blocked, id=6220, stack(0x0000000007650000,0x0000000007750000)]
0x000000000633e800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=6812, stack(0x00000000074b0000,0x00000000075b0000)]
0x0000000006337000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=4540, stack(0x00000000071d0000,0x00000000072d0000)]
0x0000000006336000 JavaThread "Attach Listener" daemon [_thread_blocked, id=5872, stack(0x0000000007300000,0x0000000007400000)]
0x0000000006335000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=5652, stack(0x0000000006cf0000,0x0000000006df0000)]
0x00000000062ae000 JavaThread "Finalizer" daemon [_thread_blocked, id=2976, stack(0x0000000006f40000,0x0000000007040000)]
0x00000000062a7800 JavaThread "Reference Handler" daemon [_thread_blocked, id=2644, stack(0x0000000007060000,0x0000000007160000)]
Other Threads:
0x000000000629d800 VMThread [stack: 0x0000000006e30000,0x0000000006f30000] [id=1260]
0x0000000006362000 WatcherThread [stack: 0x00000000078c0000,0x00000000079c0000] [id=1940]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
PSYoungGen total 36992K, used 27883K [0x00000007d6c00000, 0x00000007d9540000, 0x0000000800000000)
eden space 31744K, 87% used [0x00000007d6c00000,0x00000007d873ac38,0x00000007d8b00000)
from space 5248K, 0% used [0x00000007d9020000,0x00000007d9020000,0x00000007d9540000)
to space 5248K, 0% used [0x00000007d8b00000,0x00000007d8b00000,0x00000007d9020000)
PSOldGen total 84480K, used 0K [0x0000000784400000, 0x0000000789680000, 0x00000007d6c00000)
object space 84480K, 0% used [0x0000000784400000,0x0000000784400000,0x0000000789680000)
PSPermGen total 21248K, used 14770K [0x000000077f200000, 0x00000007806c0000, 0x0000000784400000)
object space 21248K, 69% used [0x000000077f200000,0x000000078006cb00,0x00000007806c0000)
Code Cache [0x0000000001ee0000, 0x0000000002150000, 0x0000000004ee0000)
total_blobs=592 nmethods=109 adapters=435 free_code_cache=48423Kb largest_free_block=49529024
Dynamic libraries:
0x000000013fee0000 - 0x000000013ff13000 C:\Program Files\Java\jdk1.7.0_03\bin\java.exe
0x0000000077960000 - 0x0000000077b09000 C:\Windows\SYSTEM32\ntdll.dll
0x0000000077840000 - 0x000000007795f000 C:\Windows\system32\kernel32.dll
0x000007fefdeb0000 - 0x000007fefdf1c000 C:\Windows\system32\KERNELBASE.dll
0x000007fefe1a0000 - 0x000007fefe27b000 C:\Windows\system32\ADVAPI32.dll
0x000007fefe280000 - 0x000007fefe31f000 C:\Windows\system32\msvcrt.dll
0x000007fefe4f0000 - 0x000007fefe50f000 C:\Windows\SYSTEM32\sechost.dll
0x000007fefe3c0000 - 0x000007fefe4ed000 C:\Windows\system32\RPCRT4.dll
0x0000000077280000 - 0x000000007737a000 C:\Windows\system32\USER32.dll
0x000007fefe510000 - 0x000007fefe577000 C:\Windows\system32\GDI32.dll
0x000007fefe190000 - 0x000007fefe19e000 C:\Windows\system32\LPK.dll
0x000007feff9b0000 - 0x000007feffa79000 C:\Windows\system32\USP10.dll
0x000007fefc9c0000 - 0x000007fefcbb4000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll
0x000007fefe5b0000 - 0x000007fefe621000 C:\Windows\system32\SHLWAPI.dll
0x000007fefe580000 - 0x000007fefe5ae000 C:\Windows\system32\IMM32.DLL
0x000007feff820000 - 0x000007feff929000 C:\Windows\system32\MSCTF.dll
0x000000006c9d0000 - 0x000000006caa1000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\msvcr100.dll
0x000000006c2f0000 - 0x000000006c9ca000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\server\jvm.dll
0x000007fef4a20000 - 0x000007fef4a29000 C:\Windows\system32\WSOCK32.dll
0x000007feff7d0000 - 0x000007feff81d000 C:\Windows\system32\WS2_32.dll
0x000007feffc60000 - 0x000007feffc68000 C:\Windows\system32\NSI.dll
0x000007fefb910000 - 0x000007fefb94b000 C:\Windows\system32\WINMM.dll
0x0000000077b20000 - 0x0000000077b27000 C:\Windows\system32\PSAPI.DLL
0x000000006c2a0000 - 0x000000006c2af000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\verify.dll
0x000000006c270000 - 0x000000006c298000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\java.dll
0x000000006c250000 - 0x000000006c265000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\zip.dll
0x000000006c070000 - 0x000000006c204000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\awt.dll
0x000007fefe630000 - 0x000007fefe707000 C:\Windows\system32\OLEAUT32.dll
0x000007feff5c0000 - 0x000007feff7c3000 C:\Windows\system32\ole32.dll
0x000007fefc520000 - 0x000007fefc576000 C:\Windows\system32\uxtheme.dll
0x000007fefc100000 - 0x000007fefc118000 C:\Windows\system32\dwmapi.dll
0x000007fefdcf0000 - 0x000007fefdcff000 C:\Windows\system32\CRYPTBASE.dll
0x000007fefe830000 - 0x000007feff5b8000 C:\Windows\system32\SHELL32.dll
0x000000006c030000 - 0x000000006c064000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\fontmanager.dll
0x000000006c230000 - 0x000000006c249000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\net.dll
0x000007fefd5f0000 - 0x000007fefd645000 C:\Windows\system32\mswsock.dll
0x000007fefd5e0000 - 0x000007fefd5e7000 C:\Windows\System32\wship6.dll
0x000000006c210000 - 0x000000006c221000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\nio.dll
0x000007fefe320000 - 0x000007fefe3b9000 C:\Windows\system32\CLBCatQ.DLL
0x000007fefbf90000 - 0x000007fefc0ba000 C:\Windows\system32\WindowsCodecs.dll
0x000007fefdc50000 - 0x000007fefdca7000 C:\Windows\system32\apphelp.dll
0x000007fef9200000 - 0x000007fef9235000 C:\Windows\system32\EhStorShell.dll
0x000007feffa80000 - 0x000007feffc57000 C:\Windows\system32\SETUPAPI.dll
0x000007fefde70000 - 0x000007fefdea6000 C:\Windows\system32\CFGMGR32.dll
0x000007fefe170000 - 0x000007fefe18a000 C:\Windows\system32\DEVOBJ.dll
0x000007fefc670000 - 0x000007fefc79c000 C:\Windows\system32\PROPSYS.dll
0x000007fef9180000 - 0x000007fef91fe000 C:\Windows\System32\cscui.dll
0x000007fef9170000 - 0x000007fef917c000 C:\Windows\System32\CSCDLL.dll
0x000007fef9160000 - 0x000007fef916f000 C:\Windows\system32\CSCAPI.dll
0x000007fef90e0000 - 0x000007fef9160000 C:\Windows\system32\ntshrui.dll
0x000007fefd8d0000 - 0x000007fefd8f3000 C:\Windows\system32\srvcli.dll
0x000007fefb7a0000 - 0x000007fefb7ab000 C:\Windows\system32\slc.dll
0x000000006bfe0000 - 0x000000006c021000 C:\Program Files\Java\jdk1.7.0_03\jre\bin\t2k.dll
0x000007fefcfa0000 - 0x000007fefcfa7000 C:\Windows\System32\wshtcpip.dll
0x000007fefd470000 - 0x000007fefd4cb000 C:\Windows\system32\DNSAPI.dll
0x00000000735a0000 - 0x00000000735d5000 C:\Program Files\Bonjour\mdnsNSP.dll
0x000007fefb1c0000 - 0x000007fefb1e7000 C:\Windows\system32\Iphlpapi.DLL
0x000007fefb1b0000 - 0x000007fefb1bb000 C:\Windows\system32\WINNSI.DLL
0x000007fef7220000 - 0x000007fef724f000 C:\Program Files\Common Files\Microsoft Shared\Windows Live\WLIDNSP.DLL
0x000007fef6310000 - 0x000007fef6318000 C:\Windows\system32\rasadhlp.dll
0x000007fef96c0000 - 0x000007fef9713000 C:\Windows\System32\fwpuclnt.dll
0x0000000180000000 - 0x0000000180025000 C:\Windows\System32\rxtxSerial.dll
VM Arguments:
jvm_args: -Dfile.encoding=UTF-8
java_command: sms.main
Launcher Type: SUN_STANDARD
Environment Variables:
CLASSPATH=.;C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip
PATH=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin
USERNAME=ServerWillSig
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 7 , 64 bit Build 7601 Service Pack 1
CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 42 stepping 7, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht
Memory: 4k page, physical 8107192k(5500576k free), swap 16212532k(10919580k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (22.1-b02) for windows-amd64 JRE (1.7.0_03-b05), built on Feb 3 2012 20:43:56 by "java_re" with unknown MS VC++:1600
time: Wed Apr 18 14:50:00 2012
elapsed time: 20 seconds
[/size]
[size=14]Isso so apresenta quando duas classes com execução em Thread abrem a porta serial dos dispositivos ao mesmo tempo .ex: COM1 e COM2.
Oque eu estou fazendo de errado?[/size]
Vlww