RFR(S): 8195731: [Graal] runtime/SharedArchiveFile/serviceability/transformRelatedClasses/TransformSuperSubTwoPckgs.java intermittently fails with Graal JIT

Tobias Hartmann tobias.hartmann at oracle.com
Fri Feb 2 08:41:51 UTC 2018


Hi Vladimir and Serguei,

thanks for looking at this!

> On 2/1/18 11:55, Vladimir Kozlov wrote:
>> I thought we should not use System.exit() and throw some Error or RuntimeException instead. I remember Igor I. did
>> some changes but I forgot which tests.

I think Igor just removed System.exit in the case where the test *passes*. I think it should be fine to bail out with
System.exit(1) in the *failing* case.

@Igor: What's the reason to avoid System.exit?

The problem is that throwing an exception in ClassFileTransformer::transform() is silently ignored:
"If the transformer throws an exception (which it doesn't catch), subsequent transformers will still be called and the
load, redefine or retransform will still be attempted. Thus, throwing an exception has the same effect as returning
null." [1]

As a result, the test fails without any information. I've basically copied this code from
runtime/RedefineTests/RedefineAnnotations.java [2] were we use System.exit as well. If there's a reason to avoid
System.exit here, we can also just print an error and fail later with the generic exception:
"java.lang.RuntimeException: 'parent-transform-check: this-has-been--transformed' missing from stdout/stderr "

http://cr.openjdk.java.net/~thartmann/8195731/webrev.01/

Thanks,
Tobias

[1] https://docs.oracle.com/javase/8/docs/api/java/lang/instrument/ClassFileTransformer.html
[2]
http://hg.openjdk.java.net/jdk/hs/file/e50e326a2bfc/test/hotspot/jtreg/runtime/RedefineTests/RedefineAnnotations.java#l145


More information about the hotspot-dev mailing list