Bug 818

Summary: JOGL 2.0.2 crash on Mac OS X 10.6.8 with GLJPanel
Product: [JogAmp] Jogl Reporter: Gerco Ballintijn <gerco.ballintijn>
Component: macosxAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: blocker CC: gouessej, karelknoest
Priority: ---    
Version: 2   
Hardware: Other   
OS: macosx   
Type: --- SCM Refs:
51ea4e5d5d212dfef519cf824d6cbf69e41bebc7 b783e3172496cb93455339101a8c2c0814f6fafd cdf38b01fc4b632554c6400239ca5cdca1fe13d9 abdc28ec9304b39f981c49e2f9554e05aaff9cc3
Workaround: ---
Attachments: Reproduction
Stack trace

Description Gerco Ballintijn 2013-08-16 14:37:15 CEST
Our applet has a hard crash (crashes the JVM) on Mac OS X 10.6.8 with GLJPanel, but not any other configuration (i.e., on a PC, on OSX 10.8, using a GLCanvas).

Zie attachment for example code that crashes and the error dump file.
Comment 1 Gerco Ballintijn 2013-08-16 14:41:08 CEST
Hhhhmmm, ZIP file is too big. I will have to add it later...
Comment 2 Karel Knoest 2013-08-19 09:47:19 CEST
Created attachment 494 [details]
Reproduction

Example code to reproduce bug. To run:
1. Add jogl jars in folder applet/jogl
2. Run applet.html on Mac OSX 10.6.8
Comment 3 Julien Gouesse 2013-08-19 10:25:55 CEST
You wrote that you use Apple Java SE 6, 1.6.0_51-b11-457 under Mac OS X 10.6.8 but you don't indicate which graphics card you use, you mentioned an onboard Intel chip and an Nvidia extension card, please can you be more accurate?
Comment 4 Karel Knoest 2013-08-21 08:59:49 CEST
Apologies for the omission. Upon further examination, I find that the Intel HD Graphics 288 MB is working correctly. 

The discrete graphics card NVIDIA GeForce GT 330M fails.
Comment 5 Karel Knoest 2013-08-21 09:08:03 CEST
Created attachment 495 [details]
Stack trace

Stack trace after crash.
Comment 6 Karel Knoest 2013-09-12 13:44:02 CEST
Hi Julien,

Would you have a chance to test the test case on the Mac Book with OS X 10.6.8? Your feedback would greatly help us to decide on our next steps for the adoption of JOGL v2.0.2 (wait for fix, invest in work-arounds, etc). Looking very much forward to your findings.
Comment 7 Julien Gouesse 2013-09-12 15:15:34 CEST
(In reply to comment #6)
> Hi Julien,
> 
> Would you have a chance to test the test case on the Mac Book with OS X
> 10.6.8? Your feedback would greatly help us to decide on our next steps for
> the adoption of JOGL v2.0.2 (wait for fix, invest in work-arounds, etc).
> Looking very much forward to your findings.

Hi

I can try to reproduce your bug tonight on the Mac Book Pro that Sven gave me. The only workaround I see consists in disabling the use of GLSL in the GLJPanel. NVIDIA GeForce GT 330M has a bad support of GLSL even on other operating systems, some end users already reported crashes or huge slowdowns in non JOGL applications (Blender, Dolphin Emu, ...). It would be fine to disable GLSL in GLJPanel just for this chipset, wouldn't it?
Comment 8 Karel Knoest 2013-09-12 16:43:03 CEST
Indeed, the disabling of the use of GLSL fixes the hard crash. Unfortunately, we then run into refresh problems (specifically, mouse interaction over the canvas was required to force a canvas redraw after adding new content to the scene). 

Despite this new problem, this work-around is definitely worth more consideration if the above reported bug turns out to be hard to fix / a problem with the driver.

Much thanks for the planned test on your Mac, as it provides us the context to further invest in the work-around route or wait for a fix.
Comment 9 Julien Gouesse 2013-09-12 23:15:40 CEST
I wanted to try the applet but the latest stable release of JOGL 2 has been built with Java 1.7 whereas I use Apple Java 1.6 update 51 (the very latest version obtained through the software update). I'm a bit stuck and rebuilding JOGL 2 on Mac would take ages as I'm not very comfortable with this OS.

@Sven Is there a chance that you deploy a build supporting Java 1.6 soon?
Comment 10 Julien Gouesse 2013-09-12 23:16:39 CEST
I use a chipset Nvidia 8600M GT under Mac OS X 10.6.8. I'm not sure I will succeed in reproducing your bug.
Comment 11 Sven Gothel 2013-09-29 21:23:29 CEST
(In reply to comment #7)
> (In reply to comment #6)
> > Hi Julien,
> > 
> > Would you have a chance to test the test case on the Mac Book with OS X
> > 10.6.8? Your feedback would greatly help us to decide on our next steps for
> > the adoption of JOGL v2.0.2 (wait for fix, invest in work-arounds, etc).
> > Looking very much forward to your findings.
> 
> Hi
> 
> I can try to reproduce your bug tonight on the Mac Book Pro that Sven gave
> me. The only workaround I see consists in disabling the use of GLSL in the
> GLJPanel. NVIDIA GeForce GT 330M has a bad support of GLSL even on other
> operating systems, some end users already reported crashes or huge slowdowns
> in non JOGL applications (Blender, Dolphin Emu, ...). It would be fine to
> disable GLSL in GLJPanel just for this chipset, wouldn't it?

Yes, we could create a 'quirk' for this GL_RENDERER.

Have a look into GLRendererQuirks, where we specify those,
and in GLContextImpl .. where they are set/detected.

Maybe you can provide a patch .. or at least detailed knowledge of GL strings 
(GL_VENDOR, GL_RENDERER, ..) so we can add them ?

I would propose: GLSLNonCompliant (for crash) or GLSLBadPerformance (if 'only' too slow)
Comment 12 Sven Gothel 2013-09-29 21:24:35 CEST
(In reply to comment #9)
> I wanted to try the applet but the latest stable release of JOGL 2 has been
> built with Java 1.7 whereas I use Apple Java 1.6 update 51 (the very latest
> version obtained through the software update). I'm a bit stuck and
> rebuilding JOGL 2 on Mac would take ages as I'm not very comfortable with
> this OS.
> 
> @Sven Is there a chance that you deploy a build supporting Java 1.6 soon?

Bug 835 has been fixed and a new aggregated builds w/ maven deployment 
has been created.
Comment 13 Karel Knoest 2013-09-30 11:41:46 CEST
Some information for our machine:
GL_VENDOR: "NVIDIA Corporation"
GL_RENDERER: "NVIDIA GeForce GT 330M OpenGL Engine"
GL_VERSION: "2.1 NVIDIA-8.12.47 310.40.00.05f01"

GL_EXTENSIONS: 
"GL_ARB_color_buffer_float GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_seamless_cube_map GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_transpose_matrix GL_ARB_vertex_array_bgra GL_ARB_vertex_blend GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_clip_volume_hint GL_EXT_depth_bounds_test GL_EXT_draw_buffers2 GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_s3tc GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_rectangle GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array_bgra GL_APPLE_aux_depth_stencil GL_APPLE_client_storage GL_APPLE_element_array GL_APPLE_fence GL_APPLE_float_pixels GL_APPLE_flush_buffer_range GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_packed_pixels GL_APPLE_pixel_buffer GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_specular_vector GL_APPLE_texture_range GL_APPLE_transform_hint GL_APPLE_vertex_array_object GL_APPLE_vertex_array_range GL_APPLE_vertex_point_size GL_APPLE_vertex_program_evaluators GL_APPLE_ycbcr_422 GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_ATI_texture_mirror_once GL_IBM_rasterpos_clip GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_fog_distance GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_light_max_exponent GL_NV_multisample_filter_hint GL_NV_point_sprite GL_NV_texgen_reflection GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_SGIS_generate_mipmap GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod "
Comment 14 Julien Gouesse 2013-10-01 11:02:32 CEST
(In reply to comment #12)
> (In reply to comment #9)
> > I wanted to try the applet but the latest stable release of JOGL 2 has been
> > built with Java 1.7 whereas I use Apple Java 1.6 update 51 (the very latest
> > version obtained through the software update). I'm a bit stuck and
> > rebuilding JOGL 2 on Mac would take ages as I'm not very comfortable with
> > this OS.
> > 
> > @Sven Is there a chance that you deploy a build supporting Java 1.6 soon?
> 
> Bug 835 has been fixed and a new aggregated builds w/ maven deployment 
> has been created.

Is there an online demo using a GLJPanel with this fix so that I can make a quick test at home?
Comment 15 Sven Gothel 2013-10-03 00:20:12 CEST
(In reply to comment #13)
> Some information for our machine:
> GL_VENDOR: "NVIDIA Corporation"
> GL_RENDERER: "NVIDIA GeForce GT 330M OpenGL Engine"
> GL_VERSION: "2.1 NVIDIA-8.12.47 310.40.00.05f01"
> 

commit 51ea4e5d5d212dfef519cf824d6cbf69e41bebc7

-----------------------------------------------------------------------------------------------------
Platform: MACOS / Mac OS X 10.7.5 (os), x86_64 (arch), GENERIC_ABI, 2 cores
MachineDescription: runtimeValidated true, littleEndian true, 32Bit false, primitive size / alignment:
Platform: Java Version: 1.7.0_40 (1.7.0u40), VM: Java HotSpot(TM) 64-Bit Server VM, Runtime: Java(TM) SE Runtime Environment
Platform: Java Vendor: Oracle Corporation, http://java.oracle.com/, JavaSE: true, Java6: true, AWT enabled: true
-----------------------------------------------------------------------------------------------------
Swap Interval  -1
GL Profile     GLProfile[GL2/GL2.hw]
GL Version     2.1 (Compat profile, arb, FBO, hardware) - 2.1 NVIDIA-7.32.12 [GL 2.1.0, vendor 7.32.12 (NVIDIA-7.32.12)]
Quirks         [NoOffscreenBitmap]
Impl. class    jogamp.opengl.gl4.GL4bcImpl
GL_VENDOR      NVIDIA Corporation
GL_RENDERER    NVIDIA GeForce 320M OpenGL Engine
GL_VERSION     2.1 NVIDIA-7.32.12
GLSL           true, has-compiler-func: true, version: 1.20 / 1.20.0
GL FBO: basic true, full true
GL_EXTENSIONS  134
GLX_EXTENSIONS 0
-----------------------------------------------------------------------------------------------------

No crash .. but diff. 
  - diff OSX version
  - similar NV GPU / driver ..
  - diff java version
Comment 16 Karel Knoest 2013-10-03 08:58:08 CEST
> No crash .. but diff. 
>   - diff OSX version
>   - similar NV GPU / driver ..
>   - diff java version

We find that on OSX 10.7 and 10.8, this crash doesn't happen. For us, it's limited to OSX 10.6 + Apple JRE (Oracle Java 7 not available for OSX 10.6).
Comment 17 Karel Knoest 2013-10-03 08:59:45 CEST
More precise, on OSX 10.7 and 10.8 running on the same machine, the crash doesn't happen for us either.
Comment 18 Sven Gothel 2013-10-03 20:22:53 CEST
commit cdf38b01fc4b632554c6400239ca5cdca1fe13d9 shall fix the issue ..

building now .. will produce a signed RC ..
Comment 20 Karel Knoest 2013-10-04 10:00:18 CEST
Thank you very much. The unit test is now running on our test machine in OSX 10.6.