JDK-7168851 : [macosx] Netbeans crashes in CImage.nativeCreateNSImageFromArray
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2012-05-15
  • Updated: 2017-05-24
  • Resolved: 2012-05-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u6Resolved 8 b40Fixed openjdk7uFixed
Related Reports
Relates :  
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).

Comments
Verified!
15-05-2013

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.
15-05-2012

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
15-05-2012