JDK-6499219 : SIGXFSZ kills VM
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 5.0u9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2006-11-30
  • Updated: 2020-11-02
  • Resolved: 2007-02-17
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.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Related Reports
Relates :  
Relates :  
Description
J2SE Version (please include all output from java -version flag):
  1.5.0_09

Does this problem occur on J2SE 1.3, 1.4.x or 1.5?  Yes / No (pick one)
  Yes


Operating System Configuration Information (be specific):
  Linux


Bug Description:
  When writing very large files on some Systems, the JVM is exiting stating 
  that 'File size limit exceeded'. On many Linux systems there is a file called
  /etc/security/limits.conf which by default puts a hard limit on users file 
  sizes to 100Mb.

  When Clients are uploading Files, we don't want the Server to crash because 
  of a very large file. We would expect Java to throw an IOException when this 
  signal is received instead of exiting the JVM.


Steps to Reproduce (be specific):
  Here is a test file which has been tested on Linux using jre 1.5.0_09
  with the limits.conf having a small hard file size limit of 1000 KBs

import static java.lang.System.*;
import java.io.*;

public class Test {
 public static void main(String[] args) {
   try {
     new FileOutputStream(new File("test.txt")).write(new byte[10000000]);
   }
   catch (Throwable ex) {
     ex.printStackTrace();
   }
   out.println("Done");
 }
}

  The first 1024000 bytes are written to the file, then the JVM simply exits 
  stating that 'File size limit exceeded'. There is no error log file (looked in 
  all the normal places and ran a locate hs_err_pid to double check).
  The word Done is never displayed.

Comments
EVALUATION Results of test with VM handling SIGXFSZ: java Test java.io.IOException: File too large at java.io.FileOutputStream.writeBytes(Native Method) at java.io.FileOutputStream.write(FileOutputStream.java:247) at Test.main(Test.java:10) Done
24-01-2007

EVALUATION VM needs to handle SIGXFSZ signal.
24-01-2007

EVALUATION The issue is that the SIGXFSZ signal is killing the VM. Here's the output from strace: [pid 9470] write(10, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8976000 <unfinished ...> [pid 9472] <... fstat64 resumed> {st_mode=S_IFREG|0644, st_size=1569, ...}) = 0 [pid 9470] <... write resumed> ) = -1 EFBIG (File too large) [pid 9472] read(11, <unfinished ...> [pid 9470] --- SIGXFSZ (File size limit exceeded) @ 0 (0) --- Process 9470 detached [pid 9472] <... read resumed> "\312\376\272\276\0\0\0001\0G\t\0\7\0*\t\0\7\0+\t\0\7\0"..., 1569) = 1569 [pid 9469] <... futex resumed> ) = -1 EINTR (Interrupted system call) [pid 9471] <... futex resumed> ) = -1 EINTR (Interrupted system call) [pid 9477] <... futex resumed> ) = -1 EINTR (Interrupted system call) [pid 9473] <... futex resumed> ) = -1 EINTR (Interrupted system call) [pid 9474] <... futex resumed> ) = -1 EINTR (Interrupted system call) [pid 9475] <... futex resumed> ) = -1 EINTR (Interrupted system call) [pid 9476] <... futex resumed> ) = -1 EINTR (Interrupted system call) [pid 9471] +++ killed by SIGXFSZ (core dumped) +++ Process 9471 detached [pid 9477] +++ killed by SIGXFSZ (core dumped) +++ Process 9477 detached [pid 9472] +++ killed by SIGXFSZ (core dumped) +++ Process 9472 detached [pid 9473] +++ killed by SIGXFSZ (core dumped) +++ Process 9473 detached [pid 9474] +++ killed by SIGXFSZ (core dumped) +++ Process 9474 detached [pid 9475] +++ killed by SIGXFSZ (core dumped) +++ Process 9475 detached [pid 9476] +++ killed by SIGXFSZ (core dumped) +++ Process 9476 detached +++ killed by SIGXFSZ (core dumped) +++ Process 9469 detached
30-11-2006