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

Resource mark breaks printing to string stream

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b112

      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) {

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

              Created:
              Updated:
              Resolved: