Bug 1484 - EXCEPTION_ACCESS_VIOLATION during call of GDI.DescribePixelFormat
Summary: EXCEPTION_ACCESS_VIOLATION during call of GDI.DescribePixelFormat
Alias: None
Product: Jogl
Classification: JogAmp
Component: windows (show other bugs)
Version: 2.6.0
Hardware: All windows
: P4 normal
Assignee: Sven Gothel
Depends on:
Reported: 2024-01-03 10:49 CET by Mathieu Féry (MathiusD)
Modified: 2024-01-16 10:33 CET (History)
1 user (show)

See Also:
SCM Refs:
Workaround: ---

hs_err_pidXXX.log related of this issue (53.75 KB, text/plain)
2024-01-03 10:49 CET, Mathieu Féry (MathiusD)
test-fat-jars.bat (312 bytes, application/x-msdos-program)
2024-01-03 14:49 CET, Mathieu Féry (MathiusD)
v2.5.0.log (903 bytes, text/plain)
2024-01-03 14:50 CET, Mathieu Féry (MathiusD)
hs_err_pid6872.log (53.75 KB, text/plain)
2024-01-03 14:50 CET, Mathieu Féry (MathiusD)
test.bat (862 bytes, application/x-msdos-program)
2024-01-03 14:50 CET, Mathieu Féry (MathiusD)
test.log (3.49 KB, text/plain)
2024-01-03 14:51 CET, Mathieu Féry (MathiusD)
hs_err_pid6508.log (53.77 KB, text/plain)
2024-01-03 14:51 CET, Mathieu Féry (MathiusD)
test_dbg.bat (463 bytes, application/x-msdos-program)
2024-01-03 14:52 CET, Mathieu Féry (MathiusD)
test_dbg.log (516.96 KB, text/plain)
2024-01-03 14:52 CET, Mathieu Féry (MathiusD)
hs_err_pid3212.log (53.59 KB, text/plain)
2024-01-03 14:52 CET, Mathieu Féry (MathiusD)
test-fat-jars-wgl.bat (366 bytes, application/x-msdos-program)
2024-01-03 14:53 CET, Mathieu Féry (MathiusD)
test-wgl.bat (940 bytes, application/x-msdos-program)
2024-01-03 14:53 CET, Mathieu Féry (MathiusD)
test_dbg-wgl.bat (517 bytes, application/x-msdos-program)
2024-01-03 14:54 CET, Mathieu Féry (MathiusD)
systemInformations.png (437.40 KB, image/png)
2024-01-04 16:57 CET, Mathieu Féry (MathiusD)
DxDiag-before.txt (29.30 KB, text/plain)
2024-01-16 10:14 CET, Mathieu Féry (MathiusD)
DxDiag-after.txt (29.29 KB, text/plain)
2024-01-16 10:16 CET, Mathieu Féry (MathiusD)
v2.5.0-wgl.log (903 bytes, text/plain)
2024-01-16 10:25 CET, Mathieu Féry (MathiusD)
hs_err_pid3720.log (54.16 KB, text/plain)
2024-01-16 10:30 CET, Mathieu Féry (MathiusD)
test-wgl.log (3.49 KB, text/plain)
2024-01-16 10:32 CET, Mathieu Féry (MathiusD)
hs_err_pid4016.log (53.84 KB, text/plain)
2024-01-16 10:32 CET, Mathieu Féry (MathiusD)
test_dbg-wgl.log (516.97 KB, text/plain)
2024-01-16 10:33 CET, Mathieu Féry (MathiusD)
hs_err_pid3992.log (54.18 KB, text/plain)
2024-01-16 10:33 CET, Mathieu Féry (MathiusD)

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Féry (MathiusD) 2024-01-03 10:49:03 CET
Created attachment 865 [details]
hs_err_pidXXX.log related of this issue

The problem is present every time.

Here the JRE used is the following:
JRE version: OpenJDK Runtime Environment Temurin-11.0.21+9 (11.0.21+9) (build 11.0.21+9)
Java VM: OpenJDK 64-Bit Server VM Temurin-11.0.21+9 (11.0.21+9, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)

The user in question is on the following OS : Windows 7
Platform: WINDOWS / Windows 7 6.1 (6.1.0), amd64 (X86_64, GENERIC_ABI), 4 cores, littleEndian true

We use version 2.5.0 of Jogamp

Here are a minimal reproduction scenario: Launch UISceneDemo20

Script related : test-fat-jars.bat

Here stdout & stderr : v2.5.0.log and hs_err_pidXXX : hs_err_pid6872.log

In this case jre are present in ./jre folder and we add jogamp-fat.jar, jogl-demos.jar and jogl-fonts-p0.jar in current directory

Here are the results of the detailed debugging scripts :

With following script : test.bat
stdout & stderr : test.log and hs_err_pidXXX : hs_err_pid6508.log

With following script : test_dbg.bat
stdout & stderr : test_dbg.log and hs_err_pidXXX : hs_err_pid3212.log

Taken from this discussion: https://forum.jogamp.org/BugReport-EXCEPTION-ACCESS-VIOLATION-during-call-of-GDI-DescribePixelFormat-td4043235.html
Comment 1 Julien Gouesse 2024-01-03 13:29:19 CET
Please can you set jogl.windows.useWGLVersionOf5WGLGDIFuncSet to true?
Comment 2 Mathieu Féry (MathiusD) 2024-01-03 14:48:19 CET
I modified the scripts as necessary and asked our impacted user to test with!

(I will add the scripts as an attachment)
Comment 3 Mathieu Féry (MathiusD) 2024-01-03 14:49:29 CET
Created attachment 866 [details]
Comment 4 Mathieu Féry (MathiusD) 2024-01-03 14:50:03 CET
Created attachment 867 [details]
Comment 5 Mathieu Féry (MathiusD) 2024-01-03 14:50:29 CET
Created attachment 868 [details]
Comment 6 Mathieu Féry (MathiusD) 2024-01-03 14:50:59 CET
Created attachment 869 [details]
Comment 7 Mathieu Féry (MathiusD) 2024-01-03 14:51:17 CET
Created attachment 870 [details]
Comment 8 Mathieu Féry (MathiusD) 2024-01-03 14:51:36 CET
Created attachment 871 [details]
Comment 9 Mathieu Féry (MathiusD) 2024-01-03 14:52:02 CET
Created attachment 872 [details]
Comment 10 Mathieu Féry (MathiusD) 2024-01-03 14:52:19 CET
Created attachment 873 [details]
Comment 11 Mathieu Féry (MathiusD) 2024-01-03 14:52:32 CET
Created attachment 874 [details]
Comment 12 Mathieu Féry (MathiusD) 2024-01-03 14:53:13 CET
Created attachment 875 [details]
Comment 13 Mathieu Féry (MathiusD) 2024-01-03 14:53:53 CET
Created attachment 876 [details]
Comment 14 Mathieu Féry (MathiusD) 2024-01-03 14:54:11 CET
Created attachment 877 [details]
Comment 15 Mathieu Féry (MathiusD) 2024-01-03 15:06:16 CET
(In reply to Julien Gouesse from comment #1)

I hadn't tested this property before, especially when I had read the information here: https://www.khronos.org/opengl/wiki/Platform_specifics:_Windows#The_WGL_functions

P.S.: All attachments are added, I'm waiting for our concerned user's logs before forwarding them here.
Comment 16 Julien Gouesse 2024-01-03 17:26:26 CET
(In reply to Mathieu Féry (MathiusD) from comment #15)
I understand your position, I'm trying to find an acceptable workaround that would be used only in a particular case to avoid a crash, it would be better than nothing, wouldn't it?

By the way, please check whether this machine uses AMD CrossFire or Nvidia Optimus. If so, force it to use the most capable GPU and try again.
Comment 17 Mathieu Féry (MathiusD) 2024-01-03 17:34:49 CET
(In reply to Julien Gouesse from comment #16)
Yes, totally, it was only to explain why I hadn't dared test it beforehand.

I'm asking now, but it didn't seem to me that the user was using Optimus or Crossfire
Comment 18 Mathieu Féry (MathiusD) 2024-01-04 16:57:58 CET
Created attachment 878 [details]

Our user hasn't come back to us yet, but I do have found some additional information about his OS (I just forgot we had screen of system information with model :x).

OS: Windows 7 Service Pack 1

 - Manufacturer: HP
 - Model: p6355fr
 - CPU: Intel(R) Core(TM) i3 CPU 530 @ 2.93 GHz
 - RAM: 6.0Go
 - 64bits

I'm still waiting for more information from our user, but with the model I found the integrated graphics card should be an ATI Radeon HD 5450.
Comment 19 Sven Gothel 2024-01-04 17:54:01 CET
Thank you.

Tagged for 2.6.0 as version 2.5.0 is already out of the door
and yes, should be fixed for out next darling :)
Comment 20 Sven Gothel 2024-01-04 17:56:10 CET
(In reply to Sven Gothel from comment #19)
I realize I abuse the version filed :)

Our bugzilla still configured as 'version where bug has been found',
while I always used it as 'version where we expected it to be fixed' 
for our release management.
We will stick with my semantics .. will try to change the 'doc entry' 
for the field if possible.
Comment 21 Sven Gothel 2024-01-04 23:29:37 CET
OK, I have looked at 
- test_dbg.log (attachment 873 [details])
- hs_err_pid3212.log (attachment 874 [details])

GDI.CreateDummyWindow() dummyWindowClass RegisteredClass[handle 0x13f140000, _dummyWindow_clazz0, dtx 0x6b84c0]^M
ProxySurfaceImpl: surface change 0x0 -> 0x3f0104e0^M
updateGraphicsConfiguration(using target): hdc 0x3f0104e0^M
user chosen caps GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.sw], on-scr[.]]^M
updateGraphicsConfigurationARB: SharedResource is null: WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0x72967906]]^M
updateGraphicsConfigurationGDI: hdc 0x3f0104e0, capsChosen GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono  , hw, GLProfile[GL2/GL2.sw], on-scr[.]], WINDOW^M
    extHDC false, chooser false, pformatsNum -1^M

Stack: [0x0000000063290000,0x0000000063390000],  sp=0x000000006338cef8,  free space=1011k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [atio6axx.dll+0xd28ffb]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  jogamp.nativewindow.windows.GDI.DescribePixelFormat1(JIILjava/nio/ByteBuffer;)I+0
j  jogamp.nativewindow.windows.GDI.DescribePixelFormat(JIILjogamp/nativewindow/windows/PIXELFORMATDESCRIPTOR;)I+17
j  jogamp.opengl.windows.wgl.WGLUtil.DescribePixelFormat(JIILjogamp/nativewindow/windows/PIXELFORMATDESCRIPTOR;)I+20

This implies our native call to 'DescribePixelFormat(..)'
lands in the ATI driver of the atio6axx.dll.

Hence the system has selected to load the ATI GPU driver implementation 
when we loaded the 'hook' OpenGL32.dll. 

Then I searched for 'GDI DescribePixelFormat atio6axx crash'
and got the following:

2023-05-25 [SOLVED] EXCEPTION_ACCESS_VIOLATION crash (atio6axx.dll)


2023-05-29: I managed to fix the issue. For future users: I just downgraded my integrated GPU's drivers by installing the AMD Adrenalin software version 22.5.1 (you can find it by just googling it), which apparently has a different version of the atio6axx driver.

2023-08-24: Afaik the members on my Discord fixed the issue by updating their AMD drivers with the Adrenalin software.


So they still all use JogAmp huh? Nice!
New customers? How to reach vendor, ask for funding and offer support contracts? 
Yeah ;-)

