some questions about project tsan

Jie He Jie.He at arm.com
Wed Mar 25 09:15:31 UTC 2020


> Yes, incremental patches are greatly preferred.

> Maybe you want to first rebase/merge with jdk/jdk? I'm not sure what the right approach is, I'd prefer rebasing, but maybe merging is the typical thing to do?
[Jie He] I’m not sure how much risk is here. seems no sync with jdk/jdk already 1 year. How big will the changes in master impact the current tsan? if current implementation doesn’t work after rebased, we have to wait until they are fixed. Or, I still do the AARCH64 implementation based on current tsan, in the same time, have a try to rebase with jdk/jdk as well. If latter succeeds smoothly, everything is ok; otherwise, I go back to commit to origin jdk/tsan, then take the rebase when finish AARCH64 implementation even though more merging workload. What do you think?

> Also, we just got notified that the Project Skara people want to move jdk/tsan to GitHub so we'll probably be going down that path soon, and code reviews will be done via GitHub pull requests; keep that in mind.
Got it.

From: Arthur Eubanks <aeubanks at google.com>
Sent: Tuesday, March 24, 2020 11:59 PM
To: Jie He <Jie.He at arm.com>
Cc: tsan-dev at openjdk.java.net; nd <nd at arm.com>
Subject: Re: some questions about project tsan



On Tue, Mar 24, 2020 at 4:13 AM Jie He <Jie.He at arm.com<mailto:Jie.He at arm.com>> wrote:
Hi Arthur

We plan to add the AARCH64 support in jdk/tsan, probably kick off next month.
Awesome! Looking forward to it.

Could we commit the patches progressively? each of them will pass parts of the tsan test cases, so that, it’s easier to review and bug tracking than a whole big patch.
Yes, incremental patches are greatly preferred.

Maybe you want to first rebase/merge with jdk/jdk? I'm not sure what the right approach is, I'd prefer rebasing, but maybe merging is the typical thing to do?
Also, we just got notified that the Project Skara people want to move jdk/tsan to GitHub so we'll probably be going down that path soon, and code reviews will be done via GitHub pull requests; keep that in mind.

B.R
Jie He

From: Arthur Eubanks <aeubanks at google.com<mailto:aeubanks at google.com>>
Sent: Friday, January 10, 2020 1:21 AM
To: Jie He <Jie.He at arm.com<mailto:Jie.He at arm.com>>
Cc: tsan-dev at openjdk.java.net<mailto:tsan-dev at openjdk.java.net>; nd <nd at arm.com<mailto:nd at arm.com>>
Subject: Re: some questions about project tsan



On Thu, Jan 9, 2020 at 1:02 AM Jie He <Jie.He at arm.com<mailto:Jie.He at arm.com>> wrote:
Hi

I'm an engineer from ARM, and noticed this project is helpful to detect data race in Java level.
Thanks for the interest!

I have some questions about this project:

1, how about the current status? All dev jobs have been finished already?
It works and we use this internally at Google. There should be no false positives reported, but not everything is precise and there are false negatives (e.g. final fields, finalizers, etc.). I believe the current implementation catches most races, which is good enough, and extra effort spent making instrumentation more precise would only find a couple more races, which may or may not be worth the effort.
Ideally we'd like to upstream this into mainline.
2, for detection of data race in Java code, I think current implementation only in X86 is enough. A data race in java code will be found whatever the machine platform is.
    So that, porting this project to AARCH64 is meaningless? Is it helpful to find some issues which don't happen in X86?
Yes a data race will likely be found on x86 and it would apply to AARCH64 as well. Porting to AARCH64 could still be interesting and useful for people who only have AARCH64 machines. And maybe running on different architectures will change the timing of concurrent execution, causing races to disappear or appear.
3, Is there a plan to add the support to detect data race in JVM self? E.g. add the instrumentation into the assemble code generated by interpreter, compiler and runtime,
    In some machine platforms which have weak memory model like arm and ppc, engineers often make mistakes when writing data race related code even though they are experienced.
    I think such a tool could help to detect these bugs easily than before.
We've thought about this in the past, but there is a ton of intentionally racy code. You could try adding -fsanitize=thread to the hotspot compilations and running it just to see what would happen.

Thanks
Jie He


More information about the tsan-dev mailing list