RFR(M): 8069207 - [TESTBUG] Exception thrown for java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorExit

Christian Tornqvist christian.tornqvist at oracle.com
Mon Jan 19 05:33:18 UTC 2015


Hi David,

>Without comparing to the existing tests these look okay - pretty basic API
functional checks. But there seem to be a number missing (eg
reallocateMemory, staticFieldOffset, objectFieldOffset, and others) - I
assume the omission of >tests for the deprecated methods is deliberate?

These tests are based on what we had in our internal tests
(nsk/serial/Unsafe), I simply went through the tests there and wrote similar
ones but in jtreg. reallocateMemory already has a test in jtreg,
test/runtime/Unsafe/Reallocate.java, which I added for a change a week or
two ago. 

>One meta-question (as usual) - don't you need to ensure the testlibrary
code is built if you are going to use it?

I did look at this, the problem with adding @build to every test is that
with the default execution mode for jtreg (which is what we use in JPRT), I
could see 2-3x increase in the amount of time took to run the tests. George
Triantafillou has a change on its way where he'll add @build to all our
existing tests, and most likely change JPRT to use -agentvm to ensure it's
not going to take hours to run our jtreg tests. 

>Indentation wrong.

Blaming my OS reinstall for not having my editor settings correct, I'll go
through and fix them :)

Thanks,
Christian

-----Original Message-----
From: David Holmes [mailto:david.holmes at oracle.com] 
Sent: Sunday, January 18, 2015 7:58 PM
To: Christian Tornqvist; hotspot-runtime-dev at openjdk.java.net
Subject: Re: RFR(M): 8069207 - [TESTBUG] Exception thrown for
java.lang.NoSuchMethodError: sun.misc.Unsafe.monitorExit

Hi Christian,

On 17/01/2015 4:40 AM, Christian Tornqvist wrote:
> Hi everyone,
>
> Please review this change adding tests for sun.misc.Unsafe, it's a 
> rewrite of some internal tests that were written for another test 
> framework. The change includes removing the tests for monitorEnter/Exit.

Without comparing to the existing tests these look okay - pretty basic API
functional checks. But there seem to be a number missing (eg
reallocateMemory, staticFieldOffset, objectFieldOffset, and others) - I
assume the omission of tests for the deprecated methods is deliberate?

One meta-question (as usual) - don't you need to ensure the testlibrary code
is built if you are going to use it?

Some indentation/layout issues:

test/runtime/Unsafe/GetPutBoolean.java

Looks like spurious tab/indent at line 46.

test/runtime/Unsafe/GetPut<primitive>.java

Ditto line 51 in all files

test/runtime/Unsafe/GetPutObject.java

Indentation issues at: 39, 45 and 48

test/runtime/Unsafe/GetUnsafe.java

Indentation wrong for all of main().

test/runtime/Unsafe/PageSize.java

Indentation all over the place

test/runtime/Unsafe/SetMemory.java

Indentation wrong

test/runtime/Unsafe/ThrowException.java

Indentation wrong.

Thanks,
David

>
>
> The tests have been verified to work on all our major platforms (using 
> JPRT).
>
>
>
> Webrev:
>
> http://cr.openjdk.java.net/~ctornqvi/webrev/8069207/webrev.00/
>
>
>
> Bug (unfortunately not visible):
>
> https://bugs.openjdk.java.net/browse/JDK-8069207
>
>
>
> Thanks,
>
> Christian
>



More information about the hotspot-runtime-dev mailing list