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

[macosx] Netbeans crashes in CImage.nativeCreateNSImageFromArray

    Details

    • Subcomponent:
    • Introduced In Build:
      b18
    • Introduced In Version:
      7u4
    • Resolved In Build:
      b40
    • CPU:
      generic
    • OS:
      os_x
    • Verification:
      Verified

      Backports

        Description

        Full hotspot log attached.

        C [CoreFoundation+0x8c2a] CFRelease+0x3a
        C [CoreFoundation+0x31180] -[__NSArrayM dealloc]+0x130
        C [libobjc.A.dylib+0xf03c] _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv+0x1b2
        C [CoreFoundation+0x31b05] _CFAutoreleasePoolPop+0x25
        C [libawt_lwawt.dylib+0x293bc] Java_sun_lwawt_macosx_CImage_nativeCreateNSImageFromArrays+0x13f
        j sun.lwawt.macosx.CImage.nativeCreateNSImageFromArrays([[I[I[I)J+0
        j sun.lwawt.macosx.CImage.access$700([[I[I[I)J+3
        j sun.lwawt.macosx.CImage$Creator.createFromImages(Ljava/util/List;)Lsun/lwawt/macosx/CImage;+142
        j sun.lwawt.macosx.CPlatformWindow.getImageForTarget()Lsun/lwawt/macosx/CImage;+27
        j sun.lwawt.macosx.CPlatformWindow.updateIconImages()V+6
        j sun.lwawt.macosx.CPlatformWindow.setVisible(Z)V+128
        j sun.lwawt.LWWindowPeer$1.run()V+11

        Reproducible using the latest JDK8 build.

        It's likely a regression of the fix for 7148275 (over-release).

          Issue Links

            Activity

            Hide
            dcherepanov Dmitry Cherepanov added a comment -
            BT2:SUGGESTED FIX

            Quick fix:

            $ hg diff src/macosx/native/sun/awt/CImage.m
            diff -r 69301efaac91 src/macosx/native/sun/awt/CImage.m
            --- a/src/macosx/native/sun/awt/CImage.m Sat May 12 18:50:27 2012 +0400
            +++ b/src/macosx/native/sun/awt/CImage.m Tue May 15 13:07:36 2012 +0400
            @@ -163,7 +163,7 @@
                 if ([reps count]) {
                     NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)];
                     [nsImage addRepresentations: reps];
            - [reps release];
            + // [reps release];
             
                     if (nsImage != nil) {
                         CFRetain(nsImage); // GC
            Show
            dcherepanov Dmitry Cherepanov added a comment - BT2:SUGGESTED FIX Quick fix: $ hg diff src/macosx/native/sun/awt/CImage.m diff -r 69301efaac91 src/macosx/native/sun/awt/CImage.m --- a/src/macosx/native/sun/awt/CImage.m Sat May 12 18:50:27 2012 +0400 +++ b/src/macosx/native/sun/awt/CImage.m Tue May 15 13:07:36 2012 +0400 @@ -163,7 +163,7 @@      if ([reps count]) {          NSImage *nsImage = [[NSImage alloc] initWithSize:NSMakeSize(0, 0)];          [nsImage addRepresentations: reps]; - [reps release]; + // [reps release];            if (nsImage != nil) {              CFRetain(nsImage); // GC
            Hide
            anthony Anthony Petrov (Inactive) added a comment -
            BT2:EVALUATION

            The spec for NSImage -addRepresentation(s): states that the passed in object is retained by the receiver. So the manual -release calls look unneeded.
            Show
            anthony Anthony Petrov (Inactive) added a comment - BT2:EVALUATION The spec for NSImage -addRepresentation(s): states that the passed in object is retained by the receiver. So the manual -release calls look unneeded.
            Hide
            aeremeev Andrei Eremeev added a comment -
            Verified!
            Show
            aeremeev Andrei Eremeev added a comment - Verified!

              People

              • Assignee:
                anthony Anthony Petrov (Inactive)
                Reporter:
                dcherepanov Dmitry Cherepanov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: