RFR (S): Make uncaught exception in child threads trigger test failure

Jean Christophe Beyler jcbeyler at google.com
Thu Jul 25 21:42:27 UTC 2019


Hi Man,

Looks good to me!
Jc

On Thu, Jul 25, 2019 at 2:35 PM Man Cao <manc at google.com> wrote:

> Hi all,
>
> Can I have reviews for this:
> https://cr.openjdk.java.net/~manc/tsan20190725/webrev.00/
>
> Currently, if a child thread terminates due to an uncaught exception, such
> as NullPointerException due to memory corruption, the TSAN test would still
> pass. This change makes sure the test fail in such cases.
>
> Tested with the following local modification:
> --- a/test/hotspot/jtreg/tsan/NonRacyIntMemberLoopTest.java
> +++ b/test/hotspot/jtreg/tsan/NonRacyIntMemberLoopTest.java
> @@ -45,6 +45,9 @@ class NonRacyIntMemberLoopRunner extends
>    @Override
>    protected synchronized void run(int i) {
>      x = x + 1;
> +    if (i % 100 == 0) {
> +      throw new NullPointerException();
> +    }
>    }
>
>    public static void main(String[] args) throws InterruptedException
>
> The test would pass without this change, and properly fails with this
> change.
>
> -Man
>


-- 

Thanks,
Jc


More information about the tsan-dev mailing list