Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7147820

Unsafe.copyMemory crashes the JVM for memory mapped file (Copy_conjoint_jshorts)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      linux

      Description

      FULL PRODUCT VERSION :
      I tested this for jdk6, open-jdk6, jdk7_02 and _03. Here is the latest version:


      java version "1.7.0_03"
      Java(TM) SE Runtime Environment (build 1.7.0_03-b04)
      Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)


      FULL OS VERSION :
      Linux laptop 2.6.35-32-generic-pae #65-Ubuntu SMP Tue Jan 24 14:06:16 UTC 2012 i686 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      When running one of my tests with ByteBuffer.allocate all is fine, but when I switch to MappedByteBuffer one tests leads the JVM to fail. I can provide the source if necessary.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      ERROR MESSAGES/STACK TRACES THAT OCCUR :

      # A fatal error has been detected by the Java Runtime Environment:
      #
      # SIGSEGV (0xb) at pc=0xb6fad800, pid=27316, tid=3064585072
      #
      # JRE version: 7.0_03-b04
      # Java VM: Java HotSpot(TM) Server VM (22.1-b02 mixed mode linux-x86 )
      # Problematic frame:
      # V [libjvm.so+0x4e9800] _Copy_conjoint_jshorts_atomic+0x50
      #
      # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      #
      # If you would like to submit a bug report, please visit:
      # http://bugreport.sun.com/bugreport/crash.jsp
      #

      --------------- T H R E A D ---------------

      Current thread (0x093e2c00): JavaThread "main" [_thread_in_vm, id=27317, stack(0xb6a4d000,0xb6a9e000)]

      siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR), si_addr=0x6fc8c008

      Registers:
      EAX=0x0000000b, EBX=0xb726d4a4, ECX=0x00000005, EDX=0x00000002
      ESP=0xb6a9ce04, EBP=0xb6a9ce38, ESI=0x6fc8c008, EDI=0x2f0220e4
      EIP=0xb6fad800, EFLAGS=0x00210a06, CR2=0x6fc8c008

        Top of Stack: (sp=0xb6a9ce04)
      0xb6a9ce04: 9ecae0ec 6fc8c008 b6d9288b 6fc8c008
      0xb6a9ce14: 9ecae0ec 0000000b ffcae0fe 093e2c00
      0xb6a9ce24: 70c93b45 b6a9ce50 b726d4a4 093e2c00
      0xb6a9ce34: 0000000c b6a9ce78 b7187bb2 6fc8c008
      0xb6a9ce44: 9ecae0ec 00000016 70b10750 00000016
      0xb6a9ce54: 0000000c 6fc8c008 00000000 0000000c
      0xb6a9ce64: b6a90000 093e2c00 70bac0b8 70bac0b8
      0xb6a9ce74: 093e2c00 b6a9ced8 b39dce0a 093e2d20

      Instructions: (pc=0xb6fad800)
      0xb6fad7e0: 89 c8 d1 f9 74 29 83 f9 20 76 04 f3 a5 eb 20 29
      0xb6fad7f0: f7 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 90
      0xb6fad800: 8b 16 89 14 37 83 c6 04 83 e9 01 75 f3 01 f7 83
      0xb6fad810: e0 01 74 06 66 8b 16 66 89 17 5f 5e c3 fd 8d 7c

      Register to memory mapping:

      EAX=0x0000000b is an unknown value
      EBX=0xb726d4a4: <offset 0x7a94a4> in /opt/java/jdk1.7.0_03/jre/lib/i386/server/libjvm.so at 0xb6ac4000
      ECX=0x00000005 is an unknown value
      EDX=0x00000002 is an unknown value
      ESP=0xb6a9ce04 is pointing into the stack for thread: 0x093e2c00
      EBP=0xb6a9ce38 is pointing into the stack for thread: 0x093e2c00
      ESI=0x6fc8c008 is an unknown value
      EDI=0x2f0220e4 is an unknown value


      Stack: [0xb6a4d000,0xb6a9e000], sp=0xb6a9ce04, free space=319k
      Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
      V [libjvm.so+0x4e9800] _Copy_conjoint_jshorts_atomic+0x50
      V [libjvm.so+0x6c3bb2] Unsafe_CopyMemory2+0x1e2
      j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
      j java.nio.Bits.copyToArray(JLjava/lang/Object;JJJ)V+42
      j java.nio.DirectByteBuffer.get([BII)Ljava/nio/ByteBuffer;+98
      j java.nio.ByteBuffer.get([B)Ljava/nio/ByteBuffer;+5
      j de.jetsli.graph.storage.MMapGraph.getOutgoing(I)Lde/jetsli/graph/util/MyIteratorable;+37
      v ~StubRoutines::call_stub
      V [libjvm.so+0x3e8bd5] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x315
      V [libjvm.so+0x5a1bc9] os::os_exception_wrapper(void (*)(JavaValue*, methodHandle*, JavaCallArguments*, Thread*), JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x19
      V [libjvm.so+0x3e79ef] JavaCalls::call(JavaValue*, methodHandle, JavaCallArguments*, Thread*)+0x2f
      V [libjvm.so+0x3f493a] jni_invoke_static(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*)+0x23a
      V [libjvm.so+0x3fbd3b] jni_CallStaticVoidMethod+0xbb
      C [libjli.so+0x31cc] JavaMain+0x98c
      C [libpthread.so.0+0x5cc9] start_thread+0xd9

      Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
      j sun.misc.Unsafe.copyMemory(Ljava/lang/Object;JLjava/lang/Object;JJ)V+0
      j java.nio.Bits.copyToArray(JLjava/lang/Object;JJJ)V+42
      j java.nio.DirectByteBuffer.get([BII)Ljava/nio/ByteBuffer;+98
      j java.nio.ByteBuffer.get([B)Ljava/nio/ByteBuffer;+5
      j de.jetsli.graph.storage.MMapGraph.getOutgoing(I)Lde/jetsli/graph/util/MyIteratorable;+37
      v ~StubRoutines::call_stub

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

      Java Threads: ( => current thread )
        0x094dac00 JavaThread "Service Thread" daemon [_thread_blocked, id=27326, stack(0x6fe95000,0x6fee6000)]
        0x094d0400 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=27325, stack(0x6fee6000,0x6ff67000)]
        0x094ce400 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=27324, stack(0x6ff67000,0x6ffe8000)]
        0x094cc800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=27323, stack(0x6ffe8000,0x70039000)]
        0x0948f400 JavaThread "Finalizer" daemon [_thread_blocked, id=27322, stack(0x70359000,0x703aa000)]
        0x0948d800 JavaThread "Reference Handler" daemon [_thread_blocked, id=27321, stack(0x703aa000,0x703fb000)]
      =>0x093e2c00 JavaThread "main" [_thread_in_vm, id=27317, stack(0xb6a4d000,0xb6a9e000)]

      Other Threads:
        0x09488000 VMThread [stack: 0x703fb000,0x7047c000] [id=27320]
        0x094dc800 WatcherThread [stack: 0x6fe14000,0x6fe95000] [id=27327]

      VM state:not at safepoint (normal execution)

      VM Mutex/Monitor currently owned by a thread: None

      Heap
       PSYoungGen total 18816K, used 3285K [0x9e9c0000, 0x9feb0000, 0xb3910000)
        eden space 16192K, 20% used [0x9e9c0000,0x9ecf54d0,0x9f990000)
        from space 2624K, 0% used [0x9fc20000,0x9fc20000,0x9feb0000)
        to space 2624K, 0% used [0x9f990000,0x9f990000,0x9fc20000)
       PSOldGen total 42880K, used 0K [0x74b10000, 0x774f0000, 0x9e9c0000)
        object space 42880K, 0% used [0x74b10000,0x74b10000,0x774f0000)
       PSPermGen total 16384K, used 3373K [0x70b10000, 0x71b10000, 0x74b10000)
        object space 16384K, 20% used [0x70b10000,0x70e5b6b0,0x71b10000)

      Code Cache [0xb39d2000, 0xb3c12000, 0xb69d2000)
       total_blobs=142 nmethods=10 adapters=86 free_code_cache=48842Kb largest_free_block=49999936

      Dynamic libraries:
      08048000-08049000 r-xp 00000000 08:05 4859841 /opt/java/jdk1.7.0_03/bin/java
      08049000-0804a000 rw-p 00000000 08:05 4859841 /opt/java/jdk1.7.0_03/bin/java
      093dd000-096bb000 rw-p 00000000 00:00 0 [heap]
      6fc81000-6fc8a000 r--s 00254000 08:05 541417 /opt/java/jdk1.7.0_03/jre/lib/resources.jar
      6fc94000-6fc9b000 r-xp 00000000 08:05 549008 /opt/java/jdk1.7.0_03/jre/lib/i386/libmanagement.so
      6fc9b000-6fc9c000 rw-p 00006000 08:05 549008 /opt/java/jdk1.7.0_03/jre/lib/i386/libmanagement.so
      6fc9c000-6fcb0000 r-xp 00000000 08:05 549054 /opt/java/jdk1.7.0_03/jre/lib/i386/libnet.so
      6fcb0000-6fcb1000 rw-p 00014000 08:05 549054 /opt/java/jdk1.7.0_03/jre/lib/i386/libnet.so
      6fcb1000-6fcbf000 r-xp 00000000 08:05 549060 /opt/java/jdk1.7.0_03/jre/lib/i386/libnio.so
      6fcbf000-6fcc0000 rw-p 0000e000 08:05 549060 /opt/java/jdk1.7.0_03/jre/lib/i386/libnio.so
      6fcc0000-6fcc7000 r--s 00037000 08:05 3236054 /home/user/.m2/repository/junit/junit/4.10/junit-4.10.jar
      6fcc7000-6fcf6000 rw-p 00000000 00:00 0
      6fcf6000-6fe14000 r--s 01069000 08:05 4304032 /home/user/Dokumente/quell/graphstuff/graphhopper/target/graphhopper-1.0-SNAPSHOT-jar-with-dependencies.jar
      6fe14000-6fe15000 ---p 00000000 00:00 0
      6fe15000-6fe95000 rw-p 00000000 00:00 0
      6fe95000-6fe98000 ---p 00000000 00:00 0
      6fe98000-6fee6000 rw-p 00000000 00:00 0
      6fee6000-6fee9000 ---p 00000000 00:00 0
      6fee9000-6ff67000 rw-p 00000000 00:00 0
      6ff67000-6ff6a000 ---p 00000000 00:00 0
      6ff6a000-6ffe8000 rw-p 00000000 00:00 0
      6ffe8000-6ffeb000 ---p 00000000 00:00 0
      6ffeb000-70039000 rw-p 00000000 00:00 0
      70039000-70159000 r--p 00178000 08:08 919995 /usr/lib/locale/locale-archive
      70159000-70359000 r--p 00000000 08:08 919995 /usr/lib/locale/locale-archive
      70359000-7035c000 ---p 00000000 00:00 0
      7035c000-703aa000 rw-p 00000000 00:00 0
      703aa000-703ad000 ---p 00000000 00:00 0
      703ad000-703fb000 rw-p 00000000 00:00 0
      703fb000-703fc000 ---p 00000000 00:00 0
      703fc000-704c7000 rw-p 00000000 00:00 0
      704c7000-70686000 r--s 03a09000 08:05 541416 /opt/java/jdk1.7.0_03/jre/lib/rt.jar
      70686000-70687000 ---p 00000000 00:00 0
      70687000-70707000 rw-p 00000000 00:00 0
      70707000-70708000 ---p 00000000 00:00 0
      70708000-70790000 rw-p 00000000 00:00 0
      70790000-707a8000 rw-p 00000000 00:00 0
      707a8000-707bd000 rw-p 00000000 00:00 0
      707bd000-708f8000 rw-p 00000000 00:00 0
      708f8000-70900000 rw-p 00000000 00:00 0
      70900000-70918000 rw-p 00000000 00:00 0
      70918000-7092d000 rw-p 00000000 00:00 0
      7092d000-70a67000 rw-p 00000000 00:00 0
      70a67000-70a72000 rw-p 00000000 00:00 0
      70a72000-70b0f000 rw-p 00000000 00:00 0
      70b0f000-71b10000 rw-p 00000000 00:00 0
      71b10000-74b10000 rw-p 00000000 00:00 0
      74b10000-774f0000 rw-p 00000000 00:00 0
      774f0000-9e9c0000 rw-p 00000000 00:00 0
      9e9c0000-9feb0000 rw-p 00000000 00:00 0
      9feb0000-b3910000 rw-p 00000000 00:00 0
      b3912000-b391b000 rw-p 00000000 00:00 0
      b391b000-b39d2000 rw-p 00000000 00:00 0
      b39d2000-b3c12000 rwxp 00000000 00:00 0
      b3c12000-b69d2000 rw-p 00000000 00:00 0
      b69d2000-b69dc000 r-xp 00000000 08:08 412808 /lib/libnss_files-2.12.1.so
      b69dc000-b69dd000 r--p 00009000 08:08 412808 /lib/libnss_files-2.12.1.so
      b69dd000-b69de000 rw-p 0000a000 08:08 412808 /lib/libnss_files-2.12.1.so
      b69de000-b69e7000 r-xp 00000000 08:08 412810 /lib/libnss_nis-2.12.1.so
      b69e7000-b69e8000 r--p 00008000 08:08 412810 /lib/libnss_nis-2.12.1.so
      b69e8000-b69e9000 rw-p 00009000 08:08 412810 /lib/libnss_nis-2.12.1.so
      b69e9000-b69fc000 r-xp 00000000 08:08 412805 /lib/libnsl-2.12.1.so
      b69fc000-b69fd000 r--p 00012000 08:08 412805 /lib/libnsl-2.12.1.so
      b69fd000-b69fe000 rw-p 00013000 08:08 412805 /lib/libnsl-2.12.1.so
      b69fe000-b6a00000 rw-p 00000000 00:00 0
      b6a00000-b6a06000 r-xp 00000000 08:08 412806 /lib/libnss_compat-2.12.1.so
      b6a06000-b6a07000 r--p 00006000 08:08 412806 /lib/libnss_compat-2.12.1.so
      b6a07000-b6a08000 rw-p 00007000 08:08 412806 /lib/libnss_compat-2.12.1.so
      b6a08000-b6a1f000 r-xp 00000000 08:05 549050 /opt/java/jdk1.7.0_03/jre/lib/i386/libzip.so
      b6a1f000-b6a20000 rw-p 00017000 08:05 549050 /opt/java/jdk1.7.0_03/jre/lib/i386/libzip.so
      b6a20000-b6a43000 r-xp 00000000 08:05 549041 /opt/java/jdk1.7.0_03/jre/lib/i386/libjava.so
      b6a43000-b6a44000 rw-p 00023000 08:05 549041 /opt/java/jdk1.7.0_03/jre/lib/i386/libjava.so
      b6a44000-b6a4b000 r-xp 00000000 08:08 412815 /lib/librt-2.12.1.so
      b6a4b000-b6a4c000 r--p 00006000 08:08 412815 /lib/librt-2.12.1.so
      b6a4c000-b6a4d000 rw-p 00007000 08:08 412815 /lib/librt-2.12.1.so
      b6a4d000-b6a50000 ---p 00000000 00:00 0
      b6a50000-b6a9e000 rw-p 00000000 00:00 0
      b6a9e000-b6ac2000 r-xp 00000000 08:08 412803 /lib/libm-2.12.1.so
      b6ac2000-b6ac3000 r--p 00023000 08:08 412803 /lib/libm-2.12.1.so
      b6ac3000-b6ac4000 rw-p 00024000 08:08 412803 /lib/libm-2.12.1.so
      b6ac4000-b7232000 r-xp 00000000 08:05 549016 /opt/java/jdk1.7.0_03/jre/lib/i386/server/libjvm.so
      b7232000-b7281000 rw-p 0076d000 08:05 549016 /opt/java/jdk1.7.0_03/jre/lib/i386/server/libjvm.so
      b7281000-b76a1000 rw-p 00000000 00:00 0
      b76a1000-b77f8000 r-xp 00000000 08:08 412799 /lib/libc-2.12.1.so
      b77f8000-b77fa000 r--p 00157000 08:08 412799 /lib/libc-2.12.1.so
      b77fa000-b77fb000 rw-p 00159000 08:08 412799 /lib/libc-2.12.1.so
      b77fb000-b77fe000 rw-p 00000000 00:00 0
      b77fe000-b7800000 r-xp 00000000 08:08 412802 /lib/libdl-2.12.1.so
      b7800000-b7801000 r--p 00001000 08:08 412802 /lib/libdl-2.12.1.so
      b7801000-b7802000 rw-p 00002000 08:08 412802 /lib/libdl-2.12.1.so
      b7802000-b7803000 rw-p 00000000 00:00 0
      b7803000-b7816000 r-xp 00000000 08:05 549030 /opt/java/jdk1.7.0_03/jre/lib/i386/jli/libjli.so
      b7816000-b7817000 rw-p 00012000 08:05 549030 /opt/java/jdk1.7.0_03/jre/lib/i386/jli/libjli.so
      b7817000-b782c000 r-xp 00000000 08:08 412813 /lib/libpthread-2.12.1.so
      b782c000-b782d000 ---p 00015000 08:08 412813 /lib/libpthread-2.12.1.so
      b782d000-b782e000 r--p 00015000 08:08 412813 /lib/libpthread-2.12.1.so
      b782e000-b782f000 rw-p 00016000 08:08 412813 /lib/libpthread-2.12.1.so
      b782f000-b7831000 rw-p 00000000 00:00 0
      b7832000-b783a000 rw-s 00000000 08:08 1217914 /tmp/hsperfdata_user/27316
      b783a000-b783b000 rw-p 00000000 00:00 0
      b783b000-b783c000 r--p 00000000 00:00 0
      b783c000-b7848000 r-xp 00000000 08:05 549031 /opt/java/jdk1.7.0_03/jre/lib/i386/libverify.so
      b7848000-b7849000 rw-p 0000c000 08:05 549031 /opt/java/jdk1.7.0_03/jre/lib/i386/libverify.so
      b7849000-b784b000 rw-p 00000000 00:00 0
      b784b000-b784c000 r-xp 00000000 00:00 0 [vdso]
      b784c000-b7868000 r-xp 00000000 08:08 412645 /lib/ld-2.12.1.so
      b7868000-b7869000 r--p 0001b000 08:08 412645 /lib/ld-2.12.1.so
      b7869000-b786a000 rw-p 0001c000 08:08 412645 /lib/ld-2.12.1.so
      bff57000-bff79000 rw-p 00000000 00:00 0 [stack]

      VM Arguments:
      jvm_args: -Dawt.useSystemAAFontSettings=on
      java_command: de.jetsli.graph.Test
      Launcher Type: SUN_STANDARD

      Environment Variables:
      JAVA_HOME=/opt/java/java6/
      _JAVA_OPTIONS=-Dawt.useSystemAAFontSettings=on
      USERNAME=user
      SHELL=/bin/bash
      DISPLAY=:0.0

      Signal Handlers:
      SIGSEGV: [libjvm.so+0x6e2860], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGBUS: [libjvm.so+0x6e2860], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGFPE: [libjvm.so+0x5a3810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGPIPE: [libjvm.so+0x5a3810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGXFSZ: [libjvm.so+0x5a3810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGILL: [libjvm.so+0x5a3810], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
      SIGUSR2: [libjvm.so+0x5a3110], sa_mask[0]=0x00000000, sa_flags=0x10000004
      SIGHUP: [libjvm.so+0x5a56e0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGINT: [libjvm.so+0x5a56e0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGTERM: [libjvm.so+0x5a56e0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
      SIGQUIT: [libjvm.so+0x5a56e0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004


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

      OS:squeeze/sid

      uname:Linux 2.6.35-32-generic-pae #65-Ubuntu SMP Tue Jan 24 14:06:16 UTC 2012 i686
      libc:glibc 2.12.1 NPTL 2.12.1
      rlimit: STACK 8192k, CORE 0k, NPROC infinity, NOFILE 1024, AS infinity
      load average:0,21 0,35 0,31

      /proc/meminfo:
      MemTotal: 4112404 kB
      MemFree: 368380 kB
      Buffers: 11888 kB
      Cached: 336144 kB
      SwapCached: 110296 kB
      Active: 2566000 kB
      Inactive: 1052336 kB
      Active(anon): 2404052 kB
      Inactive(anon): 895088 kB
      Active(file): 161948 kB
      Inactive(file): 157248 kB
      Unevictable: 112 kB
      Mlocked: 112 kB
      HighTotal: 3268916 kB
      HighFree: 153448 kB
      LowTotal: 843488 kB
      LowFree: 214932 kB
      SwapTotal: 7811068 kB
      SwapFree: 5043652 kB
      Dirty: 104 kB
      Writeback: 0 kB
      AnonPages: 3212532 kB
      Mapped: 120920 kB
      Shmem: 28832 kB
      Slab: 43672 kB
      SReclaimable: 26076 kB
      SUnreclaim: 17596 kB
      KernelStack: 3712 kB
      PageTables: 24160 kB
      NFS_Unstable: 0 kB
      Bounce: 0 kB
      WritebackTmp: 0 kB
        CommitLimit: 9867268 kB
        Committed_AS: 5241088 kB
      VmallocTotal: 122880 kB
      VmallocUsed: 59604 kB
      VmallocChunk: 50684 kB
      HardwareCorrupted: 0 kB
      HugePages_Total: 0
      HugePages_Free: 0
      HugePages_Rsvd: 0
      HugePages_Surp: 0
      Hugepagesize: 2048 kB
      DirectMap4k: 827384 kB
      DirectMap2M: 86016 kB


      CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 23 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1

      /proc/cpuinf


      ( This report has more than 16,000 characters and has been truncated. )

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: