Harmony
  1. Harmony
  2. HARMONY-9

Use of memcpy() in copying portions of class file attribute structures

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: VM
    • Labels:
      None
    • Environment:
      All little-endian environments, but properly all environments

      Description

      Geir points out in SVN 312652 that,

      "I don't agree... things need to be byteswapped for indices and such"

      for copying the final portions of a (attribute_info) structure from the class file
      input buffer into the JVM runtime structure. He comments elsewhere about
      the need to byte swap one particular field, and added code to do this, but
      his observation here is directly relevant to all fields on a little-endian architecture.
      Sorry about that. I became so focused on the normative functionality for big-endian
      environments that I forgot about this issue while working on this area. The approach
      used in his implementation of the (ConstantValue_attribute) should be applied to
      all fields of all attributes, and the memcpy() below his comment needs to be undone
      in favor of this approach for all cases of all attributes. This is the more correct
      approach.

        Activity

        Hide
        Geir Magnusson Jr added a comment -

        Certainly is the more correct approach - I was just trying to get it to run....

        Show
        Geir Magnusson Jr added a comment - Certainly is the more correct approach - I was just trying to get it to run....
        Hide
        Bootstrap JVM (Daniel Lydick) added a comment -

        It's good that you didn't try because it is really not a
        porting issue, but a development issue that needs
        a more correct implementation, and that could take
        some time to do. This item really needs someone's
        direct attention, which means it needs (attribute_info)
        data, which means that it needs a class file , whic
        means that it needs a Java source file containing
        code that generates each and every attribute. Either
        that or some sample data structures of byte arrays
        that emulate each of the attributes to be thoroughly
        implemented.

        Any volunteers? This project would be a GREAT way
        to get your feet wet in understanding what's going on
        under the covers of this JVM !

        Show
        Bootstrap JVM (Daniel Lydick) added a comment - It's good that you didn't try because it is really not a porting issue, but a development issue that needs a more correct implementation, and that could take some time to do. This item really needs someone's direct attention, which means it needs (attribute_info) data, which means that it needs a class file , whic means that it needs a Java source file containing code that generates each and every attribute. Either that or some sample data structures of byte arrays that emulate each of the attributes to be thoroughly implemented. Any volunteers? This project would be a GREAT way to get your feet wet in understanding what's going on under the covers of this JVM !

          People

          • Assignee:
            Daniel Lydick
            Reporter:
            Bootstrap JVM (Daniel Lydick)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development