JDK-8112976 : Mac: Assertion failed: ([NSOpenGLContext currentContext] == [self openGLContext]), function -[GlassView3D begin]
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: fx2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2011-06-01
  • Updated: 2015-06-16
  • Resolved: 2011-10-12
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.
Other
fx2.0.2Fixed
Related Reports
Blocks :  
Duplicate :  
Relates :  
Description
With the following SDK build:

    [echo] Current SDK: Product: javafx-2.0beta
    [echo] Platform: macosx-universal
    [echo] Build-Number: 168
    [echo] Build-ID: 2011-05-26_20-33-28
    [echo] Latest  SDK: Product: javafx-2.0beta
    [echo] Platform: macosx-universal
    [echo] Build-Number: 171
    [echo] Build-ID: 2011-05-31_19-32-58

I get the following assertion crash each time I exit from VisualTool:

2011-06-01 12:09:33.477 java[52328:aa03] *** Assertion failure in -[GlassView3D lockFocus], /SourceCache/AppKit/AppKit-1038.35/AppKit.subproj/NSView.m:5237
2011-06-01 12:09:33.478 java[52328:aa03] lockFocus caught exception: -[GlassView3D(0x102021460) lockFocus] failed with window=0x1020201f0, windowNumber=6791, [self isHiddenOrHasHiddenAncestor]=0
Assertion failed: ([NSOpenGLContext currentContext] == [self openGLContext]), function -[GlassView3D begin], file /HUDSON/workspace/presidio/label/macosx-universal-14/glass/glass-mat-lib-macosx/src/com/sun/mat/ui/GlassView3D.m, line 393.
Java Result: 134

Comments
verified in 2.0.2 b08
15-11-2011

We must use lockFocusIfCanDraw instead of lockFocus on NSView objects on Mac to avoid locking focus on hidden views.
12-10-2011

If you run HelloWorld and close the window you will see the failure. Note that something has changed in glass recently to trigger this assertion in more cases. This is now a serious regression from 2.0 that affects all programs on exit. For 2.0.2 we either need to fix the underlying cause or suppress the assertion message. Note that it appears to have been caused (or more likely, exposed) by the following changeset: changeset: 582:eac06eab37ad user: Anthony Petrov date: Fri Oct 07 19:31:08 2011 +0400 summary: Follow-up fix for RT-17213: com.sun.glass.ui.mac.MacView are not garbage collected
12-10-2011

This is probably workarounded by RT-15601 and needs to be looked at when fixing RT-14271.
12-08-2011

[View lockFocus] fails, which makes the later code throw an assertion. Looks like we're trying to draw into a view, which itself is already hidden or detached from the Window or Window is hidden - basically need to make sure the order of hiding/closing window, detaching View is correct.
02-06-2011