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

JNI Direct Buffer API calls don't set the correct thread state during initialization

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • hs10
    • 7
    • hotspot
    • None
    • b03
    • generic
    • generic

    Backports

      Description

        There is a general requirement that native methods calling in to the VM set the correct thread state when doing so - normally thread_in_vm. There is one path through the JNI direct buffer support initialization code that does not do this however. This leads to the thread being in state _thread_in_native instead of _thread_in_vm. A recent change to the os:sleep code (see CR 6459874) enabled a ThreadBlockInVM transition object that, in debug mode, enforces that the thread is in the state _thread_in_vm. As this is not the case then the assertion fails at runtime. Being in the wrong state is actually benign in terms of functionality. Further there has to be an initialization race between multiple threads for the os::sleep call to actually get executed.

        Attachments

          Issue Links

            Activity

              People

                dholmes David Holmes
                dholmes David Holmes
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: