JDK-8144781 : Assertion failure in debug build running any JavaFX program on Mac
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 8u60
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-12-06
  • Updated: 2023-07-21
  • Resolved: 2017-10-13
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 10 JDK 8
10Fixed 8u391Fixed
Related Reports
Relates :  
Relates :  
Description
It seems that the fix for JDK-8096755 was not entirely correct.
With the DebugNative build this assertion fails:
Assertion failed: (CGLGetCurrentContext() == self->_ctx), function -[GlassOffscreen unbind], file /Users/vadim/jfx9/rt/modules/graphics/src/main/native-glass/mac/GlassOffscreen.m, line 148.
Comments
Changeset: 93aeb87ed9a0 Author: kcr Date: 2017-10-13 13:46 -0700 URL: http://hg.openjdk.java.net/openjfx/10-dev/rt/rev/93aeb87ed9a0 8144781: Assertion failure in debug build running any JavaFX program on Mac Reviewed-by: prr
13-10-2017

+1 -phil.
13-10-2017

As indicated in the description, this is a regression introduced by the fix for JDK-8096755. The failing assert statement was removed along with the unbind method as part of the fix for JDK-8096813. That in turn caused a problem with the SW pipeline, so the unbind method was restored by the fix for JDK-8096755. However, the earlier fix for JDK-8096813 made the assertion invalid, since with that earlier fix glass no longer uses the Prism context in most cases. The solution is just to remove the bogus assert statement. The assertion will always fail with the current logic, which has been well-tested in production for over two years.
13-10-2017

Proposed fix: diff --git a/modules/javafx.graphics/src/main/native-glass/mac/GlassOffscreen.m b/modules/javafx.graphics/src/main/native-glass/mac/GlassOffscreen.m --- a/modules/javafx.graphics/src/main/native-glass/mac/GlassOffscreen.m +++ b/modules/javafx.graphics/src/main/native-glass/mac/GlassOffscreen.m @@ -145,7 +145,6 @@ - (void)unbind { - assert(CGLGetCurrentContext() == self->_ctx); [self->_offscreen unbind]; [self unsetContext]; }
13-10-2017