JDK-8224485 : Crash in Exceptions::log_exception() due erroneous copying of stringStream
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2019-05-21
  • Updated: 2019-05-21
  • Resolved: 2019-05-21
Related Reports
Duplicate :  
Relates :  
Description
(Yet unpushed) JDK-8224193 uncovered a bug in Exceptions::log_exception(). Stream object argument is handed down by value:

void Exceptions::log_exception(Handle exception, stringStream tempst);

which creates a copy which shares the internal backing buffer with the original one frame upstairs. Worked out of accident before when backing buffer was allocated in resource area, but since with JDK-8224193, it is allocated via C-heap which leads to a double free.


Comments
Just fixing Exceptions::log_exception is not sufficient, there are other places too.
21-05-2019