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

AllocObject and Unsafe.allocateInstance segfault for primitive types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 9
    • hs25
    • hotspot
    • None
    • b03

    Description

      Currently, calling AllocObject or Unsafe.allocateInstance with a primitive type (e.g. unsafe.allocateInstance(int.class)) leads to a segmentation fault because Classes representing primitive types do not have an associated Klass.

      While AllocObject or allocateInstance should in principle never be called with a Class representing a primitive, it should probably not crash in such a case since it throws sensible exceptions for many other invalid arguments (interfaces, abstract types, arrays, j.l.Class).

      Attachments

        Activity

          People

            coleenp Coleen Phillimore
            gdub Gilles Duboscq
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: