The code to acquire CodeCache_lock in largest_free_block in 7033779 creates ordering problems with ttyLocker.
;; Using jvm: "/export/local/common/jdk/baseline/solaris-i586/jre/lib/i386/server/libjvm.so"
#
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (/tmp/jprt/P1/B/230440.never/source/src/share/vm/runtime/mutex.cpp:1307), pid=10761, tid=10
# fatal error: acquiring lock CodeCache_lock/1 out of order with lock tty_lock/0 -- possible deadlock
#
# JRE version: 7.0-b136
# Java VM: Java HotSpot(TM) Server VM (21.0-b05-internal-201104062304.never.7034513-fastdebug compiled mode solaris-x86 )
# Core dump written. Default location: /export/local/46611.JDK7.NIGHTLY.VM+solaris-i586_javase_client_comp_JT_HS/results/workDir/closed/compiler/6457611/log/core or core.10761
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x08263400): JavaThread "C2 CompilerThread1" daemon [_thread_in_vm, id=10, stack(0x76c1c000,0x76c9c000)]
Stack: [0x76c1c000,0x76c9c000], sp=0x76c9afe0, free space=507k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x1cf4da6] void VMError::report(outputStream*)+0x902;; void VMError::report(outputStream*)+0x902
V [libjvm.so+0x1cf5f59] void VMError::report_and_die()+0x56d;; void VMError::report_and_die()+0x56d
V [libjvm.so+0xafda2b] void report_fatal(const char*,int,const char*)+0x56f;; void report_fatal(const char*,int,const char*)+0x56f
V [libjvm.so+0x179380c] void Monitor::lock_without_safepoint_check()+0x58c;; void Monitor::lock_without_safepoint_check()+0x58c
V [libjvm.so+0x9667d9] void CodeCache::log_state(outputStream*)+0x85;; void CodeCache::log_state(outputStream*)+0x85
V [libjvm.so+0x1b51ac0] void NMethodSweeper::log_sweep(const char*,const char*,...)+0xdc;; void NMethodSweeper::log_sweep(const char*,const char*,...)+0xdc
V [libjvm.so+0x1b50c1a] void NMethodSweeper::sweep_code_cache()+0x88a;; void NMethodSweeper::sweep_code_cache()+0x88a
V [libjvm.so+0x1b502f1] void NMethodSweeper::possibly_sweep()+0x109;; void NMethodSweeper::possibly_sweep()+0x109
V [libjvm.so+0x9d9e7f] void CompileBroker::compiler_thread_loop()+0x45f;; void CompileBroker::compiler_thread_loop()+0x45f
V [libjvm.so+0x1bfa762] void compiler_thread_entry(JavaThread*,Thread*)+0x2e;; void compiler_thread_entry(JavaThread*,Thread*)+0x2e
V [libjvm.so+0x1becdb9] void JavaThread::thread_main_inner()+0x179;; void JavaThread::thread_main_inner()+0x179
V [libjvm.so+0x1beca69] void JavaThread::run()+0x619;; void JavaThread::run()+0x619
V [libjvm.so+0x1854693] java_start+0x6fb;; java_start+0x6fb
C [libc.so.1+0xa59a9] _thr_setup+0x4e;; _thr_setup+0x4e
C [libc.so.1+0xa5c90] __moddi3+0x60;; _lwp_start+0x0