Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8325945

Error reporting should limit the number of String characters printed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 23
    • hotspot
    • b08

      Running attached Test2.java deliberately crashes the VM and error reporting then prints a live String as part of the "Register to memory mapping" section. Since the String is large, error reporting takes a significant amount of time and the generated hs_err file is > 25 MB. This can easily be made worse by increasing String size and/or adding more Strings.

      java -XX:-TieredCompilation -Xcomp -XX:CompileCommand=compileonly,Test2::test Test2.java

      Register to memory mapping:

      RAX=0x000000062bc51ed0 is an oop: java.lang.String
      {0x000000062bc51ed0} - klass: 'java/lang/String'
       - string: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      xxxxxxxxxxxxxx [...]

      Similar to MaxElementPrintSize for array elements, the number of String characters that are printed should be limited.

      The issue was originally found by [~davleopo] with an internal test. I wrote a standalone reproducer (attached Test2.java).

            dholmes David Holmes
            thartmann Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: