RFR [11] 8207838: AArch64: Float registers incorrectly resture in JNI call

Andrew Dinn adinn at redhat.com
Tue Aug 14 16:07:30 UTC 2018

On 14/08/18 16:05, Andrew Haley wrote:
> On 08/14/2018 02:32 PM, Aleksey Shipilev wrote:
>> In the test, why do we need to call the test in separate threads? AFAIU, throwing Error from those
>> threads would print them out to stderr, but it would not have other effects, e.g. changing the exit
>> code of the test itself, so failures may go unnoticed. Might be better to use ExecutorService, get
>> the Future<?>-s, and rethrow ExecutionExceptions.
> Because the bad push/pop is only on the slow path when a lock has to
> be inflated.  That's why we never noticed it before.
That answers Aleksey's question as to why use all those threads.
However, it does not address (what I think is) his point that the test
may give false positives because exceptions will not happen in the main
thread and hence not derail the test.

An ExecutorService is the Rolls-Royce option. A simpler solution is to
set a static flag before starting the threads then if any of them enters
the block where the throw happens have it clear the flag. The test can
assert on the flag being set after all the joins complete (finesse is
all very well, Aleksey, but brute force is so cheap and easy ;-).


Andrew Dinn
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander

More information about the hotspot-runtime-dev mailing list