Description of problem: java incorrectly handles command line parameters which will make java crash on illegal arguments. How to reproduce: start java from command line like this: java -jar -Xmx4096M. (note the . at the end of the otherwise valid parameter) java -jar -Xmx128M java -jar -Xms512M -Xmx1024M./something.jar Expected behavior: Java should display an error message or the CLI help as of executing java --help What actually happens: Java crashes with segmentation fault Additional information: Backtrace from gdb: #0 __strchr_sse42 () at ../sysdeps/x86_64/multiarch/strchr.S:134 #1 0x0000003909e0711f in JLI_WildcardExpandClasspath (classpath=classpath@entry=0x0) at ../../../src/share/bin/wildcard.c:408 #2 0x0000003909e05529 in SetClassPath (s=0x0) at ../../../src/share/bin/java.c:696 #3 JLI_Launch (argc=2, argv=0x602098, jargc=jargc@entry=1, jargv=jargv@entry=0x0, appclassc=appclassc@entry=1, appclassv=appclassv@entry=0x0, fullversion=fullversion@entry=0x400870 "1.7.0_19-mockbuild_2013_05_15_15_51-b00", dotversion=dotversion@entry=0x400865 "1.7", pname=pname@entry=0x400860 "java", lname=lname@entry=0x400860 "java", javaargs=javaargs@entry=0 '\000', cpwildcard=cpwildcard@entry=1 '\001', javaw=javaw@entry=0 '\000', ergo=ergo@entry=0) at ../../../src/share/bin/java.c:283 #4 0x00000000004006b5 in main (argc=<optimized out>, argv=<optimized out>) at ../../../../src/share/bin/main.c:125 Version-Release number of selected component: java-1.7.0-openjdk-1.7.0.19-2.3.9.5.fc18 Additional info: reporter: libreport-2.1.4 backtrace_rating: 4 cmdline: java -jar -Xms512M -Xmx4096M./jdiskreport-1.4.0.jar crash_function: strchr executable: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.19.x86_64/jre/bin/java kernel: 3.9.2-200.fc18.x86_64 runlevel: N 5 uid: 1000 Truncated backtrace: Thread no. 1 (4 frames) #0 strchr at ../sysdeps/x86_64/multiarch/strchr.S:134 #1 JLI_WildcardExpandClasspath at ../../../src/share/bin/wildcard.c:408 #2 SetClassPath at ../../../src/share/bin/java.c:696 #3 JLI_Launch at ../../../src/share/bin/java.c:283 Potential duplicate: bug 875398
Created attachment 756111 [details] File: backtrace
Created attachment 756112 [details] File: cgroup
Created attachment 756113 [details] File: core_backtrace
Created attachment 756114 [details] File: dso_list
Created attachment 756115 [details] File: environ
Created attachment 756116 [details] File: limits
Created attachment 756117 [details] File: maps
Created attachment 756118 [details] File: open_fds
Created attachment 756119 [details] File: proc_pid_status
Created attachment 756120 [details] File: var_log_messages
I know that this is an upstream bug but I found no way to report it (http://openjdk.java.net/ just mentions where to send patches, not where to report bugs and Sun Bugzilla is private/read-only).
This seems to be fixed with the upcoming 2.4 release: $ /home/andrew/build/icedtea7/bin/java -jar -Xmx4096M. Invalid maximum heap size: -Xmx4096M. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. $ /home/andrew/build/icedtea7-2.3/bin/java -jar -Xmx4096M. Segmentation fault (core dumped) $ /home/andrew/build/icedtea7-2.2/bin/java -jar -Xmx4096M. Segmentation fault (core dumped) $ /home/andrew/build/icedtea7-2.1/bin/java -jar -Xmx4096M. Segmentation fault (core dumped) 6 seems to be fine so you could use that in the meantime: $ /usr/lib/jvm/icedtea-6/bin/java -jar -Xmx4096M. Invalid maximum heap size: -Xmx4096M. Could not create the Java virtual machine.
I suspect: changeset: 5561:6bd9089ebe96 user: ksrini date: Thu Aug 16 08:29:30 2012 -0700 summary: 7151434: java -jar -XX crashes java launcher
Should be this one: http://planetjava.org/java-openjdk-core-libs-devel/2012-04/msg00037.html Thanks!
Why are you closing this? The fix has not been packaged yet.
Sorry, I didn't know how you are handling this.
It's ok. I'm just used to closing things myself ;-)
Fixed in http://blog.fuseyism.com/index.php/2013/06/10/icedtea-2-4-0-released/ and backporting to earlier versions.
In 2.3.10: http://blog.fuseyism.com/index.php/2013/06/28/security-icedtea-2-3-10-for-openjdk-7-released/ Needs jvanek to confirm when this is packaged.
Fedora 18 have already received fixed b25 (based on 2.3.10 Andrew is linking, so issue should be fixed. f17 and f19 are still in testing repo.