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

is_oop_or_null involves undefined behavior

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      generic

      Description

      oopDesc::is_oop_or_null is an ordinary member function, whose definition includes a test using the expression "this == NULL". However, this can be assumed to never be NULL, as that would require undefined behavior. So the compiler is free to optimize away that test, eliminating the "_or_null" part of the function's intended semantics. Recent versions of gcc (like gcc 6) seem to be more aggressive about optimizations around that sort of thing, leading to crashes.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coleenp Coleen Phillimore
                Reporter:
                kbarrett Kim Barrett
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: