Closed danomatika closed 3 years ago
@hamoid Does it crash if there are "no scripts" run? ie. comment out doScript()
in ofApp::setup()
Hi! It does still crash. One by one I removed all lines the lines that have something to do with lua and it still crashes. Then I realized it crashes inside ofSetupOpenGL(1024, 768, OF_WINDOW);
as soon as the addon is included in the qbs file (QtCreator):
of.addons: [ 'ofxLua' ]
If I remove the addon then it runs. Is the addon maybe redefining something that breaks glm?
Hi, Having the same issue on OSX (10.15.6) w/ OF 0.11.0.
#0 0x00000001001c01af in glm::detail::compute_vec4_mul<float, (glm::qualifier)0, false>::call(glm::vec<4, float, (glm::qualifier)0> const&, glm::vec<4, float, (glm::qualifier)0> const&) at /of_v0.11.0_osx_release/libs/glm/include/glm/detail/type_vec4.inl:31
#1 0x00000001003b8227 in glm::vec<4, float, (glm::qualifier)0>& glm::vec<4, float, (glm::qualifier)0>::operator*=<float>(glm::vec<4, float, (glm::qualifier)0> const&) at /of_v0.11.0_osx_release/libs/glm/include/glm/detail/type_vec4.inl:597
#2 0x00000001003b81d0 in glm::vec<4, float, (glm::qualifier)0> glm::operator*<float, (glm::qualifier)0>(glm::vec<4, float, (glm::qualifier)0> const&, glm::vec<4, float, (glm::qualifier)0> const&) at /of_v0.11.0_osx_release/libs/glm/include/glm/detail/type_vec4.inl:890
#3 0x00000001003ba196 in glm::detail::compute_inverse<4, 4, float, (glm::qualifier)0, false>::call(glm::mat<4, 4, float, (glm::qualifier)0> const&) at /of_v0.11.0_osx_release/libs/glm/include/glm/detail/func_matrix.inl:334
#4 0x000000010092488d in glm::mat<4, 4, float, (glm::qualifier)0> glm::inverse<4, 4, float, (glm::qualifier)0>(glm::mat<4, 4, float, (glm::qualifier)0> const&) [inlined] at /of_v0.11.0_osx_release/libs/glm/include/glm/detail/func_matrix.inl:391
#5 0x0000000100924888 in ofMatrixStack::loadViewMatrix(glm::mat<4, 4, float, (glm::qualifier)0> const&) at /of_v0.11.0_osx_release/libs/openFrameworks/utils/ofMatrixStack.cpp:423
#6 0x00000001008e31de in ofGLRenderer::loadViewMatrix(glm::mat<4, 4, float, (glm::qualifier)0> const&) at /of_v0.11.0_osx_release/libs/openFrameworks/gl/ofGLRenderer.cpp:996
#7 0x00000001008e2961 in ofGLRenderer::setupScreenPerspective(float, float, float, float, float) at /of_v0.11.0_osx_release/libs/openFrameworks/gl/ofGLRenderer.cpp:770
#8 0x000000010091c9a3 in ofAppGLFWWindow::setup(ofGLFWWindowSettings const&) at /of_v0.11.0_osx_release/libs/openFrameworks/app/ofAppGLFWWindow.cpp:365
#9 0x000000010091bec6 in ofAppGLFWWindow::setup(ofGLWindowSettings const&) at /of_v0.11.0_osx_release/libs/openFrameworks/app/ofAppGLFWWindow.cpp:149
#10 0x000000010089acf4 in ofMainLoop::createWindow(ofWindowSettings const&) at /of_v0.11.0_osx_release/libs/openFrameworks/app/ofMainLoop.cpp:69
#11 0x0000000100844e6b in ofCreateWindow(ofWindowSettings const&) [inlined] at /of_v0.11.0_osx_release/libs/openFrameworks/app/ofAppRunner.cpp:222
#12 0x0000000100844e51 in ofSetupOpenGL(int, int, ofWindowMode) at /of_v0.11.0_osx_release/libs/openFrameworks/app/ofAppRunner.cpp:217
#13 0x0000000100001d89 in main at /of_v0.11.0_osx_release/addons/ofxLua/luaExample/src/main.cpp:15
So it also crashes at the vec4 multiplier...
Ah, compiling without XCode (11.6), and just using make works...
@jivido Sometimes I see that in Xcode and simply re-run the build a couple times, then it will build ok. It's weird, I know... all that C++ templating black magic. Scratch that, you're referring to a run time crash as opposed to compile error?
Ah, building in Release mode also works! However, rebuilding the Debug version doesn't seem to work...
As a follow up, I see this all the time and simply test in release mode. Still not sure why the debug build is causing this.
@danomatika I don't know if this helps or just adds to the mystery, but on my machine (2013 era Macbook running High Sierra and Xcode 10) the problem goes away for the debug scheme if optimizations are turned on at level -O2 or higher.
This appears to be caused by the glm used by the bindings not initializing vector values in the empty constructors which leads to memory corruption. Setting the #define GLM_FORCE_CTOR_INIT
in the glm.i
SWIG interface appears to be the fix.
Now fixed with updated bindings in ofxLua 1.4.4.
Bringing this over from #57
Hi, I just tried to run luaExample on Arch Linux and it crashes silently. In the debugger I see this:
Any ideas?
Originally posted by @hamoid in https://github.com/danomatika/ofxLua/issues/57#issuecomment-576026419
I'm just running luaExample unmodified, I don't know which script it is running. It's my first attempt at ofxLua. This is the output:
So it compiles fine and closes immediately. Can I help figure it out?
update: based on this
it is running graphicsExample.lua. Changing
currentScript
to 1, 2 or 3 also crash.Originally posted by @hamoid