-
Bug
-
Resolution: Not an Issue
-
P4
-
7
-
x86
-
windows
There are two files attached to the bug report: a test that can be used to get a crash in AwtList, and the corresponding HotSpot log file. To reproduce the problem, just run the test and wait until it crashes.
Looking at the code in AwtList::UpdateMaxItemWidth I found the following problematic lines:
for ( int i=0; i < nCount; i++ )
{
jstring jstr = GetItemString( env, target, i );
SIZE size = AwtFont::getMFStringSize( hDC, font, jstr );
if ( size.cx > m_nMaxWidth )
m_nMaxWidth = size.cx;
env->DeleteLocalRef( jstr );
}
GetItemString() is a method from AwtComponent that simply calls some Java method from the list target. As there is no synchronization between the Java list and its native object, it is possible that GetItemString() returns NULL value, so we should check it after the call.
The bug exists in the AwtList code since at least 1.5, so this is not a recent regression.
Looking at the code in AwtList::UpdateMaxItemWidth I found the following problematic lines:
for ( int i=0; i < nCount; i++ )
{
jstring jstr = GetItemString( env, target, i );
SIZE size = AwtFont::getMFStringSize( hDC, font, jstr );
if ( size.cx > m_nMaxWidth )
m_nMaxWidth = size.cx;
env->DeleteLocalRef( jstr );
}
GetItemString() is a method from AwtComponent that simply calls some Java method from the list target. As there is no synchronization between the Java list and its native object, it is possible that GetItemString() returns NULL value, so we should check it after the call.
The bug exists in the AwtList code since at least 1.5, so this is not a recent regression.