zeromq / jzmq

Java binding for ZeroMQ
http://www.zeromq.org
GNU General Public License v3.0
589 stars 364 forks source link

A fatal error has been detected by the Java Runtime Environment: #372

Open umbria opened 9 years ago

umbria commented 9 years ago

I used zmq version 2.2 and built jzmq.dll with Microsoft Visual Studio 2013. I has a lots of trouble to buid this biinding librayr but anyway I thought I made it. Then I tested to show version number ant it worked so far. I ran hwserver example as below. When I read the Guide , I felt that this library is very easy to use. But as a result, I found that it's really hard to use it. Even I couldn't run simple server.

// // Hello World server in Java // Binds REP socket to tcp://*:5555 // Expects "Hello" from client, replies with "World" //

import org.zeromq.ZMQ;

public class hwserver {

public static void main(String[] args) throws Exception {
    ZMQ.Context context = ZMQ.context(1);

    //  Socket to talk to clients
    ZMQ.Socket responder = context.socket(ZMQ.REP);
    responder.bind("tcp://*:5555");

    while (!Thread.currentThread().isInterrupted()) {
        // Wait for next request from the client
        byte[] request = responder.recv(0);
        System.out.println("Received Hello");

        // Do some 'work'
        Thread.sleep(1000);

        // Send reply back to client
        String reply = "World";
        responder.send(reply.getBytes(), 0);
    }
    responder.close();
    context.term();
}

}

Now I got the error below.

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fee3b14090, pid=10692, tid=11500

JRE version: Java(TM) SE Runtime Environment (7.0_71-b14) (build 1.7.0_71-b14) Java VM: Java HotSpot(TM) 64-Bit Server VM (24.71-b01 mixed mode windows-amd64 compressed oops) Problematic frame: C [libzmq-v100-mt.dll+0x14090]

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as: C:\workspace\Test\hs_err_pid10692.log

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.

And this is hs_err_pid8676.log

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fed6b54090, pid=8676, tid=7644

