RVM
  1. RVM
  2. RVM-592

Checks on creating ObjectReferences

    Details

    • Number of attachments :
      0

      Description

      Our most frequent error on x86 is back to being a bad object reference being traced by the GC. The number of places we create object references are limited. We either load them or create them from objects. In the compiler we can create checks that ensure that an object reference that is loaded or converted from an object is well formed. A well formed object reference should be a nullReference or:

      1) have a non-null TIB
      2) the TIB should be of type TIB
      3) have a TIB where we can read the type of the object

      it would be nice to have non-null allowing variants of the creation routines for places where the GC assumes a reference cannot be null. If there are other places we can insert extra checks then please let me know.

      This process comes from the thought that if MMTk manipulated objects that represented the state being manipulated then we could check when the state of such objects becomes corrupt. Obviously this technique is intended for non-production use.

        Issue Links

          Activity

          Hide
          Zvi Effron added a comment -

          Another way to create ObjectReferences is to convert an Address into and ObjectReference. Since Address supports plus, any Address can be made and thus any ObjectReference. I currently use invalid ObjectReferences at one point in some of the code I'm working on to reuse a field in the MiscHeader that no longer needs to serve it's primary purpose without having to write a second function that takes different arguments. So it's possible there might be other cases where invalid ObjectReferences created from Addresses could be useful.

          Show
          Zvi Effron added a comment - Another way to create ObjectReferences is to convert an Address into and ObjectReference. Since Address supports plus, any Address can be made and thus any ObjectReference. I currently use invalid ObjectReferences at one point in some of the code I'm working on to reuse a field in the MiscHeader that no longer needs to serve it's primary purpose without having to write a second function that takes different arguments. So it's possible there might be other cases where invalid ObjectReferences created from Addresses could be useful.
          Hide
          Ian Rogers added a comment -

          I don't really understand what you're saying here. You are creating an ObjectReference from an Address but the thing referenced isn't an Object. I'd suggest not using an ObjectReference then as I think it should be a simple invariant that ObjectReferences reference objects. The cost of casting an ObjectReference to an Address is 0, and if ObjectReferences encapsulate what is being referenced then maybe you can provide another magic unboxed type for this purpose.

          Maintaining and checking as many invariants as possible is a very powerful way to track down the root cause of bugs. Currently we're failing with errors like:
          http://jikesrvm.anu.edu.au/cattrack/results/rvmx86lnx32.anu.edu.au/perf/4413/production/default/perf-dacapo/eclipse-3GC/3/Output.txt
          I want to know where the corrupt ObjectReference comes from so that it can be fixed (obviously the copy didn't create the reference).

          Show
          Ian Rogers added a comment - I don't really understand what you're saying here. You are creating an ObjectReference from an Address but the thing referenced isn't an Object. I'd suggest not using an ObjectReference then as I think it should be a simple invariant that ObjectReferences reference objects. The cost of casting an ObjectReference to an Address is 0, and if ObjectReferences encapsulate what is being referenced then maybe you can provide another magic unboxed type for this purpose. Maintaining and checking as many invariants as possible is a very powerful way to track down the root cause of bugs. Currently we're failing with errors like: http://jikesrvm.anu.edu.au/cattrack/results/rvmx86lnx32.anu.edu.au/perf/4413/production/default/perf-dacapo/eclipse-3GC/3/Output.txt I want to know where the corrupt ObjectReference comes from so that it can be fixed (obviously the copy didn't create the reference).
          Hide
          Zvi Effron added a comment -

          I think you're right that storing it as an Address and converting to an ObjectReference when it really is one is probably a much better way to go. I merely wanted to point out that currently ObjectReferences can be created from Addresses to not actually reference an object, since it is possible, and you hadn't mentioned it, and it would need checks as well if you want to guarantee only valid ObjectReferences. (The reason I am using ObjectReferences that don't refer to Objects is because I am modifying the Merlin algorithm and trying to reuse some of its header information for different purposes to reduce overhead. I'm trying to do this at first with as little modification as I can, to get it to work, then fix things like how the functions take in their arguments.)

          Show
          Zvi Effron added a comment - I think you're right that storing it as an Address and converting to an ObjectReference when it really is one is probably a much better way to go. I merely wanted to point out that currently ObjectReferences can be created from Addresses to not actually reference an object, since it is possible, and you hadn't mentioned it, and it would need checks as well if you want to guarantee only valid ObjectReferences. (The reason I am using ObjectReferences that don't refer to Objects is because I am modifying the Merlin algorithm and trying to reuse some of its header information for different purposes to reduce overhead. I'm trying to do this at first with as little modification as I can, to get it to work, then fix things like how the functions take in their arguments.)
          Hide
          Ian Rogers added a comment -

          r14761 adds the checks of object reference validity to baseline compiled code running in a non-production scenario.

          Show
          Ian Rogers added a comment - r14761 adds the checks of object reference validity to baseline compiled code running in a non-production scenario.
          Hide
          Ian Rogers added a comment -

          Fixed for baseline compilation on IA32 in r14761. Creating new issue to track opt compilation.

          Show
          Ian Rogers added a comment - Fixed for baseline compilation on IA32 in r14761. Creating new issue to track opt compilation.

            People

            • Assignee:
              Ian Rogers
              Reporter:
              Ian Rogers
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: