Fresh install : Segfault with examples

0 fly@Minotoor ~/workspace/openFrameworks/examples/graphics/polygonExample $ uname -a
Linux Minotoor 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64 GNU/Linux

0 fly@Minotoor ~/workspace/openFrameworks/examples/graphics/polygonExample $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --disable-multilib --disable-werror --enable-checking=release
Thread model: posix
gcc version 6.2.1 20160830 (GCC) 

0 fly@Minotoor ~/workspace/openFrameworks/examples/graphics/polygonExample $ make
HOST_OS=Linux
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 rtaudio gl glu glew gtk+-3.0 libmpg123 
Compiling OF library for Release
make[1]: Entering directory '/home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/project'
HOST_OS=Linux
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 rtaudio gl glu glew gtk+-3.0 libmpg123 
HOST_OS=Linux
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 rtaudio gl glu glew gtk+-3.0 libmpg123 
HOST_OS=Linux
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 rtaudio gl glu glew gtk+-3.0 libmpg123 
Done!
make[1]: Leaving directory '/home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/project'


Compiling polygonExample for Release
make[1]: Entering directory '/home/fly/workspace/openFrameworks/examples/graphics/polygonExample'
HOST_OS=Linux
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 rtaudio gl glu glew gtk+-3.0 libmpg123 
make[2]: Entering directory '/home/fly/workspace/openFrameworks/examples/graphics/polygonExample'
HOST_OS=Linux
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 rtaudio gl glu glew gtk+-3.0 libmpg123 

     compiling done
     to launch the application

     cd bin
     ./polygonExample
     
     - or -
     
     make RunRelease


make[2]: Leaving directory '/home/fly/workspace/openFrameworks/examples/graphics/polygonExample'
make[1]: Leaving directory '/home/fly/workspace/openFrameworks/examples/graphics/polygonExample'

0 fly@Minotoor ~/workspace/openFrameworks/examples/graphics/polygonExample $ gdb ./bin/polygonExample 
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bin/polygonExample...done.
(gdb) run
Starting program: /home/fly/workspace/openFrameworks/examples/graphics/polygonExample/bin/polygonExample 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00000000005c2d92 in updateKeyCodeLUT ()
(gdb) bt
#0  0x00000000005c2d92 in updateKeyCodeLUT ()
#1  0x00000000005c3c66 in initExtensions ()
#2  0x00000000005c43a3 in _glfwPlatformInit ()
#3  0x00000000005bdee5 in glfwInit ()
#4  0x000000000047d273 in ofAppGLFWWindow::setup(ofGLFWWindowSettings const&)
    ()
#5  0x000000000047e39e in ofAppGLFWWindow::setup(ofGLWindowSettings const&) ()
#6  0x000000000048591e in ofMainLoop::createWindow(ofWindowSettings const&) ()
#7  0x00000000004725ff in ofSetupOpenGL(int, int, ofWindowMode) ()
#8  0x0000000000418275 in main ()

what graphics card do you have?

$ glxinfo|egrep "OpenGL vendor|OpenGL renderer"
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile

what linux distro and window manager are you using? also are you using openFrameworks from github or the download from the web?

there was some bug in glfw that makes it crash with certain window managers, it’s solved in latest version of glfw but perhaps your distribution doesn’t include the latest version or if you are using OF from the downloads it’s still using a relatively old version that we included with the download.

if that seems to be the problem then uninstalling glfw from the system (if you are using OF from git or nightlies) or deleting it from the libs folder (if you are using the download) and recompiling and installing the latest version should solve the problem

I’m using arch linux and doesn’t seems to have glfw installed. I used the download (from website) version, and already tried to update my system then delete lib and recompile. I will try the github version.

if you are using the download version with arch linux probably deleting libs/glfw and installing glfw in the system can fix it (if it’s the error i was talking about) since arch linux usually has pretty up to date libraries.

what window manager are you using?

I’m using gnome. I installed glfw-x11 and recompiled from the web version and i have the same error …

have you deleted libs/glfw from the web download?

i forgot…
But now it shows an error at compilation time. And yes glfw-x11 is installed. :confused:

