JDK-8127302 : Mac: Core-Dump with FXCanvas when opening a Menu
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: fx2.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Cannot Reproduce
  • Submitted: 2012-01-09
  • Updated: 2015-06-17
  • Resolved: 2012-03-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.
Other
fx2.1Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
Executing this application on OS-X produces the following exception.

java.lang.RuntimeException: Error creating framebuffer object with size 109x85 (status code is 0x0)
	at com.sun.prism.es2.ES2RTTexture.create(ES2RTTexture.java:175)
	at com.sun.prism.es2.ES2ResourceFactory.createRTTexture(ES2ResourceFactory.java:53)
	at com.sun.prism.es2.ES2SwapChain.createGraphics(ES2SwapChain.java:187)
	at com.sun.prism.es2.ES2SwapChain.createGraphics(ES2SwapChain.java:23)
	at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:60)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at com.sun.prism.render.RenderJob.run(RenderJob.java:39)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:102)
	at java.lang.Thread.run(Thread.java:680)
Assertion failed: ([NSOpenGLContext currentContext] == self->currentContext), function -[GlassView3D end:], file /HUDSON/workspace/2.1/label/macosx-universal-14/glass/glass-mat-lib-macosx/src/com/sun/mat/ui/GlassView3D.m, line 482.

It might be that this also happens with a standard JavaFX 2.1 application but I was unable to launch such one using the latest build on my OS-X workstation
Comments
Please reopen if you can make it happen. Thanks!
22-03-2012

I can no longer reproduce this bug on my 2 Macs (a Lion with ATI and a Snow Leopard with NVidia) running the latest build. We have done significant work to clean up context management and it is likely this bug got fixed in the process. Please download our latest build and give it a try.
06-03-2012

I click on the 'Fil' menu and nothing crashes for me.
02-03-2012

Yes Click on the file menu so that the popup menu drops down
02-03-2012

This application is working for me. I am simply running SWTMenuCrash which loads the fxml file. Do I have to click somewhere or do something? I am running OS X 10.6.8 and JDK 6u29. Any ideas?
02-03-2012

> It looks like when the PresentingPainter.run() is executing, the FX Application (AppKit) thread isn't locked. This may allow SWT to > perform its own painting (and thus set a different current GL context for the sake of it). I can look into this, however, SWT is not using OpenGL. Any painting SWT is doing is being done as part of the event loop (just like a regular Objective-C application). I will do a bit of investigation ...
02-03-2012

This doesn't look to be a Quantum issue per se.
01-03-2012

After running java -ea -Dprism.verbose=true -XstartOnFirstThread -classpath /Users/morris/jfx/p21-graphics/artifacts/sdk/rt/lib/jfxrt.jar:/Users/morris/jfx/p21-grapcs/import/swt-3.7.1/swt.jar:/Users/morris/jfx/p21-graphics/rt-closed/toys/HelloWorld/build/classes helloworld.SWTMenuCrash On my Mac Pro, 10.7.3 with the following graphics card GL_VENDOR: ATI Technologies Inc. GL_RENDERER: ATI Radeon HD 2600 OpenGL Engine GL_VERSION: 2.1 ATI-7.18.11 I get: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.prism.es2.ES2ResourceFactory.createStockShader(ES2ResourceFactory.java:204) at com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:186) at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:376) at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:325) at com.sun.prism.impl.ps.BaseShaderGraphics.renderShape(BaseShaderGraphics.java:311) at com.sun.prism.impl.BaseGraphics.fill(BaseGraphics.java:312) at com.sun.javafx.sg.prism.NGRegion.fillShape(NGRegion.java:614) at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:215) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:182) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:39) at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1133) at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:182) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:39) at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1133) at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:182) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:39) at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1133) at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:111) at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(AbstractPainter.java:181) at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:73) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at com.sun.prism.render.RenderJob.run(RenderJob.java:37) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:97) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.RuntimeException: Error creating vertex shader at com.sun.prism.es2.ES2Shader.createFromSource(ES2Shader.java:145) at com.sun.prism.es2.ES2ResourceFactory.createShader(ES2ResourceFactory.java:107) at com.sun.prism.shader.Texture_LinearGradient_PAD_Loader.loadShader(Texture_LinearGradient_PAD_Loader.java:53) ... 34 more java.lang.InternalError: Error loading stock shader Texture_LinearGradient_PAD at com.sun.prism.es2.ES2ResourceFactory.createStockShader(ES2ResourceFactory.java:207) at com.sun.prism.impl.ps.BaseShaderContext.getPaintShader(BaseShaderContext.java:186) at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:376) at com.sun.prism.impl.ps.BaseShaderContext.validatePaintOp(BaseShaderContext.java:325) at com.sun.prism.impl.ps.BaseShaderGraphics.renderShape(BaseShaderGraphics.java:311) at com.sun.prism.impl.BaseGraphics.fill(BaseGraphics.java:312) at com.sun.javafx.sg.prism.NGRegion.fillShape(NGRegion.java:614) at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:215) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:182) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:39) at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1133) at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:182) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:39) at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1133) at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:204) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:182) at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:39) at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1133) at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:111) at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(AbstractPainter.java:181) at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:73) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at com.sun.prism.render.RenderJob.run(RenderJob.java:37) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:97) at java.lang.Thread.run(Thread.java:680)
28-02-2012

