JDK-8013898 : java -jar - causes a segfault
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 7u5,7u6,7u10,7u21
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2013-03-20
  • Updated: 2013-05-07
  • Resolved: 2013-05-07
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version  " 1.7.0_10 " 
Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

also seen on:
java version  " 1.7.0_05 " 
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux w520 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


EXTRA RELEVANT SYSTEM CONFIGURATION :
64-bit linux (ubuntu/debian derivative)

A DESCRIPTION OF THE PROBLEM :
Not exactly a huge deal since this is essentially a bad handling of typographical error that wouldn't run anyway, but if you omit the jar file and put a dash (-) character instead you get a segmentation fault.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1 - Call:
java -jar -
2 - Segfault.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
An error message of some kind
ACTUAL -
Segmentation fault (core dumped)


REPRODUCIBILITY :
This bug can be reproduced always.
Comments
This is a duplicate of JDK-7151434 and is already fixed.
07-05-2013

I was able to reproduce this on MacOS X with 7u21, as well as 7u6b19 that I happened to have around: ~ $ /JDKs/jdk1.7.0_06.jdk-b19/Contents/Home/bin/java -jar - Segmentation fault: 11 It no longer segfaults with jdk8: ~ $ /JDKs/jdk1.8.0.jdk-b87/Contents/Home/bin/java -jar - Unrecognized option: - Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
04-05-2013