JRE version: Java(TM) SE Runtime Environment (7.0_71-b14) (build 1.7.0_71-b14) Java VM: Java HotSpot(TM) 64-Bit Server VM (24.71-b01 mixed mode windows-amd64 compressed oops) Problematic frame: C [libzmq-v100-mt.dll+0x14090]

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 (0x000000000299b800): JavaThread "main" [_thread_in_native, id=7644, stack(0x00000000039e0000,0x0000000003ae0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000000000f1

Registers: RAX=0x000000000dcad800, RBX=0x0000000000000001, RCX=0x0000000000000001, RDX=0x000000000dcad800 RSP=0x0000000003adf398, RBP=0x0000000003adf490, RSI=0x000000000dcad800, RDI=0x000000000dcad800 R8 =0x000000000dcad800, R9 =0x000000000000000c, R10=0x000000000dcad80c, R11=0x00000000d78bac78 R12=0x0000000000000000, R13=0x0000000080eb9380, R14=0x0000000003adf498, R15=0x000000000299b800 RIP=0x000007fed6b54090, EFLAGS=0x0000000000010202

Top of Stack: (sp=0x0000000003adf398) 0x0000000003adf398: 000007fed6b5e5ca 0000000003adf688 0x0000000003adf3a8: 0000000000000000 0000000003adf498 0x0000000003adf3b8: 0000000080eb9380 000000000299b9e8 0x0000000003adf3c8: 000007fefa491e61 0000000000000001 0x0000000003adf3d8: 0000000003adf490 0000000080eb5358 0x0000000003adf3e8: 000000000299b9e8 0000000003ae60f8 0x0000000003adf3f8: 0000000003af3150 0000000080eb5358 0x0000000003adf408: 0000000003adf498 0000000080eb9380 0x0000000003adf418: 0000000003adf470 000000000299b800 0x0000000003adf428: 0000000003adf510 0000000003adf430 0x0000000003adf438: 0000000080eb9380 0000000003adf498 0x0000000003adf448: 0000000080eba208 0000000000000000 0x0000000003adf458: 0000000080eb9380 0000000000000000 0x0000000003adf468: 0000000003adf490 0000000003adf4e0 0x0000000003adf478: 0000000003ae60f8 0000000000000000 0x0000000003adf488: 0000000003aef0d8 00000000d78bac38

Instructions: (pc=0x000007fed6b54090) 0x000007fed6b54070: ff 15 12 03 03 00 48 8b cb e8 c2 20 ff ff 48 8b 0x000007fed6b54080: c7 48 8b 5c 24 50 48 83 c4 30 5f c3 cc cc cc cc 0x000007fed6b54090: 81 b9 f0 00 00 00 af ec dd ba 0f 94 c0 c3 cc cc 0x000007fed6b540a0: 40 57 48 83 ec 30 48 c7 44 24 20 fe ff ff ff 48

Register to memory mapping:

RAX=0x000000000dcad800 is an unknown value RBX=0x0000000000000001 is an unknown value RCX=0x0000000000000001 is an unknown value RDX=0x000000000dcad800 is an unknown value RSP=0x0000000003adf398 is pointing into the stack for thread: 0x000000000299b800 RBP=0x0000000003adf490 is pointing into the stack for thread: 0x000000000299b800 RSI=0x000000000dcad800 is an unknown value RDI=0x000000000dcad800 is an unknown value R8 =0x000000000dcad800 is an unknown value R9 =0x000000000000000c is an unknown value R10=0x000000000dcad80c is an unknown value R11=0x00000000d78bac78 is an oop java.lang.String

Stack: [0x00000000039e0000,0x0000000003ae0000], sp=0x0000000003adf398, free space=1020k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [libzmq-v100-mt.dll+0x14090]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.zeromq.ZMQ$Socket.bind(Ljava/lang/String;)V+0 j hwserver.main([Ljava/lang/String;)V+14 v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread ) 0x000000000bb57800 JavaThread "Service Thread" daemon [_thread_blocked, id=1752, stack(0x000000000d7f0000,0x000000000d8f0000)] 0x000000000bb4e000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=4840, stack(0x000000000d640000,0x000000000d740000)] 0x000000000bb49000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=10508, stack(0x000000000d3b0000,0x000000000d4b0000)] 0x000000000bb44000 JavaThread "Attach Listener" daemon [_thread_blocked, id=3084, stack(0x000000000d050000,0x000000000d150000)] 0x000000000bb3c800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3060, stack(0x000000000cda0000,0x000000000cea0000)] 0x0000000002a85800 JavaThread "Finalizer" daemon [_thread_blocked, id=11896, stack(0x000000000d260000,0x000000000d360000)] 0x0000000002a7e000 JavaThread "Reference Handler" daemon [_thread_blocked, id=10284, stack(0x000000000d150000,0x000000000d250000)] =>0x000000000299b800 JavaThread "main" [_thread_in_native, id=7644, stack(0x00000000039e0000,0x0000000003ae0000)]

Other Threads: 0x000000000bae4800 VMThread [stack: 0x000000000cf20000,0x000000000d020000] [id=9404] 0x000000000bba3800 WatcherThread [stack: 0x000000000d540000,0x000000000d640000] [id=8536]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap PSYoungGen total 36864K, used 4604K [0x00000000d7480000, 0x00000000d9d80000, 0x0000000100000000) eden space 31744K, 14% used [0x00000000d7480000,0x00000000d78ff130,0x00000000d9380000) from space 5120K, 0% used [0x00000000d9880000,0x00000000d9880000,0x00000000d9d80000) to space 5120K, 0% used [0x00000000d9380000,0x00000000d9380000,0x00000000d9880000) ParOldGen total 82944K, used 0K [0x0000000085e00000, 0x000000008af00000, 0x00000000d7480000) object space 82944K, 0% used [0x0000000085e00000,0x0000000085e00000,0x000000008af00000) PSPermGen total 21504K, used 2792K [0x0000000080c00000, 0x0000000082100000, 0x0000000085e00000) object space 21504K, 12% used [0x0000000080c00000,0x0000000080eba388,0x0000000082100000)