You need to run SWT apps with "-XstartOnFirstThread" on Mac OS X.
28-02-2012

This application does not crash for me on my Mac (10.7.3, JDK 6u29), instead I get the following after applying rt18837.patch to rt-closed [java] Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access [java] at org.eclipse.swt.SWT.error(SWT.java:4282) [java] at ***WARNING: Display must be created on main thread due to Cocoa restrictions. [java] org.eclipse.swt.SWT.error(SWT.java:4197) [java] at org.eclipse.swt.SWT.error(SWT.java:4168) [java] at org.eclipse.swt.widgets.Display.error(Display.java:1065) [java] at org.eclipse.swt.widgets.Display.createDisplay(Display.java:822) [java] at org.eclipse.swt.widgets.Display.create(Display.java:805) [java] at org.eclipse.swt.graphics.Device.<init>(Device.java:130) [java] at org.eclipse.swt.widgets.Display.<init>(Display.java:696) [java] at org.eclipse.swt.widgets.Display.<init>(Display.java:687) [java] at hellofxcanvas.HelloFXCanvas.main(HelloFXCanvas.java:57) [java] Java Result: 1 I get the same error for HelloFXCanvas
28-02-2012

The PresentingPainter.run() calls a pair of methods pen.begin()/end() to set the current GL context. The crash is happening when calling the pen.end() methods because an assertion fails: the current context differs from the one set by the begin() method. It looks like when the PresentingPainter.run() is executing, the FX Application (AppKit) thread isn't locked. This may allow SWT to perform its own painting (and thus set a different current GL context for the sake of it). I can only speculate that we may try locking the FX App thread at the same time when we call renderLock.lock(). This needs to be evaluated by an expert in the Quantum Renderer code, so I'm reassigning this issue to Morris for further evaluation.
28-02-2012

Anthony, this is an embedding issue with SWT. Could you please take a look?
13-02-2012

Given that Windows (es2) works fine, I'm reassigning this bug to the Glass team for evaluation.
20-01-2012

Here is additional information from my investigation using user test program: To trigger this bug simply run the test program and click the "Fil" Menu on the top-left corner of the window. 1) I'm able to reproduce this bug on my Mac (NVidia GPU), so this isn't a graphics hardware specific bug. 2) I'm able to workaround the bug by specifying j2d pipe (-Dprism.order=j2d). 3) The program runs fine on Windows with either d3d or es2 pipe. This is a Mac specific bug.
20-01-2012

