[9] RFR(S): 8153527: break_tty_lock_for_safepoint causes "assert(false) failed: bad tag in log" and broken compile log

Nils Eliasson nils.eliasson at oracle.com
Fri Apr 15 15:10:35 UTC 2016


Please review this fix of print opto_assembly.

The compilelog can get corrupted and the VM may assert on "failed: bad 
tag in log".

When printing assembly in output.cpp we first take the ttylock, print 
the head and then the method metadata. However the metadata printing 
makes a vm entry and may block for a safepoint and will then release the 
lock (break_tty_lock_for_safepoint). After that some of the other 
compiler thread that haven't safepointed will take the lock and the 
broken log will be a fact when the safepoint is over and the first 
thread starts logging again.

Print the method metadata to a temporary buffer, then take the tty lock.

Repro from bug stops failing.
Running :hotspot_all 

Bug: https://bugs.openjdk.java.net/browse/JDK-8153527
Webrev: http://cr.openjdk.java.net/~neliasso/8153527/webrev.01/

Nils Eliasson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160415/ca11b272/attachment.html>

More information about the hotspot-compiler-dev mailing list