From 2cb1aa048868f93579e8d07912e87bdce6a73f76 Mon Sep 17 00:00:00 2001 From: Alex Menkov Date: Thu, 25 Nov 2010 15:58:11 +0300 Subject: [PATCH] 6999872: java.awt.Window instantiation leads to JVM CRASH on Windows, JDK7b118+ fastdebug Reviewed-by: igor, dcherepanov --- jdk/src/windows/bin/java_md.c | 6 +++++- .../native/sun/java2d/d3d/D3DPipelineManager.cpp | 13 ++++++++----- jdk/src/windows/native/sun/windows/awt_Toolkit.cpp | 5 +++++ jdk/src/windows/native/sun/windows/awt_Toolkit.h | 2 ++ 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/jdk/src/windows/bin/java_md.c b/jdk/src/windows/bin/java_md.c index b778f7ab213..97e4a803657 100644 --- a/jdk/src/windows/bin/java_md.c +++ b/jdk/src/windows/bin/java_md.c @@ -70,7 +70,11 @@ static void EnsureJreInstallation(const char *jrepath); */ #undef ENABLE_AWT_PRELOAD #ifndef JAVA_ARGS /* turn off AWT preloading for javac, jar, etc */ - #define ENABLE_AWT_PRELOAD + /* CR6999872: fastdebug crashes if awt library is loaded before JVM is + * initialized*/ + #if !defined(DEBUG) + #define ENABLE_AWT_PRELOAD + #endif #endif #ifdef ENABLE_AWT_PRELOAD diff --git a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp index f16db728f29..38cec3f499f 100644 --- a/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp +++ b/jdk/src/windows/native/sun/java2d/d3d/D3DPipelineManager.cpp @@ -969,12 +969,15 @@ void D3DInitializer::InitImpl() } D3DPipelineManager *pMgr = D3DPipelineManager::CreateInstance(); if (pMgr != NULL) { - UINT adapterCount = pMgr->adapterCount; + // init adapters if we are preloading + if (AwtToolkit::GetInstance().GetPreloadThread().OnPreloadThread()) { + UINT adapterCount = pMgr->adapterCount; - pAdapterIniters = new D3DAdapterInitializer[adapterCount]; - for (UINT i=0; i