"/src/share/vm/classfile/classLoader.cpp", line 907: Error: Cannot use long to initialize instanceKlassHandle.

Andreas Eriksson andreas.eriksson at oracle.com
Thu Nov 6 10:08:26 UTC 2014


Ah, I see. Thanks!

/Andreas

On 2014-11-05 18:02, Coleen Phillimore wrote:
>
> Yes, return CHECK_(instanceKlassHandle()) instead of CHECK_NULL for 
> jdk7.   Handles were rewritten since InstanceKlass is no longer an oop.
>
> Coleen
>
> On 11/5/14, 11:58 AM, Andreas Eriksson wrote:
>> Hi all,
>>
>> I'm backporting JDK-8020675 
>> <https://bugs.openjdk.java.net/browse/JDK-8020675> to jdk7, but debug 
>> builds on solaris fails with the following error:
>>
>> ".../src/share/vm/classfile/classLoader.cpp", line 907: Error: Cannot 
>> use long to initialize instanceKlassHandle.
>>
>> This is in method ClassLoader::load_classfile which returns an 
>> instanceKlassHandle.
>> The changed code adds a CHECK_NULL:
>>
>> -      stream = e->open_stream(name);
>> +      stream = e->open_stream(name, CHECK_NULL);
>>
>> The CHECK_NULL macro expands to
>>
>> stream = e->open_stream(name, THREAD); if (HAS_PENDING_EXCEPTION) 
>> return NULL; (0);
>>
>> NULL is of type long on solaris_x64 (or int on solaris_i586, which 
>> has the same problem),
>> and the solaris debug build fails with the above error because we try 
>> to return NULL i.e. 0L as an instanceKlassHandle.
>>
>> This is only a problem on jdk7 solaris debug builds, does anyone know 
>> why it fails in this particular configuration?
>> It is not a problem on jdk8, even though the same code exists there.
>>
>> Returning instanceKlassHandle() works as expected, would this be the 
>> correct way to go since that is a NULL handle?
>>
>> Any help is appreciated.
>>
>> Regards,
>> Andreas
>



More information about the hotspot-dev mailing list