Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6264

Need a new native method: VM.getStackClass()

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 5.0M10
    • 5.0M11
    • Classlib, DRLVM
    • None
    • SVN Revision: 785439
    • Patch Available
    • Advanced

    Description

      We need a new native method, VM.getStackClass(int) to compliment VM.getStackClassLoader() and Class.getStackClasses(). It needs to be implemented in the VM vendors. I can fix Android's Dalvik VM, but I'll need a Harmony volunteer to fix DRLVM.

      Background:
      To implement AtomicReferenceFieldUpdater securely, it's necessary to capture the class of the caller, not just the class loader of the caller. Otherwise a rogue class (say, EvilBufferedInputStream) could use an AtomicReferenceFieldUpdater to modify protected fields of arbitrary instances (such as the buffer field of somebody else's BufferedInputStream).

      This blocks HARMONY-6262, which updates of our copy of java.util.concurrent to Doug Lea's latest. The getStackClass() call is needed for line 181 and its result is used on line 262:
      http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java?annotate=1.41

      Attachments

        1. getStackClass.patch
          1 kB
          Jesse Wilson
        2. getStackClass_Implementation.patch
          0.6 kB
          Jesse Wilson

        Activity

          People

            hindessm Mark Hindess
            jessewilson Jesse Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified