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

Man Cao manc at google.com
Thu Jul 25 22:31:58 UTC 2019


I added a test:
https://cr.openjdk.java.net/~manc/tsan20190725/webrev.01/

I will merge the two webrevs into a single commit.

-Man


On Thu, Jul 25, 2019 at 3:13 PM Arthur Eubanks <aeubanks at google.com> wrote:

> Actually, I think adding a test for this would be good.
>
> On Thu, Jul 25, 2019 at 3:05 PM Arthur Eubanks <aeubanks at google.com>
> wrote:
>
>> LGTM
>>
>> On Thu, Jul 25, 2019 at 2:43 PM Jean Christophe Beyler <
>> jcbeyler at google.com> wrote:
>>
>>> 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