0 fly@Minotoor ~/workspace/openFrameworks/scripts/linux $ ./compileOF.sh 
logname: no login name
HOST_OS=Linux
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 glfw3 rtaudio gl glu glew gtk+-3.0 libmpg123 
HOST_OS=Linux

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 glfw3 rtaudio gl glu glew gtk+-3.0 libmpg123 
Compiling /home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.cpp
g++ -g3  -Wall -std=c++14 -DGCC_HAS_REGEX -DOF_USING_GTK -DOF_USING_GTK -DOF_USING_MPG123 -pthread -D_FORTIFY_SOURCE=2 -D__UNIX_JACK__ -D__LINUX_ALSA__ -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/AL -I/usr/include/rtaudio -I/usr/include/alsa -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/home/fly/workspace/openFrameworks/libs/fmodex/include -I/home/fly/workspace/openFrameworks/libs/kiss/include -I/home/fly/workspace/openFrameworks/libs/poco/include -I/home/fly/workspace/openFrameworks/libs/tess2/include -I/home/fly/workspace/openFrameworks/libs/utf8cpp/include -I/home/fly/workspace/openFrameworks/libs/utf8cpp/include/utf8 -I/home/fly/workspace/openFrameworks/libs/openFrameworks -I/home/fly/workspace/openFrameworks/libs/openFrameworks/utils -I/home/fly/workspace/openFrameworks/libs/openFrameworks/app -I/home/fly/workspace/openFrameworks/libs/openFrameworks/3d -I/home/fly/workspace/openFrameworks/libs/openFrameworks/types -I/home/fly/workspace/openFrameworks/libs/openFrameworks/video -I/home/fly/workspace/openFrameworks/libs/openFrameworks/gl -I/home/fly/workspace/openFrameworks/libs/openFrameworks/math -I/home/fly/workspace/openFrameworks/libs/openFrameworks/graphics -I/home/fly/workspace/openFrameworks/libs/openFrameworks/communication -I/home/fly/workspace/openFrameworks/libs/openFrameworks/events -I/home/fly/workspace/openFrameworks/libs/openFrameworks/sound -DDEBUG  -MMD -MP -MF /home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/lib/linux64/obj/Debug/libs/openFrameworks/app/ofAppGLFWWindow.d -MT/home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/lib/linux64/obj/Debug/libs/openFrameworks/app/ofAppGLFWWindow.o -o /home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/lib/linux64/obj/Debug/libs/openFrameworks/app/ofAppGLFWWindow.o -c /home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.cpp
In file included from /usr/include/stdint.h:25:0,
                 from /usr/lib/gcc/x86_64-pc-linux-gnu/6.2.1/include/stdint.h:9,
                 from /home/fly/workspace/openFrameworks/libs/openFrameworks/utils/ofConstants.h:2,
                 from /home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.h:3,
                 from /home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.cpp:1:
/usr/include/features.h:331:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^~~~~~~
/home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.cpp: In member function 'void ofAppGLFWWindow::setup(const ofGLFWWindowSettings&)':
/home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.cpp:301:41: error: invalid conversion from 'void (*)(GLFWwindow*, int, int, unsigned int, int, int)' to 'GLFWkeyfun {aka void (*)(GLFWwindow*, int, int, int, int)}' [-fpermissive]
  glfwSetKeyCallback(windowP, keyboard_cb);
                                         ^
In file included from /home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.h:6:0,
                 from /home/fly/workspace/openFrameworks/libs/openFrameworks/app/ofAppGLFWWindow.cpp:1:
/usr/include/GLFW/glfw3.h:3307:20: note:   initializing argument 2 of 'void (* glfwSetKeyCallback(GLFWwindow*, GLFWkeyfun))(GLFWwindow*, int, int, int, int)'
 GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
                    ^~~~~~~~~~~~~~~~~~
make[1]: *** [makefileCommon/compile.core.mk:241: /home/fly/workspace/openFrameworks/libs/openFrameworksCompiled/lib/linux64/obj/Debug/libs/openFrameworks/app/ofAppGLFWWindow.o] Error 1
make: *** [makefileCommon/compile.core.mk:213: Debug] Error 2
there has been a problem compiling Debug OF library
please report this problem in the forums

i thought it would just work but it seems it might need some additions. can you try with the nightly build from the download page instead?

It works :slight_smile: thanks !