United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6799037 (fs) MappedByteBuffer.load crash with unaligned file-mapping (sol)
JDK-6799037 : (fs) MappedByteBuffer.load crash with unaligned file-mapping (sol)

Details
Type:
Bug
Submit Date:
2009-01-29
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
core-libs
OS:
generic,solaris_10
Sub-Component:
java.nio
CPU:
sparc,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u14,7
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
A crash was encountered by a customer mpping a multi-GB file in 2GB chunks on Niagara system. Here is the error log from the crash:

#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0xfffffffb67204938, pid=19032, tid=2
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0-b16 mixed mode solaris-sparc)
# Problematic frame:
# C  [libnio.so+0x4938]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/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 (0x0000000100116c00):  JavaThread "main" [_thread_in_native, id=2, stack(0xffffffff7c600000,0xffffffff7c700000)]

siginfo:si_signo=SIGBUS: si_errno=0, si_code=1 (BUS_ADRALN), si_addr=0xfffffffa1ffffffe

Registers:
 O0=0xffffffffffffffff O1=0x000000007ffffffe O2=0x0000000000000800 O3=0x0000000000000003
 O4=0x0000000000000800 O5=0x0000000000002000 O6=0xffffffff7c6feb81 O7=0xfffffffb67204904
 G1=0x0000000000000083 G2=0x0000000100116c00 G3=0x0000000000000004 G4=0xffffffff7c6ff520
 G5=0x000000008129e800 G6=0x0000000000000000 G7=0xffffffff7f400a00 Y=0x0000000000000000
 PC=0xfffffffb67204938 nPC=0xfffffffb6720493c


Top of Stack: (sp=0xffffffff7c6ff380)
0xffffffff7c6ff380:   000000007ffffffd fffffffb701bb3f5
0xffffffff7c6ff390:   fffffffb701bb400 ffffffff7c6ff458
0xffffffff7c6ff3a0:   0000000000000000 0000000000000588
0xffffffff7c6ff3b0:   fffffffb701bb7f0 0000000000000000
0xffffffff7c6ff3c0:   0000000100116dc0 000000000003ffff
0xffffffff7c6ff3d0:   0000000000002000 0000000000040000
0xffffffff7c6ff3e0:   0000000000002000 fffffffa1ffffffe
0xffffffff7c6ff3f0:   ffffffff7c6fec31 ffffffff7800dff4
0xffffffff7c6ff400:   ffffffff7c6fec91 ffffffff78005fdc
0xffffffff7c6ff410:   ffffffff7c6fec91 fffffffe1ed1ed10
0xffffffff7c6ff420:   fffffffb703897d0 ffffffff7c6ff668
0xffffffff7c6ff430:   ffffffff7c6ff458 fffffffb70390a9c
0xffffffff7c6ff440:   fffffffb7039e448 ffffffff7c6ff6e8
0xffffffff7c6ff450:   ffffffff7c6ff460 ffffffff7800af60
0xffffffff7c6ff460:   ffffffff7c6ff5e0 0000000100116c00
0xffffffff7c6ff470:   0000000000000019 ffffffff7c6ff6e8 

Instructions: (pc=0xfffffffb67204938)
0xfffffffb67204928:   b5 2a b0 02 80 a6 e0 04 06 40 00 15 ae 10 20 00
0xfffffffb67204938:   ea 07 60 00 ac 07 40 1a b0 06 ff fe f6 06 80 1d 

Stack: [0xffffffff7c600000,0xffffffff7c700000],  sp=0xffffffff7c6ff380,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libnio.so+0x4938]
j  java.nio.MappedByteBuffer.load0(JJI)I+-55724
j  java.nio.MappedByteBuffer.load0(JJI)I+0
j  java.nio.MappedByteBuffer.load()Ljava/nio/MappedByteBuffer;+38
j  TestLoader.main([Ljava/lang/String;)V+365
v  ~StubRoutines::call_stub
V  [libjvm.so+0x17ad48]
V  [libjvm.so+0x18583c]
V  [libjvm.so+0x228d44]
C  [java+0x3c24]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.nio.MappedByteBuffer.load0(JJI)I+0
j  java.nio.MappedByteBuffer.load()Ljava/nio/MappedByteBuffer;+38
j  TestLoader.main([Ljava/lang/String;)V+365
v  ~StubRoutines::call_stub

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

Java Threads: ( => current thread )
  0x0000000100a86c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=73, stack(0xfffffffb68600000,0xfffffffb68700000)]
  0x0000000100a7fc00 JavaThread "CompilerThread1" daemon [_thread_blocked, id=72, stack(0xfffffffb68800000,0xfffffffb68900000)]
  0x0000000100a7d800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=71, stack(0xfffffffb68a00000,0xfffffffb68b00000)]
  0x0000000100a7c800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=70, stack(0xfffffffb68c00000,0xfffffffb68d00000)]
  0x0000000100a5b400 JavaThread "Finalizer" daemon [_thread_blocked, id=69, stack(0xfffffffb69000000,0xfffffffb69100000)]
  0x0000000100a54400 JavaThread "Reference Handler" daemon [_thread_blocked, id=68, stack(0xfffffffb69200000,0xfffffffb69300000)]
=>0x0000000100116c00 JavaThread "main" [_thread_in_native, id=2, stack(0xffffffff7c600000,0xffffffff7c700000)]

Other Threads:
  0x0000000100a4dc00 VMThread [stack: 0xfffffffb69400000,0xfffffffb69500000] [id=67]
  0x0000000100a88800 WatcherThread [stack: 0xfffffffb68400000,0xfffffffb68500000] [id=74]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 PSYoungGen      total 308224K, used 5283K [0xfffffffe1ec00000, 0xfffffffe34400000, 0xffffffff73800000)
  eden space 264192K, 2% used [0xfffffffe1ec00000,0xfffffffe1f128f70,0xfffffffe2ee00000)
  from space 44032K, 0% used [0xfffffffe31900000,0xfffffffe31900000,0xfffffffe34400000)
  to   space 44032K, 0% used [0xfffffffe2ee00000,0xfffffffe2ee00000,0xfffffffe31900000)
 PSOldGen        total 700416K, used 0K [0xfffffffb75400000, 0xfffffffba0000000, 0xfffffffe1ec00000)
  object space 700416K, 0% used [0xfffffffb75400000,0xfffffffb75400000,0xfffffffba0000000)
 PSPermGen       total 24576K, used 3838K [0xfffffffb70000000, 0xfffffffb71800000, 0xfffffffb75400000)
  object space 24576K, 15% used [0xfffffffb70000000,0xfffffffb703bf940,0xfffffffb71800000)

Dynamic libraries:
0x0000000100000000 	/appserver/jdk1.6.0_11_64bit/bin/sparcv9/java
0xffffffff7f700000 	/lib/64/libthread.so.1
0xffffffff7f200000 	/appserver/jdk1.6.0_11_64bit/bin/sparcv9/../../jre/lib/sparcv9/jli/libjli.so
0xffffffff7f000000 	/lib/64/libdl.so.1
0xffffffff7ed00000 	/lib/64/libc.so.1
0xffffffff7ec00000 	/platform/SUNW,SPARC-Enterprise-T5120/lib/sparcv9/libc_psr.so.1
0xffffffff7e000000 	/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/server/libjvm.so
0xffffffff7de00000 	/lib/64/libsocket.so.1
0xffffffff7eb00000 	/usr/lib/64/libsched.so.1
0xffffffff7dc00000 	/lib/64/libm.so.1
0xffffffff7da00000 	/usr/lib/64/libCrun.so.1
0xffffffff7d800000 	/lib/64/libdoor.so.1
0xffffffff7d600000 	/lib/64/libnsl.so.1
0xffffffff7d400000 	/lib/64/libm.so.2
0xffffffff7d200000 	/lib/64/libscf.so.1
0xffffffff7d000000 	/lib/64/libuutil.so.1
0xffffffff7ce00000 	/lib/64/libgen.so.1
0xffffffff7cc00000 	/lib/64/libmd.so.1
0xffffffff7ca00000 	/platform/SUNW,SPARC-Enterprise-T5120/lib/sparcv9/libmd_psr.so.1
0xffffffff7c800000 	/lib/64/libmp.so.2
0xffffffff7c400000 	/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/native_threads/libhpi.so
0xffffffff7c000000 	/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/libverify.so
0xffffffff7be00000 	/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/libjava.so
0xffffffff7bc00000 	/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/libzip.so
0xfffffffb68e00000 	/usr/lib/locale/en_US.ISO8859-1/sparcv9/en_US.ISO8859-1.so.3
0xfffffffb68000000 	/appserver/berkeleydb.4.6.21_sparc/lib/libdb_java-4.6.so
0xfffffffb67e00000 	/lib/64/libresolv.so.2
0xfffffffb67c00000 	/lib/64/librt.so.1
0xffffffff7c100000 	/lib/64/libpthread.so.1
0xfffffffb67a00000 	/usr/sfw/lib/64/libgcc_s.so.1
0xfffffffb67800000 	/lib/64/libaio.so.1
0xfffffffb67400000 	/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/libnet.so
0xfffffffb67200000 	/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/libnio.so

VM Arguments:
jvm_args: -Djava.ext.dirs=/appserver/berkeleydb/lib:./jars 
java_command: TestLoader /appdb/data/mytestenv true
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/usr/bin:/usr/sbin:/usr/openwin/bin:/usr/local/bin:/usr/ccs/bin:/opt/sfw/bin:/opt/sfw/sbin:/usr/ucb:/opt/VRTS/bin
LD_LIBRARY_PATH=/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9/server:/appserver/jdk1.6.0_11_64bit/jre/lib/sparcv9:/appserver/jdk1.6.0_11_64bit/jre/../lib/sparcv9:/lib:/usr/lib:/usr/local/lib:/opt/sfw/lib:/usr/sfw/lib/64
SHELL=/bin/bash

Signal Handlers:
SIGSEGV: [libjvm.so+0x748f28], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGBUS: [libjvm.so+0x748f28], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGFPE: [libjvm.so+0x1e33a0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGPIPE: [libjvm.so+0x1e33a0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGXFSZ: [libjvm.so+0x1e33a0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGILL: [libjvm.so+0x1e33a0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGQUIT: [libjvm.so+0x63b480], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGHUP: [libjvm.so+0x63b480], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGINT: [libjvm.so+0x63b480], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIGTERM: [libjvm.so+0x63b480], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
SIG39: [libjvm.so+0x63e668], sa_mask[0]=0x00000000, sa_flags=0x00000008
SIG40: [libjvm.so+0x1e33a0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c


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

OS:                      Solaris 10 10/08 s10s_u6wos_07b SPARC
           Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 27 October 2008

uname:SunOS 5.10 Generic_137137-09 sun4v  (T2 libthread)
rlimit: STACK 8192k, CORE infinity, NOFILE 65536, AS infinity
load average:0.16 0.14 0.18

CPU:total 64 has_v8, has_v9, has_vis1, has_vis2, is_ultra3, is_sun4v, is_niagara1

Memory: 8k page, physical 66977792k(59912960k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (11.0-b16) for solaris-sparc JRE (1.6.0_11-b03), built on Nov 10 2008 01:54:48 by "" with Workshop 5.8

time: Tue Jan 27 15:49:28 2009
elapsed time: 10 seconds

                                    

Comments
EVALUATION

The load method touches the pages by reading an int from each page without taking alignment into consideration.
                                     
2009-02-02



Hardware and Software, Engineered to Work Together