Bug 1189196 - OpenGL: libglfw3 crashes on glewInit(), same code works with libglfw3-wayland
Summary: OpenGL: libglfw3 crashes on glewInit(), same code works with libglfw3-wayland
Status: RESOLVED DUPLICATE of bug 1189524
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Development (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Ferdinand Thiessen
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-09 07:16 UTC by Matthias Jungmann
Modified: 2021-08-29 15:01 UTC (History)
2 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Jungmann 2021-08-09 07:16:35 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0
Build Identifier: 

Hi,

I'm started a project on OpenGl after a long time on openSUSE Tumbleweed. Calling glewInit() throws the error message

"glewInit failed: Missing GL version"

Searched a lot on stackoverflow etc but no working solutions found.

The same program runs on Ubuntu 20.04 without any problem. All other programs using OpenGl (steam, CUDA, ...) are working without any problems.

A simple test program and compiling parameter can be found in this issue in RedHat Bugzilla:

https://bugzilla.redhat.com/show_bug.cgi?id=1895018

Posted this issue on Reddit:
https://www.reddit.com/r/openSUSE/comments/p0mca1/opengl_glewinit_throws_error_tumbleweed_problem/

Due to the answer, I changed to a Plasma-Wayland session, removed "libglfw3" and installed "libglfw3-wayland" and the application worked.

I tested it also on a second computer and the result was the same. So I assume X and libglfw3 are not working together anymore, but Wayland and libglfw3-wayland does.


Reproducible: Always

Steps to Reproduce:
1. In X-Session: Install glfw3 and glew
2. Get OpenGl test code from https://bugzilla.redhat.com/show_bug.cgi?id=1895018
3. Compile and start. Results in crash and error message "glewInit failed: Missing GL version" 
4. Deinstall glfw3 and install glfw3-wayland
5. Switch to wayland session
6. Applicarion runs fine
Actual Results:  
OpenGl application crashes and get error message "glewInit failed: Missing GL version" 

Expected Results:  
OpenGl application should start.
Comment 1 Chenzi Cao 2021-08-13 09:54:54 UTC
Hi Ferdinand, would you please help to take a look at this issue? I'm really not sure whether it is right to assign it to you, please feel free to reassign whenever necessary, thanks.
Comment 2 Matthias Jungmann 2021-08-14 11:35:27 UTC
I compiled libglfw3 on my own and got still the same error.
So maybe the problem is more related to glwf3 itself.
Comment 3 Matthias Jungmann 2021-08-14 20:40:13 UTC
Ok, I did some more investigations:

With the (offical) glfw3 examples code I changed my test code and managed it to compile and run. Therefore, libglfw3 seems to work. But this does not explain why I have to change my test code for X11, but I don't have to change it for wayland. 

Seems to be that the libraries libglfw3 and libglfw3-wayland are different versions of the glfw API.
Comment 4 Peter Sütterlin 2021-08-29 13:32:34 UTC
Having the same issue here, both with a self-written application and the game supertuxkart.  Both abort with

Error: Missing GL version

** (gui:23595): ERROR **: 13:35:13.075: 
unhandled exception (type std::exception) in signal handler:
what: Could not initialize GLEW

I noticed that the changelog of libGLEW mentions it was switched to use EGL end July.  And indeed, if I just downgrade libGLEW2 to a version before that change (I got libGLEW2_2-2.2.0-1.14.x86_64.rpm from the Tumbleweed History download area), both programs run again (The rest of the system is Tumbleweed 20210820).
Comment 5 Ferdinand Thiessen 2021-08-29 14:57:50 UTC
Sorry fore late response, but I can not reproduce it.

Compiling the linked source code using:
`g++ test.cpp -lglfw -lGLEW -lGL`

succeed and even running the program in a X11 session does work without issues.

Setup:
libGLEW2_2 = 2.2.0-3.1
libglfw3 = 3.3.4-1.4
Comment 6 Ferdinand Thiessen 2021-08-29 15:01:35 UTC
After more investigation, it seems like this was a result of #1189524
So the real issue is that GLEW does not properly support EGL.

*** This bug has been marked as a duplicate of bug 1189524 ***