JDK-8203659 : Crash with: java -Xlog:*=trace -version
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2018-05-22
  • Updated: 2018-05-30
  • Resolved: 2018-05-30
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 12
12Resolved
Related Reports
Duplicate :  
Description
java -Xlog:*=trace -version
Segmentation fault (core dumped)

I looked with gdb, it is here:

$ gdb /opt/jdk-11-b11/bin/java
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /opt/jdk-11-b11/bin/java...(no debugging symbols found)...done.
(gdb) r -Xlog:*=trace -version
Starting program: /opt/jdk-11-b11/bin/java -Xlog:*=trace -version
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff7fda700 (LWP 23092)]

Thread 2 "java" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fda700 (LWP 23092)]
0x00007ffff6ab6469 in StringUtils::similarity(char const*, unsigned long, char const*, unsigned long) ()
   from /opt/jdk-11-b11/lib/server/libjvm.so
(gdb) bt
#0  0x00007ffff6ab6469 in StringUtils::similarity(char const*, unsigned long, char const*, unsigned long) ()
   from /opt/jdk-11-b11/lib/server/libjvm.so
#1  0x00007ffff6817eae in LogTag::fuzzy_match(char const*) () from /opt/jdk-11-b11/lib/server/libjvm.so
#2  0x00007ffff680fd99 in LogSelection::parse(char const*, outputStream*) () from /opt/jdk-11-b11/lib/server/libjvm.so
#3  0x00007ffff6817644 in LogSelectionList::parse(char const*, outputStream*) () from /opt/jdk-11-b11/lib/server/libjvm.so
#4  0x00007ffff6808523 in LogConfiguration::parse_log_arguments(char const*, char const*, char const*, char const*, outputStream*)
    () from /opt/jdk-11-b11/lib/server/libjvm.so
#5  0x00007ffff6809662 in LogConfiguration::parse_command_line_arguments(char const*) () from /opt/jdk-11-b11/lib/server/libjvm.so
#6  0x00007ffff61cdbb0 in Arguments::parse_each_vm_init_arg(JavaVMInitArgs const*, bool*, Flag::Flags) ()
   from /opt/jdk-11-b11/lib/server/libjvm.so
#7  0x00007ffff61ce971 in Arguments::parse_vm_init_args(JavaVMInitArgs const*, JavaVMInitArgs const*, JavaVMInitArgs const*) ()
   from /opt/jdk-11-b11/lib/server/libjvm.so
#8  0x00007ffff61d0211 in Arguments::parse(JavaVMInitArgs const*) () from /opt/jdk-11-b11/lib/server/libjvm.so
#9  0x00007ffff6b4884d in Threads::create_vm(JavaVMInitArgs*, bool*) () from /opt/jdk-11-b11/lib/server/libjvm.so
#10 0x00007ffff66b7e62 in JNI_CreateJavaVM () from /opt/jdk-11-b11/lib/server/libjvm.so
#11 0x00007ffff7793d04 in JavaMain () from /opt/jdk-11-b11/bin/../lib/jli/libjli.so
#12 0x00007ffff79a76ba in start_thread (arg=0x7ffff7fda700) at pthread_create.c:333
#13 0x00007ffff72c941d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Comments
Closing as dup of 8204055.
30-05-2018

To fix the crash: diff -r adec398d9051 src/hotspot/share/utilities/stringUtils.cpp --- a/src/hotspot/share/utilities/stringUtils.cpp Mon May 21 21:27:12 2018 -0700 +++ b/src/hotspot/share/utilities/stringUtils.cpp Tue May 22 22:23:23 2018 -0700 @@ -45,6 +45,10 @@ double StringUtils::similarity(const char* str1, size_t len1, const char* str2, size_t len2) { size_t total = len1 + len2; + if (len1 < 1 || len2 < 1) { + return 0.0; + } + size_t hit = 0; for (size_t i = 0; i < len1 - 1; i++) { for (size_t j = 0; j < len2 - 1; j++) { ------------- With the above patch, the output is: $ java -Xlog:*=trace -version [0.140s][error][logging] Invalid tag '' in log selection. Invalid -Xlog option '-Xlog:*=trace', see error log for details. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. This seems to be the same output as from JDK 10: $ jdk10/bin/java -version java version "10" 2018-03-20 Java(TM) SE Runtime Environment 18.3 (build 10+46) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode) $ jdk10/bin/java -Xlog:*=trace [0.002s][error][logging] Invalid tag '' in what-expression. Invalid -Xlog option '-Xlog:*=trace' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
30-05-2018