The cube example runs fine and here's the output Prism pipeline init order: es2 j2d Using t2k for text rasterization Using dirty region optimizations Prism pipeline name = com.sun.prism.es2.ES2Pipeline Loading ES2 native library ... succeeded. (X) Got class = class com.sun.prism.es2.ES2Pipeline Initialized prism pipeline: com.sun.prism.es2.ES2Pipeline **** GL_ARB_pixel_buffer_object detected **** createScene: calling Platform.runLater PlatformImpl.runLater returns Platform.runLater :: run EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=false ySet=false w=-1.0 h= cw=800.0 ch=600.0 EmbeddedStage.setBounds: x=NaN y=NaN xSet=true ySet=true w=-1.0 h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=0.0 y=0.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=440.0 y=265.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=440.0 y=265.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 EmbeddedStage.setBounds: x=440.0 y=265.0 xSet=true ySet=true w=NaN h= cw=-1.0 ch=-1.0 Created GL2ES2: com.sun.prism.opengl.impl.gl2.GL2Impl@41d47b2b GL_VENDOR: ATI Technologies Inc. GL_RENDERER: ATI Radeon HD 6750M OpenGL Engine GL_VERSION: 2.1 ATI-1.6.42 GL_EXTENSIONS: GL_ARB_transpose_matrix GL_ARB_vertex_program GL_ARB_vertex_blend GL_ARB_window_pos GL_ARB_shader_objects GL_ARB_vertex_shader GL_ARB_shading_language_100 GL_EXT_multi_draw_arrays GL_EXT_clip_volume_hint GL_EXT_rescale_normal GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_gpu_program_parameters GL_EXT_geometry_shader4 GL_EXT_transform_feedback GL_APPLE_client_storage GL_APPLE_specular_vector GL_APPLE_transform_hint GL_APPLE_packed_pixels GL_APPLE_fence GL_APPLE_vertex_array_object GL_APPLE_vertex_program_evaluators GL_APPLE_element_array GL_APPLE_flush_render GL_APPLE_aux_depth_stencil GL_NV_texgen_reflection GL_NV_light_max_exponent GL_IBM_rasterpos_clip GL_SGIS_generate_mipmap GL_ARB_imaging GL_ARB_point_parameters GL_ARB_texture_env_crossbar GL_ARB_texture_border_clamp GL_ARB_multitexture GL_ARB_texture_env_add GL_ARB_texture_cube_map GL_ARB_texture_env_dot3 GL_ARB_multisample GL_ARB_texture_env_combine GL_ARB_texture_compression GL_ARB_texture_mirrored_repeat GL_ARB_shadow GL_ARB_depth_texture GL_ARB_shadow_ambient GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_occlusion_query GL_ARB_point_sprite GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ARB_pixel_buffer_object GL_ARB_draw_buffers GL_ARB_shader_texture_lod GL_ARB_color_buffer_float GL_ARB_half_float_vertex GL_ARB_texture_rg GL_ARB_texture_compression_rgtc GL_ARB_framebuffer_object GL_EXT_compiled_vertex_array GL_EXT_draw_buffers2 GL_EXT_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_texture_rectangle GL_ARB_texture_rectangle GL_EXT_texture_env_add GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_texture_lod_bias GL_EXT_abgr GL_EXT_bgra GL_EXT_stencil_wrap GL_EXT_texture_filter_anisotropic GL_EXT_separate_specular_color GL_EXT_secondary_color GL_EXT_blend_func_separate GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_sRGB GL_EXT_blend_equation_separate GL_EXT_texture_mirror_clamp GL_EXT_packed_depth_stencil GL_EXT_bindable_uniform GL_EXT_texture_integer GL_EXT_gpu_shader4 GL_EXT_framebuffer_sRGB GL_EXT_provoking_vertex GL_APPLE_flush_buffer_range GL_APPLE_ycbcr_422 GL_APPLE_rgb_422 GL_APPLE_vertex_array_range GL_APPLE_texture_range GL_APPLE_float_pixels GL_ATI_texture_float GL_ARB_texture_float GL_ARB_half_float_pixel GL_APPLE_pixel_buffer GL_APPLE_object_purgeable GL_NV_blend_square GL_NV_fog_distance GL_NV_conditional_render GL_ATI_texture_mirror_once GL_ATI_blend_equation_separate GL_ATI_blend_weighted_minmax GL_ATI_texture_env_combine3 GL_ATI_separate_stencil GL_ATI_texture_compression_3dc GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SGI_color_matrix GL_EXT_texture_array GL_EXT_vertex_array_bgra GL_ARB_instanced_arrays GL_ARB_depth_buffer_float GL_EXT_packed_float GL_EXT_texture_shared_exponent
20-01-2012

As noted in the bug I could only crash with the FXCanvas when I run as a plain OS-X application it didn't crashed. Will now run your JFXPanelColorCube should have results later
20-01-2012

Hi Tom, Can you try running JFXPanelColorCube.java, the attached program? It would also be helpful if you can run it with -Dprism.verbose=true property and report back to us the GL_VENDOR, GL_RENDERER and GL_VERSION information that is printed to the output. For example, here is the information I got on my Mac Mini: GL_VENDOR: NVIDIA Corporation GL_RENDERER: NVIDIA GeForce 9400M OpenGL Engine GL_VERSION: 2.1 NVIDIA-1.6.36
20-01-2012

I wonder does this crash happens only with FXCanvas or any JavaFX program on Mac with ATI GPU (just like the case in RT-17690 on older ATI)
20-01-2012

Note that this ATI card -- the Radeon HD 6750M -- is not an old card.
20-01-2012

I note that the system in question is running an AMD (ATI) graphics card. This may be related to RT-17690 which reports a similar exception (but no crash) also on an ATI card.
20-01-2012

I was able to run it as a simple JavaFX 2.1 application and if not using the SWT-Embedding all is fine.
09-01-2012