cinder / Cinder

Cinder is a community-developed, free and open source library for professional-quality creative coding in C++.
http://libcinder.org
Other
5.34k stars 943 forks source link

Build on Ubuntu 15 Fails - SEGFAULT on strchr.S #1450

Open sgpinkus opened 8 years ago

sgpinkus commented 8 years ago

I know that Cinder does not officially support Linux, but there are instructions available on this github. Builds fine but the segfaults:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
32  ../sysdeps/x86_64/multiarch/../strchr.S: No such file or directory.
[Current thread is 1 (Thread 0x7f795e16b780 (LWP 4354))]
(gdb) backtrace
#0  __strchr_sse2 () at ../sysdeps/x86_64/multiarch/../strchr.S:32
#1  0x0000000000905966 in ParseVersionFromString (pOutMajor=0xd42268 <g_majorVersion>, pOutMinor=0xd4226c <g_minorVersion>, strVersion=0x0)
    at /root/Cinder/src/glload/gl_load.c:12000
#2  0x0000000000905cea in InternalLoad () at /root/Cinder/src/glload/gl_load.c:12092
#3  0x0000000000905e73 in ogl_LoadFunctions () at /root/Cinder/src/glload/gl_load.c:12151
#4  0x000000000077d3b1 in cinder::gl::EnvironmentCore::initializeFunctionPointers (this=0x163f0e0) at /root/Cinder/src/cinder/gl/EnvironmentCore.cpp:74
#5  0x000000000091eaaf in cinder::app::RendererGlLinux::initialize (this=0x1646860, window=0x0, sharedRenderer=std::shared_ptr (empty) 0x0)
    at /root/Cinder/src/cinder/app/linux/RendererGlLinuxGlfw.cpp:54
#6  0x0000000000737110 in cinder::app::RendererGl::setup (this=0x1646aa0, nativeWindow=0x0, sharedRenderer=std::shared_ptr (empty) 0x0)
    at /root/Cinder/src/cinder/app/RendererGl.cpp:430
#7  0x000000000091f6c8 in cinder::app::WindowImplLinux::WindowImplLinux (this=0x1646b30, format=...,
    sharedRenderer=std::shared_ptr (count 23357680, weak -1) 0x7ffc822f86f0, appImpl=0x1621e30)
    at /root/Cinder/src/cinder/app/linux/WindowImplLinuxGlfw.cpp:75
#8  0x0000000000919a6f in cinder::app::AppImplLinux::createWindow (this=0x1621e30, format=...)
    at /root/Cinder/src/cinder/app/linux/AppImplLinuxGlfw.cpp:350
#9  0x0000000000919129 in cinder::app::AppImplLinux::AppImplLinux (this=0x1621e30, aApp=0x1621f40, settings=...)
    at /root/Cinder/src/cinder/app/linux/AppImplLinuxGlfw.cpp:239
#10 0x00000000007278a8 in cinder::app::AppLinux::AppLinux (this=0x1621f40) at /root/Cinder/src/cinder/app/linux/AppLinux.cpp:37
#11 0x0000000000725f40 in BasicApp::BasicApp (this=0x1621f40) at /root/Cinder/samples/BasicApp/src/BasicApp.cpp:9
#12 0x000000000072603d in cinder::app::AppLinux::main<BasicApp>(std::shared_ptr<cinder::app::Renderer> const&, char const*, int, char* const*, std::function<void (cinder::app::AppBase::Settings*)> const&) (defaultRenderer=std::shared_ptr (count 3, weak 0) 0x1620e20, title=0xa069e7 "BasicApp", argc=1,
    argv=0x7ffc822f8c28, settingsFn=...) at /root/Cinder/include/cinder/app/linux/AppLinux.h:84
#13 0x0000000000725026 in main (argc=1, argv=0x7ffc822f8c28) at /root/Cinder/samples/BasicApp/src/BasicApp.cpp:84

strchr.S ... need to have linux source available?

Also I have to suspect this issue has been raised before but I could not find it so apologies if duplicating.

PetrosKataras commented 8 years ago

Hey, the problem seems to be with your GL setup. There are various things that look a bit weird with this backtrace like the window pointers being NULL for example. Another one is that I see you are building Cinder under root which I wouldn't consider as the best option in general for various reasons. Is there a rationale behind this decision and not running as a normal user ?? The reason that it segfaults is because the strVersion pointer on the first stack frame is NULL which means that glload for some reason blows up in your system..

A bit more background on your setup ( GL configuration, graphics card and drivers version, output of glxinfo ) together with the output of CMake during configuration of both Cinder and the sample app would probably give more hints about the root of the problem.

sgpinkus commented 8 years ago

Hi Thanks for the feedback. The reason for the root is basically I'm lazy. I don't have bare metal to put Ubuntu15 on and my my native OS (Debian7) is missing some of the deps. Didn't bother creating a new user account since VM is more or less throw away for testing.

I'm still trying to get it to work but decided to shift my efforts to trying to learn how to program in VS (ARGH!) as it's a bit pressing. I will comment back if I figure it out.

chaoticbob commented 8 years ago

If you're trying to run on a VM, only VMWare is known to work with Cinder. VirtualBox curently doesn't support the necessary OpenGL profile or Cinder. You can find a full set of instructions on how to get going with VMWare here: https://github.com/chaoticbob/Cinder/wiki/Cinder-for-Linux-on-VMWare

sgpinkus commented 8 years ago

Just to note, I tried to build on a bare metal Debian 8 (close enough to Ubuntu 15) and got exactly the same error. Will have to try Ubuntu 15 to be sure I guess.

sam@acerbox:~/cinder/Cinder/samples/BasicApp/linux$ uname -a Linux acerbox 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux sam@acerbox:~/cinder/Cinder/samples/BasicApp/linux$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.1 (jessie) Release: 8.1 Codename: jessie

chaoticbob commented 8 years ago

It sounds like what @PetrosKataras mentioned: the OpenGL driver isn't setup to handle core profile. Can you post the results of this (case sensitive):

glxinfo | grep OpenGL
sgpinkus commented 8 years ago

$ glxinfo | grep OpenGL libGL error: failed to authenticate magic 9 libGL error: failed to load driver: i965 OpenGL vendor string: VMware, Inc. OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 128 bits) OpenGL version string: 3.0 Mesa 10.3.2 OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions:

I also get that "libGL error: failed to load driver: i965" when I run a basic Open GL example application, but the application still runs.