Seg fault on Linux, current master

Hi, I have a project running on macOS and 0.9.8. I want to have it working under linux, unfortunately, I did not get qtCreator running with 0.9.8, so this morning I have cloned master and I’m trying to port the app, but it crashes with a segmantion fault. This is a screenshot of the debug mode in qt. If I close the message in order to acces the menu, I can not go back and forth with the navigation menu of the debugger, all the mouse events are blocked, also in other applications.
I’m also new to qT and I do not know the interface very well. Does anyone have some tips about how to get out from this error?

To reproduce the crash, it is enough to create a new project and call ofDrawAxis(20) in the draw method

Do you run qtcreator in fullscreen mode? that was crashing it for me…

No. Normal mode, no fullscreen

are you running linux on a virtual machine?

No, I’m not on a virtual machine.

If I run an empty project, without drawing, I do not have any crash.

Did you install the nvidia drivers?

No, I did not want to try to have a black screen while fixing this :wink:

Anyway, I have compiled the projectGenerator through the script (because coping the app from the version 0.9.8 was not working), and I have compiled all the examples. I’ve tried to run one of the graphical ones, and it worked.
This means that it is a problem with qt, and not with OF. @hamoid, @arturo, which version of QT are you using? Is there something that I should take care during the installation except from what it is already described here ?

I’m using
Qt Creator 4.4.1
Based on Qt 5.9.3 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

And this is my “configure project” page

I’m using QtCreator 4.5.0, Based on Qt 5.10.0 (GCC 7.2.1 20171128, 64 bit)

In Options > Build & Run > Kits I have clang for both C and C++ compilers, Debugger: LLDB
Analyzer > clang 5.0.0 (even if it says unsupported), 4 processes.

What’s the current status? Examples with graphics work, but your project crashes with a seg fault?

In Options > Environment > Interface you can set Flat Dark theme if you like.
I use astyle (which needs to be installed separately) as Beautifier to format the code with Ctrl+T, with this custom style:


Did you have to install clang manually to get qtCreator and OF working?
This is my “Build and Run-> Kits” tab,

And this is “Build and Run-> compilers” tab, as you see Clang it is not in the list

If I remember right, I had to install clang and lldb. I think that with gcc I didn’t get auto complete, and not sure if it was compiling.

gcc should work fine, it’s actually much more tested than clang on linux. autocomplete has nothing to do with this, only witg the code model which can be clang even if using gcc as compiler

I’d say it might be related with not having the drivers installed. some functions might be calling some unsupported gl call.

are you in ubuntu? if so installing the drivers 8s pretty straight forward just go to software &updates and there in additional drivers check if you have the nvidia proprietary drivers installed

But, if it was something related to the nvidia drivers, why is it working when I compile an example with make and make run?

And yes, I’m using the last Ubuntu LTS

are you compiling the same examples with qt creator and make? as i said it might be that certain OF calls are doing gl calls that are not supported with the opensource hardware. if you are in ubuntu the nvidea drivers are usually installed by default but worth at least checking

I’ve updated the driver, as suggested, now I’m using the NVIDIA ones.
If I open the polygonExample project and I run it in qt I receive this error message

Starting /media/data/Sources/OF/my-current-master/examples/graphics/polygonExample/bin/polygonExample_debug...
[ error ] ofAppGLFWWindow: 65543: GLX: Failed to create context: GLXBadFBConfig
[ error ] ofAppGLFWWindow: couldn't create GLFW window
polygonExample_debug: /build/glfw3-KYdbSD/glfw3-3.2.1/src/window.c:412: glfwWindowShouldClose: Assertion `window != NULL' failed.
polygonExample_debug: /build/glfw3-KYdbSD/glfw3-3.2.1/src/window.c:421: glfwSetWindowShouldClose: Assertion `window != NULL' failed.
The program has unexpectedly finished.
The process was ended forcefully.
/media/data/Sources/OF/my-current-master/examples/graphics/polygonExample/bin/polygonExample_debug crashed.

If I compile the same project with make and make run I get this message:

checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libcurl glfw3 rtaudio libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 
[ error ] ofAppGLFWWindow: 65543: GLX: Failed to create context: GLXBadFBConfig
[ error ] ofAppGLFWWindow: couldn't create GLFW window
polygonExample: /build/glfw3-KYdbSD/glfw3-3.2.1/src/window.c:412: glfwWindowShouldClose: Assertion `window != NULL' failed.
polygonExample: /build/glfw3-KYdbSD/glfw3-3.2.1/src/window.c:421: glfwSetWindowShouldClose: Assertion `window != NULL' failed.
Aborted (core dumped)
/media/data/Sources/OF/my-current-master/libs/openFrameworksCompiled/project/makefileCommon/ recipe for target 'run' failed
make: *** [run] Error 134

At least now it crashes consistenly :wink:

It looks like OF can not create a GL context. Any suggestion?

that’s really strange, have you restarted after installing the driver?

No, I did not restarted it.
But after restarting it, it works! :fireworks: