__tsan_java_finalize bug

Martin Buchholz martinrb at google.com
Thu May 28 01:18:31 UTC 2020


On Wed, May 27, 2020 at 12:37 PM Dmitry Vyukov <dvyukov at google.com> wrote:
>
> On Wed, May 27, 2020 at 9:03 PM Man Cao <manc at google.com> wrote:
> >
> > __tsan_java_finalize() is used in Java finalizer:
> > https://github.com/openjdk/tsan/blob/7f1f31a18bafd9df728b03c63953f4e3fe20abdb/src/java.base/share/classes/java/lang/ref/Finalizer.java#L90
> > tsanFinalize() calls __tsan_java_finalize().
> >
> > finalize() is deprecated since Java 9. Perhaps the Cleaner mechanism does not need __tsan_java_finalize()?
>
> I can't tell right away. This area proved to be tricky :)
>
> From quick skimming I don't see any synchronization/visibility
> guarantees for Cleaner. If there are none (everything is supposed to
> be synchronized by user code explicitly), then we done!

I did my own overview of jdk docs, and I came to the same conclusion as Dmitry !


More information about the tsan-dev mailing list