RFR(xs): 8224485: Crash in Exceptions::log_exception() due erroneous copying of stringStream
Thomas Stüfe
thomas.stuefe at gmail.com
Tue May 21 13:07:57 UTC 2019
Hi all,
Bug: https://bugs.openjdk.java.net/browse/JDK-8224485
cr:
http://cr.openjdk.java.net/~stuefe/webrevs/8224485-exceptions_log_exception_do_not_copy_stringstream/webrev.00/webrev/
(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.
Thanks, Thomas
More information about the hotspot-runtime-dev
mailing list