Shall we consider this resolved then?
Comment 22 Mathieu Féry (MathiusD) 2024-01-05 09:49:02 CET
(In reply to Sven Gothel from comment #20)
Yes indeed, I had put 2.5.0 for this reason I had not paid attention, I will put tbd next time ^^'

(In reply to Sven Gothel from comment #21)
Thanks a lot!

I had already skimmed this forum post but I didn't know if it was related since the Java version of Minecraft is based on lwjgl (And not on jogamp :c)

I asked our user to update his drivers following what is told in the post so I hope that will solve the problem. (But I say hope because what is quoted in the forum post is related to the Adrenalin driver, however our user's presumed graphics card depends on the Catalyst driver [Cf here: https://www.amd.com/en/support/graphics/amd-radeon-hd/ati-radeon-hd-5000-series/ati-radeon-hd-5450 win7-64bits section])

Anyway, the bug seems to be completely independent of jogamp and seems to be on ATI's side only, so I think we can consider it solved!
Comment 23 Sven Gothel 2024-01-05 12:08:37 CET
(In reply to Mathieu Féry (MathiusD) from comment #22)
Let's wait for the reply of yours.

Yes, its is driver related.
For some reason it refuses to process the dummy-window's 
HDC using DescribePixelFormat(..) within our probing-thread.

(MC w/ lwjgl surely does something similar)

One could dive deeper into the cause why special older versions
may not work .. but if an updated driver works why bothering and 
spending too much money on it huh? :)
Comment 24 Sven Gothel 2024-01-05 12:13:08 CET
(In reply to Sven Gothel from comment #23)
.. therefor, please report the used ATI driver in detail
and whether an older or newer ATI driver fixes the issue.

A workaround on our behalf is possible of course.
If you like me to tackle that, let's move it offline via email
as I would need you to send me the machine and so forth.
Comment 25 Julien Gouesse 2024-01-05 12:38:42 CET
(In reply to Sven Gothel from comment #24)
Yes it's possible, we can detect the faulty versions and use GL_RENDERER etc. Then, we have to create a new renderer quirk to work around this problem if possible, it requires to debug the source code in C and to find an acceptable value that doesn't cause a crash. It would require a very similar hardware with the same version of Catalyst. Good luck, it usually takes me several weeks to do that :(
Comment 26 Mathieu Féry (MathiusD) 2024-01-05 14:00:30 CET
(In reply to Sven Gothel from comment #23)
Yes, if a more recent driver works, I think it will be easier (especially as I doubt that many users will stick with this particular version, given the age of the model, driver and os).

(In reply to Sven Gothel from comment #24)
(In reply to Julien Gouesse from comment #25)
For the workaround, this may be interesting, but I can't borrow our user's PC :x
So I've ask for the results of the following software exports: dxdiag and msinfo32 (To get the ATI driver version and model). I confess I don't know if other exports would be interesting on a win7 in our case :x
Comment 27 Sven Gothel 2024-01-15 18:31:29 CET
(In reply to Mathieu Féry (MathiusD) from comment #26)
.. any updates? I may close this issue otherwise.
Comment 28 Mathieu Féry (MathiusD) 2024-01-16 10:12:29 CET
(In reply to Sven Gothel from comment #27)
Hi, I have news from our user yesterday, sorry for the delay :c

Here are the results of the tests with the user:
 * The test with the WGL functions also causes an EXCEPTION_ACCESS_VIOLATION, but I have the impression that the option is not considered...
 * We were able to update the drivers but that didn't change the error :x

I'm attaching the test results and system information

She does have an AIT Radeon HD 5450 with Catalyst drivers. Her drivers have version 8.712.1.0 but the update doesn't seem to have had any impact on her driver versions.
Comment 29 Mathieu Féry (MathiusD) 2024-01-16 10:14:44 CET
Created attachment 879 [details]

DxDiag diagnosis before update of Catalyst drivers
Comment 30 Mathieu Féry (MathiusD) 2024-01-16 10:16:49 CET
Created attachment 880 [details]

DxDiag diagnosis after update of Catalyst drivers
Comment 31 Mathieu Féry (MathiusD) 2024-01-16 10:25:56 CET
Created attachment 881 [details]
Comment 32 Mathieu Féry (MathiusD) 2024-01-16 10:30:31 CET
Created attachment 882 [details]
Comment 33 Mathieu Féry (MathiusD) 2024-01-16 10:32:18 CET
Created attachment 883 [details]
Comment 34 Mathieu Féry (MathiusD) 2024-01-16 10:32:41 CET
Created attachment 884 [details]
Comment 35 Mathieu Féry (MathiusD) 2024-01-16 10:33:03 CET
Created attachment 885 [details]
Comment 36 Mathieu Féry (MathiusD) 2024-01-16 10:33:32 CET
Created attachment 886 [details]