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

Resource mark breaks printing to string stream

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b112

      Description

      Remove faulty resource mark from print_symbol_on().

      If a stringStream is passed to Symbol::print_symbol_on(),
      assertion "stringStream is re-allocated with a different ResourceMark." can fire in stringStream::write(const char* s, size_t len).

      This can be verified by running TestLogTouchedMethods.java after adding this patch to the VM:

      --- a/src/share/vm/runtime/java.cpp Wed Jan 13 11:33:21 2016 +0100
      +++ b/src/share/vm/runtime/java.cpp Wed Feb 10 08:56:14 2016 +0100
      @@ -340,7 +340,10 @@
         }

         if (LogTouchedMethods && PrintTouchedMethodsAtExit) {
      - Method::print_touched_methods(tty);
      + ResourceMark rm;
      + stringStream st(16);
      + Method::print_touched_methods(&st);
      + tty->print("%s", st.as_string());
         }

         if (PrintBiasedLockingStatistics) {

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                goetz Goetz Lindenmaier
                Reporter:
                goetz Goetz Lindenmaier
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: