-
Bug
-
Resolution: Fixed
-
P3
-
11, 15.0.1
-
b11
-
x86_64
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8263299 | 16.0.2 | Harold Seigel | P3 | Resolved | Fixed | b01 |
JDK-8263197 | 16.0.1 | Harold Seigel | P3 | Resolved | Fixed | b08 |
JDK-8264457 | 15.0.4 | Vladimir Kempik | P3 | Resolved | Fixed | b01 |
JDK-8264426 | 13.0.8 | Vladimir Kempik | P3 | Resolved | Fixed | b01 |
JDK-8262984 | 11.0.12-oracle | Dukebot | P3 | Resolved | Fixed | b01 |
JDK-8264635 | 11.0.12 | Vladimir Kempik | P3 | Resolved | Fixed | b01 |
JDK-8275135 | openjdk8u322 | Vladimir Kempik | P3 | Resolved | Fixed | b01 |
JDK-8267595 | 8u311 | Fairoz Matte | P3 | Resolved | Fixed | b01 |
macOS Big Sur 11.2
A DESCRIPTION OF THE PROBLEM :
Anytime a divide any integer value in a System.out.println() by 0, utilizing a try-catch statement to deal with this ArithmeticException, a message pops up on my screen stating "A fatal error has been detected by the Java Runtime Environment." Another thing, is whenever I write System.out.println(1/0); or any integer being divided by 0, my entire IDE crashes immediately without the program even being run (Eclipse).
ERROR MESSAGES/STACK TRACES THAT OCCUR :
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGFPE (0x8) at pc=0x000000011778d168, pid=1403, tid=7427
#
# JRE version: Java(TM) SE Runtime Environment (15.0.1+9) (build 15.0.1+9-18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (15.0.1+9-18, mixed mode, sharing, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# j Arithmetic_Exception.main([Ljava/lang/String;)V+4
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/shaheer/eclipse-workspace/Handling_Exception_(Throws)/hs_err_pid1403.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Int x=1; // Can be any integer
int y=0;
System.out.println(x/y) // Even a try-statement cannot deal with this
//Second bug
System.out.println(1/0) //Can be any integer as the numerator.
// Any time this gets written out, the entire IDE will crash without even running the program
ACTUAL -
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGFPE (0x8) at pc=0x000000011778d168, pid=1460, tid=8963
#
# JRE version: Java(TM) SE Runtime Environment (15.0.1+9) (build 15.0.1+9-18)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (15.0.1+9-18, mixed mode, sharing, tiered, compressed oops, g1 gc, bsd-amd64)
# Problematic frame:
# j Arithmetic_Exception.main([Ljava/lang/String;)V+4
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/shaheer/eclipse-workspace/Handling_Exception_(Throws)/hs_err_pid1460.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
---------- BEGIN SOURCE ----------
public class Arithmetic_Exception {
public static void main(String[] args) {
int x=5;
int y=0;
try {System.out.println(x/y);}
catch(ArithmeticException A) {System.out.println("y cannot be 0");}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
I haven't found any workaround, I simply just avoid it. Albeit, this hinders me a lot when I am working.
FREQUENCY : always
- backported by
-
JDK-8262984 try catch Method failing to work when dividing an integer by 0
- Resolved
-
JDK-8263197 try catch Method failing to work when dividing an integer by 0
- Resolved
-
JDK-8263299 try catch Method failing to work when dividing an integer by 0
- Resolved
-
JDK-8264426 try catch Method failing to work when dividing an integer by 0
- Resolved
-
JDK-8264457 try catch Method failing to work when dividing an integer by 0
- Resolved
-
JDK-8264635 try catch Method failing to work when dividing an integer by 0
- Resolved
-
JDK-8267595 try catch Method failing to work when dividing an integer by 0
- Resolved
-
JDK-8275135 try catch Method failing to work when dividing an integer by 0
- Resolved
- relates to
-
JDK-8263386 Do we need to restrict workaround for JDK-8261397 even further?
- Closed
-
JDK-8261966 macOS M1: report in hs_err log if we are running x86 code in emulation mode (Rosetta)
- Resolved
- links to
-
Commit openjdk/jdk13u-dev/dff02a66
-
Commit openjdk/jdk15u-dev/53b642ab
-
Commit openjdk/jdk16u/e3e74008
-
Commit openjdk/jdk/0257caad
-
Review openjdk/jdk13u-dev/164
-
Review openjdk/jdk15u-dev/3
-
Review openjdk/jdk16u/75
-
Review openjdk/jdk/2615