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

Stack chunk thawing races with concurrent GC stack iteration

    XMLWordPrintable

Details

    • gc
    • b22

    Backports

      Description

        In ThawBase::finalize_thaw we do this:

          if (!_stream.is_done()) {
            assert(_stream.sp() >= chunk->sp_address(), "");
            chunk->set_sp(chunk->to_offset(_stream.sp()));
            chunk->set_pc(_stream.pc());
          } else {
            chunk->set_argsize(0);
            chunk->set_sp(chunk->stack_size());
            chunk->set_pc(nullptr);
          }

        The sp and argsize are both read when setting up a StackChunkFrameStream from concurrent GC threads to scan the stack. The lack of atomicity implies the GC thread might observe old values of argsize with new values of sp, or vice versa. The consequences are unknown, but this is clearly not right.

        Attachments

          Issue Links

            Activity

              People

                eosterlund Erik Ă–sterlund
                eosterlund Erik Ă–sterlund
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: