Bug 932 - javax.media.opengl.GLProfile.initSingleton() crashes in native code with Intel Graphics driver in standard configuration on Windows 7
Summary: javax.media.opengl.GLProfile.initSingleton() crashes in native code with Inte...
Status: RESOLVED WORKSFORME
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 2
Hardware: pc_all windows
: P3 normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2013-12-27 16:15 CET by Dennis Cosgrove
Modified: 2015-09-27 03:09 CEST (History)
2 users (show)

See Also:
Type: DEFECT
SCM Refs:
Workaround: TRUE


Attachments
zip file containing debug output, crash log files, code to reproduce the bug, and a screen shot of the performance information and tools panel (96.76 KB, application/x-zip-compressed)
2013-12-27 16:15 CET, Dennis Cosgrove
Details
detailed bug log requested by Julien Gouesse (227.74 KB, application/octet-stream)
2014-01-15 17:13 CET, Dennis Cosgrove
Details
crash log associated with test_dbg (17.51 KB, application/octet-stream)
2014-01-15 17:14 CET, Dennis Cosgrove
Details
JOGL's Version Applet output from 2 Machines w/ Intel HD3000 and HD4000 (1017 bytes, text/plain)
2014-01-22 14:46 CET, Sven Gothel
Details
JOGL Version Applet main output for Intel 4600 w/ well configured drivers (3.87 KB, text/plain)
2014-01-24 18:09 CET, Dennis Cosgrove
Details
JOGL Version Applet capabilities output for Intel 4600 w/ well configured drivers (6.97 KB, text/plain)
2014-01-24 18:09 CET, Dennis Cosgrove
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Cosgrove 2013-12-27 16:15:24 CET
Created attachment 570 [details]
zip file containing debug output, crash log files, code to reproduce the bug, and a screen shot of the performance information and tools panel

seemingly any call to JOGL on a Windows 7 machine with the Intel graphics driver (as configured from installing Windows and performing Windows Update) crashes natively.

Intel(R) HD Graphics 4600
Driver Date: 10/31/2013
Driver Version: 10.18.10.3345

the following code exhibits the bug consistently (see attachment IntelDriverBugTest.java)

package intel_driver_bug;

public class IntelDriverBugTest {
	public static void main(String[] args) {
		javax.swing.SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				javax.media.opengl.GLProfile.initSingleton();
			}
		});
	}
}

this bug also occurs when GLProfile.initSingleton is invoked outside of a SwingUtilities.invokeLater.  as one might expect, code of the form:

javax.media.opengl.awt.GLCanvas glCanvas = new javax.media.opengl.awt.GLCanvas();
javax.swing.JFrame frame = new javax.swing.JFrame();
frame.getContentPane().add(glCanvas);
frame.setVisible(true);

also crashes.

note: the same behavior is exhibited when on both 32bit and 64bit VMs.

----

the final output line before crashing (see attachment output.txt) is:

AWT-EventQueue-0-SharedResourceRunner: createImpl: START GLCaps[wgl vid 7 gdi: rgba 8/8/8/8, opaque, accum-rgba 16/16/16/16, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.sw], on-scr[.]], share 0x0

----

of note from the error log (see attachment hs_err_pid4440.log):

Stack: [0x0000000012c70000,0x0000000012d70000],  sp=0x0000000012d6ef10,  free space=1019k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ig75icd64.dll+0x154dba]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  jogamp.opengl.windows.wgl.WGL.dispatch_wglMakeCurrent0(JJJ)Z+0
j  jogamp.opengl.windows.wgl.WGL.wglMakeCurrent(JJ)Z+41
j  jogamp.opengl.windows.wgl.WindowsWGLContext.createImpl(J)Z+410
j  jogamp.opengl.GLContextImpl.makeCurrentWithinLock(I)I+200
j  jogamp.opengl.GLContextImpl.makeCurrent(Z)I+457
j  jogamp.opengl.GLContextImpl.makeCurrent()I+2
j  jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory$SharedResourceImplementation.createSharedResource(Ljava/lang/String;)Ljogamp/opengl/SharedResourceRunner$Resource;+158
j  jogamp.opengl.SharedResourceRunner.run()V+267
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

----

These drivers are notoriously terrible out of the box.  Windows Experience Index rates the performance for Graphics and Gaming Graphics with the lowest possible score of 1.0.  Simply pressing the "Refresh Now" button in this control panel subsection (see PerformanceInformationAndTools.png) seems to fix the problem.  One can direct users with this configuration to this control panel with the system command:

control /name Microsoft.PerformanceInformationAndTools

if we can get JOGL to report the problem rather than crashing.

----

Unlike with previous reports which were on machines I had limited access to, I have complete access to this machine.  I am eager to help in any way I can.

----

I have run the junit tests and, as you might imagine, it fails on test after test.
Comment 1 Julien Gouesse 2014-01-14 19:44:09 CET
Hi

This is not reproducible with Intel HD Graphics 3000 for sure, another user asked me to fix a bug in Ardor3D JOGL 2 renderer and he tested under Windows 7 with this chip and an updated driver.

Do you experience similar crashes with OpenGL applications not using JOGL?
Comment 2 Dennis Cosgrove 2014-01-15 01:00:52 CET
(In reply to comment #1)
> This is not reproducible with Intel HD Graphics 3000 for sure, another user
> asked me to fix a bug in Ardor3D JOGL 2 renderer and he tested under Windows
> 7 with this chip and an updated driver.

to be clear: a machine must have its display drivers poorly configured to exhibit this bug.  for this one machine under my control (and for many of our users) this poor state is the default configuration for the intel driver.

> Do you experience similar crashes with OpenGL applications not using JOGL?

on the machine configuration that exhibits this crash with jogl2, jogl v1.1.1 is able to create a GLPanel and render a complex scene.

jogl v1.1.1 is far from rock solid as it crashes when attempting to show two render windows.
Comment 3 Julien Gouesse 2014-01-15 10:17:27 CET
> on the machine configuration that exhibits this crash with jogl2, jogl
> v1.1.1 is able to create a GLPanel and render a complex scene.

GLJPanel? Please can you enable all logs?
http://jogamp.org/wiki/index.php/Jogl_FAQ#Detailed_Debug_Log
Comment 4 Julien Gouesse 2014-01-15 10:23:49 CET
The GDI renderer seems to be picked according to the outputs.

What happens if you call GLCapabilities.setDepthBits(24)?
Comment 5 Dennis Cosgrove 2014-01-15 17:13:27 CET
Created attachment 573 [details]
detailed bug log requested by Julien Gouesse

see associated hs_err_pid4744.log
Comment 6 Dennis Cosgrove 2014-01-15 17:14:44 CET
Created attachment 574 [details]
crash log associated with test_dbg

crash log when running test_dbg.bat
Comment 7 Dennis Cosgrove 2014-01-15 17:18:02 CET
(In reply to comment #3)
> > on the machine configuration that exhibits this crash with jogl2, jogl
> > v1.1.1 is able to create a GLPanel and render a complex scene.
> 
> GLJPanel? Please can you enable all logs?
> http://jogamp.org/wiki/index.php/Jogl_FAQ#Detailed_Debug_Log

please see attachments 573 and 574.

test_dbg.bat crashes (as expected) but produces logs.
Comment 8 Dennis Cosgrove 2014-01-15 17:28:03 CET
(In reply to comment #4)
> The GDI renderer seems to be picked according to the outputs.
> 
> What happens if you call GLCapabilities.setDepthBits(24)?

the following program:

javax.media.opengl.GLProfile glProfile = javax.media.opengl.GLProfile.getDefault();
javax.media.opengl.GLCapabilities glCapabilities = new javax.media.opengl.GLCapabilities(glProfile);
glCapabilities.setDepthBits(24);
javax.media.opengl.awt.GLCanvas glCanvas = new javax.media.opengl.awt.GLCanvas( glCapabilities );
javax.swing.JFrame frame = new javax.swing.JFrame();
frame.getContentPane().add(glCanvas);
frame.setVisible(true);

crashes on the very first line:

javax.media.opengl.GLProfile glProfile = javax.media.opengl.GLProfile.getDefault();

is there another way to test setting the depth bits that i am missing?
or were you asking me to test things on jogl v1.1.1?
Comment 9 Sven Gothel 2014-01-22 14:46:57 CET
Created attachment 578 [details]
JOGL's Version Applet output from 2 Machines w/ Intel HD3000 and HD4000

Intel(R) HD Graphics 3000
3.1 (Compat profile, arb, FBO, hardware) - 3.1.0 - 
Build 9.17.10.3347 [GL 3.1.0, vendor 9.17.10 (- Build 9.17.10.3347)]

Intel(R) HD Graphics 4000
4.0 (Compat profile, arb, ES2 compat, FBO, hardware) - 4.0.0 - 
Build 10.18.10.3345 [GL 4.0.0, vendor 10.18.10 (- Build 10.18.10.3345)]
Comment 10 Sven Gothel 2014-01-22 14:48:33 CET
Your crash w/
  Intel(R) HD Graphics 4600
  Driver Version: 10.18.10.3345

My working w/ (See Comment 9)
  Intel(R) HD Graphics 4000
  4.0 (Compat profile, arb, ES2 compat, FBO, hardware) - 4.0.0 - 
  Build 10.18.10.3345 [GL 4.0.0, vendor 10.18.10 (- Build 10.18.10.3345)]

Same driver, diff hardware .. hmm.
Comment 11 Sven Gothel 2014-01-22 15:01:18 CET
(In reply to comment #10)
> Your crash w/
>   Intel(R) HD Graphics 4600
>   Driver Version: 10.18.10.3345
> 
> My working w/ (See Comment 9)
>   Intel(R) HD Graphics 4000
>   4.0 (Compat profile, arb, ES2 compat, FBO, hardware) - 4.0.0 - 
>   Build 10.18.10.3345 [GL 4.0.0, vendor 10.18.10 (- Build 10.18.10.3345)]
> 
> Same driver, diff hardware .. hmm.

Since I don't have a HD4600 available, please test w/ 
the [following] latest driver and report, THANK YOU!

+++
https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23405

Version: 15.33.8.64.3345 	
Date: 11/20/2013 	
Status: Latest 
+++
Comment 12 Sven Gothel 2014-01-22 20:27:29 CET
Reduced severity to 'major'.

Can we confirm this is a driver bug ?
After all .. this is very likely, since such call shall not cause a crash.

However, do we need a workaround or does the new Intel driver
fix the issue ?

I like to pressure this resolution for the 2.1.4 release,
again - sadly I don't have a box w/ this configuration.

Anybody willing to give me ssh access to such ?
Comment 13 Dennis Cosgrove 2014-01-24 18:09:08 CET
Created attachment 579 [details]
JOGL Version Applet main output for Intel 4600 w/ well configured drivers
Comment 14 Dennis Cosgrove 2014-01-24 18:09:35 CET
Created attachment 580 [details]
JOGL Version Applet capabilities output for Intel 4600 w/ well configured drivers
Comment 15 Dennis Cosgrove 2014-01-24 18:18:24 CET
(In reply to comment #11)
> (In reply to comment #10)
> > Your crash w/
> >   Intel(R) HD Graphics 4600
> >   Driver Version: 10.18.10.3345
> > 
> > My working w/ (See Comment 9)
> >   Intel(R) HD Graphics 4000
> >   4.0 (Compat profile, arb, ES2 compat, FBO, hardware) - 4.0.0 - 
> >   Build 10.18.10.3345 [GL 4.0.0, vendor 10.18.10 (- Build 10.18.10.3345)]
> > 
> > Same driver, diff hardware .. hmm.
> 
> Since I don't have a HD4600 available, please test w/ 
> the [following] latest driver and report, THANK YOU!
> 
> +++
> https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23405
> 
> Version: 15.33.8.64.3345 	
> Date: 11/20/2013 	
> Status: Latest 
> +++

the results of the JOGL's Version Applet can be found in attachment 579 [details] and attachment 580 [details].
Comment 16 Dennis Cosgrove 2014-01-24 18:38:49 CET
(In reply to comment #12)
> Reduced severity to 'major'.
> 
> Can we confirm this is a driver bug ?
> After all .. this is very likely, since such call shall not cause a crash.
> 
> However, do we need a workaround or does the new Intel driver
> fix the issue ?
> 
> I like to pressure this resolution for the 2.1.4 release,
> again - sadly I don't have a box w/ this configuration.
> 
> Anybody willing to give me ssh access to such ?

There has never been any question in my mind that this is a bad driver configuration problem.  There are many ways to fix this problem: download the latest drivers from Intel -or- go the the Performance Information And Tools control panel and click on a button -or- run winsat.exe...  

Why this issue is so critical to me is that the driver problem we are triggering does not throw and exception, it *crashes*.  I know it is not anyone on the JOGL team's fault, but I'm hoping we can find some clever way to detect and avoid this crash.  The Intel cards are pervasive and a lot of our users report this problem.  More scary is the fact it happens on my newly minted Windows 7 machine (even after completely Windows Updating).  Sadly, not all of our users have the technical expertise or even the permissions to install new drivers.

If we cannot come up with a solution, my current plan is to record the fact that initSingleton did not return and on the next run of the system prompt with a fix-your-graphics-drivers dialog that runs winsat.exe.  Still, I hold out hope we might be able to detect something is awry and respond accordingly.

Thank you for all of your work on JOGL.
Comment 17 Dennis Cosgrove 2014-01-24 18:39:50 CET
(In reply to comment #12)
> Anybody willing to give me ssh access to such ?

I am happy to do whatever it takes to help solve this problem.
Comment 18 Sven Gothel 2014-01-25 00:28:56 CET
P3 normal - ANNOTATION - Workaround (desired),

since we agree it's an Intel GPU driver bug.

(In reply to comment #17)
> (In reply to comment #12)
> > Anybody willing to give me ssh access to such ?
> 
> I am happy to do whatever it takes to help solve this problem.

@Dennis: Yes, that would be great.

http://jogamp.org/git/?p=jogamp-scripting.git;a=tree;f=jenkins-server-slave-setup/cygwin-sshd;h=43950cf6c6c499dbd7aab137c827c158e0f81ba0;hb=HEAD

We would need the 'usr process' setup, 
since we need access to the GPU, see:

- cygwin_sshd_win7_init.txt
- cygwin_sshd_win7_usr_process.txt

I have sent you my ssh public key via email.

+++

~Sven
Comment 19 Dennis Cosgrove 2014-01-30 03:02:54 CET
windows deletes user created restore points in favor of insignificant automatic restore points.  this leaves me in a deep state of sadness and no longer able to reproduce the bug.