Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8221853

Data race in compile broker (set_last_compile)

    XMLWordPrintable

Details

    • b16

    Description

      There is a data race in a piece of unused code:

      WARNING: ThreadSanitizer: data race (pid=167158)
        Write of size 8 at 0x7f39db98bd00 by thread T11:
          #0 strncpy <null> (libtsan.so+0x2b217)
          #1 CompileBroker::set_last_compile(CompilerThread*, methodHandle const&, bool, int) /usr/local/google/home/jcbeyler/mercurial/jdk-tsan/src/hotspot/share/compiler/compileBroker.cpp:2273 (libjvm.so+0x63216b)

        Previous write of size 8 at 0x7f39db98bd00 by thread T12:
          #0 strncpy <null> (libtsan.so+0x2b217)
          #1 CompileBroker::set_last_compile(CompilerThread*, methodHandle const&, bool, int) /usr/local/google/home/jcbeyler/mercurial/jdk-tsan/src/hotspot/share/compiler/compileBroker.cpp:2273 (libjvm.so+0x63216b)

      This happens because multiple compiler threads can set the name of the last method. No one is using the member fields as they are only referenced in the print_last_method method which is dead code.

      I am preparing a webrev to talk about it with a solution to add a lock and move all the related code to non product code.

      Attachments

        Activity

          People

            jcbeyler Jean Christophe Beyler
            jcbeyler Jean Christophe Beyler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: