Updated webrev:
http://cr.openjdk.java.net/~mlarsson/8146009/webrev.01/
Incremental:
http://cr.openjdk.java.net/~mlarsson/8146009/webrev.01/
Only LogConfiguration::initialize() and LogTagSet constructor now calls
the stdout_output()/stderr_output() functions. Made the functions
private to prevent usages from other places. Also removed the previous
output instances from LogFileStream.{c,h}pp which I forgot to do in the
first patch.
Thanks,
Marcus
On 01/19/2016 02:58 PM, Marcus Larsson wrote:
Hi,
Please review the following patch to fix an issue in UL causing the VM
to crash during shutdown.
The problem is that the static LogStdoutOutput is deinitialized before
the last use of it (G1 concurrent thread tries to log very late during
VM shutdown). The solution is to make sure neither LogStdoutOutput nor
LogStderrOutput are deinitialized during the full lifetime of the VM.
To accomplish this I've changed the storage from static objects to
static pointers to heap instances that are allocated & initialized on
first use [0]. These instances are never deleted and can always be
used. Also updated LogConfiguration::finalize to disable all file
outputs before deleting & freeing them.
Webrev:
http://cr.openjdk.java.net/~mlarsson/8146009/webrev.00/
Issue:
https://bugs.openjdk.java.net/browse/JDK-8146009
Testing:
- local runs of the reproducer (500+ iterations without crashing)
- JPRT
Thanks,
Marcus
[0]: https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use