JDK-8149557 : Resource mark breaks printing to string stream
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-02-10
  • Updated: 2017-06-12
  • Resolved: 2016-03-06
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 9
9 b112Fixed
Related Reports
Duplicate :  
Relates :  
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) {