JDK-5074836 : (fs) MappedByteBuffer.force() throws IOException / ENOSPC
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 1.4.2
  • Priority: P1
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8
  • CPU: sparc
  • Submitted: 2004-07-16
  • Updated: 2004-11-18
  • Resolved: 2004-11-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
1.4.2_07 b03Fixed 6Fixed
Description
My ISV has one bug and could not provide standalone test case.

the program exports data to database, it works fine with jdk1.4.1_06
but fails with jdk1.4.2_02 , 1.4.2_04, 1.4.2_05.
I assume the problem is related to libnio.so , when i swap it with jdk1.4.1_06's 
libnio.so , the program willnot fail(no Exception thrown).
Below is error message during exception occuring

5.07.04 14:33 com.sap.inst.jload.Jload logStackTrace
SEVERE: java.io.IOException: Not enough space
        at java.nio.MappedByteBuffer.force0(Native Method)
        at java.nio.MappedByteBuffer.force(MappedByteBuffer.java:138)
        at com.sap.inst.jload.io.DataFile.putEntry(DataFile.java:287)
        at com.sap.inst.jload.db.DBTable.unload(DBTable.java:190)
        at com.sap.inst.jload.Jload.dbExport(Jload.java:172)
        at com.sap.inst.jload.Jload.executeJob(Jload.java:383)
        at com.sap.inst.jload.Jload.main(Jload.java:541) 

It could not be no enough space problem. since it works fine with jdk1.4.1_06
and fails on jdk1.4.2x 

I provide a test landscape. to use this test landscape please follow below
steps

You can telnet suncc19 (129.157.142.19) with your sun ID 
Then from suncc19, you can telnet 172.16.8.156 
Login lroot  (root user) 
Pass sap 

cd /install/unix_pack 
Run ./testrun 

The file /install/unix_pack/testrun is a script. You could switch jdk version here 

#setenv JAVA_HOME /usr/j2sdk1.4.2_04  //this is jdk1.4.2_04 
setenv JAVA_HOME /usr/j2se // this is jdk1.4.1_06  

If test go through no exception happens, you have to stop program by contral + c 
Then check result at jload.log 

If test fails, you will see vm exit. You could check result in jload.log 

Test will pass with jdk1.4.1_06 
, will fail with jdk1.4.2x 



Ps: if you need reboot machine 
Switch to su - sunadm 
Then tyep stopsap all 
Wait until sap system stops completely 
Then you could reboot machine

Blew oupput is result when i type command df -k before Exception occurs on
test landscape machine

/dev/dsk/c0t0d0s0    4129290 1928960 2159038    48%    /
/proc                      0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
fd                         0       0       0     0%    /dev/fd
swap                 4061256     104 4061152     1%    /var/run
swap                 4065416    4264 4061152     1%    /tmp
/dev/md/dsk/d10      63566161 35139049 27791451    56%    /data
###@###.### 10/15/04 21:30 GMT
###@###.### 10/15/04 21:31 GMT

Comments
SUGGESTED FIX mage:"/space/1.4.2/j2se" 61 $ diff src/solaris/native/common/jlong_md.h /net/koori.sfbay/onestop/jdk/1.5.0_01/promoted/latest/ws/j2se/src/solaris/native/common/jlong_md.h 2c2 < * %W% %E% --- > * @(#)jlong_md.h 1.19 03/12/19 4c4 < * Copyright 2003 Sun Microsystems, Inc. All rights reserved. --- > * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 54c54 < #define ptr_to_jlong(a) ((jlong)(unsigned int)(a)) --- > #define ptr_to_jlong(a) ((jlong)(int)(a)) mage:"/space/1.4.2/j2se" 63 $ diff src/windows/native/common/jlong_md.h /net/koori.sfbay/onestop/jdk/1.5.0_01/promoted/latest/ws/j2se/src/windows/native/common/jlong_md.h 2c2 < * %W% %E% --- > * @(#)jlong_md.h 1.13 03/12/19 4c4 < * Copyright 2003 Sun Microsystems, Inc. All rights reserved. --- > * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 55c55 < #define ptr_to_jlong(a) ((jlong)(unsigned int)(a)) --- > #define ptr_to_jlong(a) ((jlong)(int)(a)) ###@###.### 2004-09-14 The above was deemed too risky for an update release. We're still looking for the best definitions of those macros for the future. ###@###.### 10/15/04 21:30 GMT The above fix has rejected. The fix integrated into 1.4.2_07 b03 is viewable as webrev: http://jpsesvr.sfbay.sun.com:8080/ctetools/html/ViewDetail.jsp?index=1198 ###@###.### 2004-11-11 ###@###.### 2004-11-11 03:48:59 GMT
11-11-2004

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.4.2_07
28-09-2004

EVALUATION I strongly doubt that this is a bug in J2SE. The reported exception will only occur when the fsync(2) or fdatasync(2) system calls return the ENOSPC error code, which happens when there isn't enough room on the filesystem to which the content of the mapped buffer is being written. Was there enough space on the disk for the data being written at the time the exception was thrown? In the description you way that you substituted a 1.4.1 libnio.so. Did the program work as expected after that, or was there some other failure? The severity level of this bug is just S4. Why is its priority P1? -- ###@###.### 2004/7/16
07-12-0182