Card table byte_map: [0x0000000006ae0000,0x0000000006ee0000] byte_map_base: 0x00000000066da000

Polling page: 0x00000000030d0000

Code Cache [0x0000000003ae0000, 0x0000000003d50000, 0x0000000006ae0000) total_blobs=211 nmethods=26 adapters=138 free_code_cache=48702Kb largest_free_block=49841920

Compilation events (10 events): Event: 0.343 Thread 0x000000000bb49000 nmethod 22 0x0000000003b42590 code [0x0000000003b426c0, 0x0000000003b42778] Event: 0.343 Thread 0x000000000bb49000 23 java.lang.String::replace (127 bytes) Event: 0.352 Thread 0x000000000bb49000 nmethod 23 0x0000000003b4d010 code [0x0000000003b4d160, 0x0000000003b4d558] Event: 0.352 Thread 0x000000000bb49000 24 sun.nio.cs.UTF_8$Decoder::decode (640 bytes) Event: 0.360 Thread 0x000000000bb4e000 nmethod 20 0x0000000003b50ed0 code [0x0000000003b510e0, 0x0000000003b51de0] Event: 0.368 Thread 0x000000000bb4e000 25 java.lang.Object:: (1 bytes) Event: 0.369 Thread 0x000000000bb49000 nmethod 24 0x0000000003b55850 code [0x0000000003b55b00, 0x0000000003b56830] Event: 0.369 Thread 0x000000000bb4e000 nmethod 25 0x0000000003b4cdd0 code [0x0000000003b4cf00, 0x0000000003b4cf78] Event: 0.372 Thread 0x000000000bb4e000 26 sun.nio.cs.UTF_8$Encoder::encode (361 bytes) Event: 0.378 Thread 0x000000000bb4e000 nmethod 26 0x0000000003b53310 code [0x0000000003b53460, 0x0000000003b53948]

GC Heap History (0 events): No events

Deoptimization events (0 events): No events

Internal exceptions (10 events): Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d775d538 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d775d660 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d775e518 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d775e640 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d775f570 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d775f698 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d77605c8 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.343 Thread 0x000000000299b800 Threw 0x00000000d77606f0 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.409 Thread 0x000000000299b800 Threw 0x00000000d78aac80 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281 Event: 0.444 Thread 0x000000000299b800 Threw 0x00000000d78b1420 at C:\re\jdk7u71\1605\hotspot\src\share\vm\prims\jvm.cpp:1281

Events (10 events): Event: 0.295 loading class 0x0000000002a0f010 Event: 0.295 loading class 0x0000000002a0f010 done Event: 0.296 loading class 0x0000000002a28b10 Event: 0.296 loading class 0x0000000002a28b10 done Event: 0.400 loading class 0x00000000029ed740 Event: 0.401 loading class 0x00000000029ed740 done Event: 0.409 loading class 0x000000000bb4ea10 Event: 0.409 loading class 0x000000000bb4ea10 done Event: 0.444 loading class 0x000000000bb4ea70 Event: 0.444 loading class 0x000000000bb4ea70 done

Dynamic libraries: 0x000000013f930000 - 0x000000013f963000 C:\sw\Java\jdk1.7.0_71\bin\javaw.exe 0x0000000077500000 - 0x00000000776a9000 C:\Windows\SYSTEM32\ntdll.dll 0x00000000773e0000 - 0x00000000774ff000 C:\Windows\system32\kernel32.dll 0x000007fefd490000 - 0x000007fefd4fc000 C:\Windows\system32\KERNELBASE.dll 0x000007fefe160000 - 0x000007fefe23b000 C:\Windows\system32\ADVAPI32.dll 0x000007fefe320000 - 0x000007fefe3bf000 C:\Windows\system32\msvcrt.dll 0x000007fefdd90000 - 0x000007fefddaf000 C:\Windows\SYSTEM32\sechost.dll 0x000007feff6e0000 - 0x000007feff80d000 C:\Windows\system32\RPCRT4.dll 0x00000000772e0000 - 0x00000000773da000 C:\Windows\system32\USER32.dll 0x000007fefe0a0000 - 0x000007fefe107000 C:\Windows\system32\GDI32.dll 0x000007fefe080000 - 0x000007fefe08e000 C:\Windows\system32\LPK.dll 0x000007fefe3c0000 - 0x000007fefe489000 C:\Windows\system32\USP10.dll 0x000007fefbb80000 - 0x000007fefbd74000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\COMCTL32.dll 0x000007fefddb0000 - 0x000007fefde21000 C:\Windows\system32\SHLWAPI.dll 0x000007feff690000 - 0x000007feff6be000 C:\Windows\system32\IMM32.DLL 0x000007fefd950000 - 0x000007fefda59000 C:\Windows\system32\MSCTF.dll 0x000007fef6860000 - 0x000007fef68b8000 C:\Windows\INCOPS3\icdcnl64.dll 0x0000000064340000 - 0x0000000064412000 C:\sw\Java\jdk1.7.0_71\bin\MSVCR100.dll 0x000007fef5770000 - 0x000007fef57c0000 C:\Windows\INCOPS3\ICATCDLL64.dll 0x000007fefdb00000 - 0x000007fefdd03000 C:\Windows\system32\ole32.dll 0x000007fefc2f0000 - 0x000007fefc2fc000 C:\Windows\system32\VERSION.dll 0x0000000074000000 - 0x0000000074098000 C:\Windows\system32\MSVCP100.dll 0x000007fef56a0000 - 0x000007fef576a000 C:\Windows\INCOPS3\ESSPD64.dll 0x000007feef300000 - 0x000007feef561000 C:\Windows\pcdrm\NSCFA64.DLL 0x000007fefe110000 - 0x000007fefe15d000 C:\Windows\system32\WS2_32.dll 0x000007fefe090000 - 0x000007fefe098000 C:\Windows\system32\NSI.dll 0x000007fefb380000 - 0x000007fefb393000 C:\Windows\pcdrm\NBID64.dll 0x0000000002430000 - 0x0000000002507000 C:\Windows\system32\OLEAUT32.dll 0x000007fefe670000 - 0x000007feff3f8000 C:\Windows\system32\SHELL32.DLL 0x000007fef5330000 - 0x000007fef533b000 C:\Windows\pcdrm\NSCPE64.dll 0x000007fef2f10000 - 0x000007fef2f2f000 C:\Windows\pcdrm\NFD0164.dll 0x000007fefd2d0000 - 0x000007fefd2df000 C:\Windows\system32\profapi.dll 0x000007fef2ef0000 - 0x000007fef2f01000 C:\Windows\pcdrm\NFD0264.dll 0x000007fee8d20000 - 0x000007fee8f9a000 C:\Windows\pcdrm\NSCCOR0364.DLL 0x0000000002be0000 - 0x0000000002be7000 C:\Windows\system32\psapi.dll 0x000007fef3390000 - 0x000007fef33b3000 C:\Windows\system32\f_im.dll 0x0000000180000000 - 0x000000018002a000 C:\Program Files\Fasoo DRM\f_nxa.dll 0x0000000061000000 - 0x00000000610ba000 C:\Program Files\Fasoo DRM\f_sps.dll 0x000000006ea70000 - 0x000000006ea9f000 C:\Windows\WinSxS\amd64_microsoft.vc90.atl_1fc8b3b9a1e18e3b_9.0.30729.6161_none_0a1fd3a3a768b895\ATL90.DLL 0x000007fef8370000 - 0x000007fef83e1000 C:\Windows\system32\winspool.drv 0x000007fefb3e0000 - 0x000007fefb3f8000 C:\Windows\system32\dwmapi.dll 0x0000000062f10000 - 0x0000000062fe2000 C:\sw\Java\jdk1.7.0_71\jre\bin\msvcr100.dll 0x0000000059470000 - 0x0000000059c43000 C:\sw\Java\jdk1.7.0_71\jre\bin\server\jvm.dll 0x000007fef9050000 - 0x000007fef9059000 C:\Windows\system32\WSOCK32.dll 0x000007fefaf70000 - 0x000007fefafab000 C:\Windows\system32\WINMM.dll 0x00000000730d0000 - 0x00000000730df000 C:\sw\Java\jdk1.7.0_71\jre\bin\verify.dll 0x000000006fb30000 - 0x000000006fb58000 C:\sw\Java\jdk1.7.0_71\jre\bin\java.dll 0x000000006fd30000 - 0x000000006fd45000 C:\sw\Java\jdk1.7.0_71\jre\bin\zip.dll 0x000007fefa490000 - 0x000007fefa499000 C:\ZeroMQ\bin\jzmq.dll 0x000007fed6b40000 - 0x000007fed6bb2000 C:\ZeroMQ\bin\libzmq-v100-mt.dll 0x000007fefa6b0000 - 0x000007fefa6d7000 C:\Windows\system32\IPHLPAPI.DLL 0x000007fefa5b0000 - 0x000007fefa5bb000 C:\Windows\system32\WINNSI.DLL 0x000007fed6830000 - 0x000007fed691f000 C:\Windows\system32\MSVCR120.dll 0x000007fefcba0000 - 0x000007fefcbf5000 C:\Windows\system32\mswsock.dll 0x000007fefc2d0000 - 0x000007fefc2d7000 C:\Windows\System32\wshtcpip.dll 0x000007fefc300000 - 0x000007fefc44f000 C:\Windows\system32\Anywall364.dll 0x000007fef4ae0000 - 0x000007fef4c05000 C:\Windows\system32\dbghelp.dll

VM Arguments: jvm_args: -Dfile.encoding=UTF-8 java_command: hwserver Launcher Type: SUN_STANDARD

Environment Variables: JAVA_HOME=C:\sw\Java\jdk1.7.0_71 PATH=C:/sw/Java/jdk1.7.0_71/bin/../jre/bin/server;C:/sw/Java/jdk1.7.0_71/bin/../jre/bin;C:/sw/Java/jdk1.7.0_71/bin/../jre/lib/amd64;C:\sw\Java\jdk1.7.0_71\bin;C:\ProgramData\Oracle\Java\javapath;C:\sw\Java\jdk1.7.0_71\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\sw\Utilities\apache-maven-3.2.3\bin;C:\Program Files (x86)\Perforce;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Calibre2\;C:\sw\Utilities\nodejs\;C:\Program Files\SlikSvn\bin;C:\Program Files\TortoiseSVN\bin;C:\sw\Utilities\apache-ant-1.9.4\bin;C:\ZeroMQ\bin;C:\Program Files (x86)\CMake\bin;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\you\AppData\Roaming\npm;C:\sw\ide\eclipse; USERNAME=you OS=Windows_NT PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel

--------------- S Y S T E M ---------------

OS: Windows 7 , 64 bit Build 7601 Service Pack 1

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, erms, ht, tsc, tscinvbit, tscinv

Memory: 4k page, physical 8001060k(1229580k free), swap 16000264k(8042808k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (24.71-b01) for windows-amd64 JRE (1.7.0_71-b14), built on Sep 26 2014 16:16:12 by "java_re" with unknown MS VC++:1600

time: Fri Feb 27 14:11:09 2015 elapsed time: 0 seconds

littlermine commented 9 years ago

I have encountered this problem, OS: Windows 7, 64 bit , but zeromq version is 4.0.5 and use jzmq-2.1.1.jar. But when use jzmq-3.1.0.jar and then I tested it, it's OK. I think this may help you. Best wishes.