openFrameworks-RaspberryPi / openFrameworks

This repo has migrated into the openFramworks core! Please go to http://github.com/openFrameworks/openFrameworks for the latest!
http://github.com/openFrameworks/openFrameworks
Other
104 stars 11 forks source link

alphaMaskingShaderExample : segmentation fault #76

Closed bakercp closed 11 years ago

bakercp commented 11 years ago

For some reason, we are getting a segmentation fault on load. I believe it may have something to do with the size of the ofFBO (or not).

kalwalt commented 11 years ago

@bakercp i have the same issue also with PandaboardES

jvcleave commented 11 years ago

I get this:

Program received signal SIGSEGV, Segmentation fault. 0x000879f8 in ofRectangle::ofRectangle(float, float, float, float) ()

jvcleave commented 11 years ago

commenting out this line https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/examples/gl/alphaMaskingShaderExample/src/testApp.cpp#L17

allows it to run but I then get [error] Failed creating shader of type GL_FRAGMENT_SHADER [error] Trying to link GLSL program, but no shaders created yet

kalwalt commented 11 years ago

@jvcleave good to know! maybe GLES doesn't support GL_ARB_texture_rectangle?

kalwalt commented 11 years ago

commenting out ofSetWindowShape(width, height); but i receive another siggbart: Program received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? ()

jvcleave commented 11 years ago

my guess is that the shader isn't GLES compatible - not sure if that would cause a crash though (doesn't on the pi)

kalwalt commented 11 years ago

converting the shader to non rectangular tex give me the same seg fault. This happen on PandaboardES.

jvcleave commented 11 years ago

@kalwalt can you post your conversion? I started to do it but I am GLSL incompatible :)

kalwalt commented 11 years ago

yes of course, here it is:

string shaderProgram = " \n \ \ uniform sampler2D tex0;\ uniform sampler2D maskTex;\ \ void main (void){\ vec2 pos = gl_TexCoord[0].st;\ \ vec3 src = texture2D(tex0, pos).rgb;\ float mask = texture2D(maskTex, pos).r;\ \ gl_FragColor = vec4( src , mask);\ }"; if the shader will compile than the app won't works but at least we know that the problem reside in the shader.

@jvcleave let me know if in raspberrypi works

jvcleave commented 11 years ago

I get that it compiled but failed to link - I think there may be more incompatibilities as the noise.frag and noise.vert from the shaderExamples compile and link

jvcleave commented 11 years ago

@kalwalt can you try this one - it is working on the RPI for me http://www.jvcref.com/files/PI/tests/alphaMaskingShaderExampleGLES2.zip

kalwalt commented 11 years ago

@jvcleave i will try it!

kalwalt commented 11 years ago

@jvcleave this not works for me on the PandaboardES look at my console ,running gdb:

walter@walter-desktop:~/OF-develop-raspberrypi/openFrameworks/examples/gles/alphaMaskingShaderExampleGLES2/bin$ gdb ./alphaMaskingShaderExampleGLES2.app GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 Copyright (C) 2012 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 "arm-linux-gnueabihf". For bug reporting instructions, please see: http://bugs.launchpad.net/gdb-linaro/... Reading symbols from /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gles/alphaMaskingShaderExampleGLES2/bin/alphaMaskingShaderExampleGLES2.app...done. (gdb) r Starting program: /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gles/alphaMaskingShaderExampleGLES2/bin/alphaMaskingShaderExampleGLES2.app [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [ofAppEGLWindow::setupEGL:notice] setting EGL Display PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c] PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c] [ofAppEGLWindow::setupEGL:notice] EGL Display correctly set. PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c] [ofAppEGLWindow::setupEGL:notice] ofGetCurrentRenderer()->getType()=GLES2 [ofAppEGLWindow::setupEGL:notice] GLES2 Renderer detected. [ofAppEGLWindow::setupEGL:notice] OpenGL ES version [notice] GLES2 loading vertex shader from default source [notice] GLES2 loading fragment shader from default source [ofAppEGLWindow::setupEGL:notice] -----EGL----- [ofAppEGLWindow::setupEGL:notice] EGL_VERSION_MAJOR = 1 [ofAppEGLWindow::setupEGL:notice] EGL_VERSION_MINOR = 4 [ofAppEGLWindow::setupEGL:notice] EGL_CLIENT_APIS = OpenGL_ES [ofAppEGLWindow::setupEGL:notice] EGL_VENDOR = Imagination Technologies [ofAppEGLWindow::setupEGL:notice] EGL_VERSION = 1.4 build 1.9@2166536 [ofAppEGLWindow::setupEGL:notice] EGL_EXTENSIONS = EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_KHR_fence_sync EGL_IMG_hibernate_process EGL_WL_bind_wayland_display EGL_KHR_surfaceless_gles2 EGL_NV_post_sub_buffer [ofAppEGLWindow::setupEGL:notice] GL_RENDERER = [ofAppEGLWindow::setupEGL:notice] GL_VERSION = [ofAppEGLWindow::setupEGL:notice] GL_VENDOR = [ofAppEGLWindow::setupEGL:notice] ------------- [ofAppEGLWindow::setupOpenGL:notice] CREATED SCREEN WITH SIZE 1280 x 720 [ofAppEGLWindow:error] Peripherals not supported on X11 [ofFbo:verbose] FBO supported terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted. __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47 47 ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: No such file or directory. (gdb)

not sure to have understood the output from gdb, but at least now with your GLES2 example the fbo is working partially , with the AlphaMaskingShaderExample i crash suddenly. Maybe it is a limitation on the size of the fbo?

kalwalt commented 11 years ago

Commenting out all the lines about shader even so i got a seg fault . i think that issue in PandaboardES reside in the fbo. More investigation is needed.

kalwalt commented 11 years ago

now i'm sure the problem is in allocating the fbo.: create an app with only a ofFbo fbo.allocate(400,400,GL_RGB); it crash allocating it.

bakercp commented 11 years ago

I was getting faults when using "large" FBOs (#41) on the RPi. It could handle up to 1280x720 easily though. Perhaps we need to figure out a test for maximum FBO size?

bakercp commented 11 years ago

related: http://stackoverflow.com/questions/6655943/maximum-opengl-framebuffer-object-size-limit

arturoc commented 11 years ago

there's a problem in the pandaboard where you need to change the order in which the gles libraries are linked in order to be able to use gles1 or 2 so if you want to use 2 you'll need to edit the makefile and change the order so the gles2 library appears first. i'll add a flag so this can be setup per project

On 12/23/2012 11:45 AM, Walter Perdan wrote:

@jvcleave https://github.com/jvcleave this not works for me on the PandaboardES look at my console ,running gdb:

walter@walter-desktop:~/OF-develop-raspberrypi/openFrameworks/examples/gles/alphaMaskingShaderExampleGLES2/bin$ gdb ./alphaMaskingShaderExampleGLES2.app GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 Copyright (C) 2012 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 "arm-linux-gnueabihf". For bug reporting instructions, please see: http://bugs.launchpad.net/gdb-linaro/... Reading symbols from /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gles/alphaMaskingShaderExampleGLES2/bin/alphaMaskingShaderExampleGLES2.app...done. (gdb) r Starting program: /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gles/alphaMaskingShaderExampleGLES2/bin/alphaMaskingShaderExampleGLES2.app

[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [ofAppEGLWindow::setupEGL:notice] setting EGL Display PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c] PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c] [ofAppEGLWindow::setupEGL:notice] EGL Display correctly set. PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c] [ofAppEGLWindow::setupEGL:notice] ofGetCurrentRenderer()->getType()=GLES2 [ofAppEGLWindow::setupEGL:notice] GLES2 Renderer detected. [ofAppEGLWindow::setupEGL:notice] OpenGL ES version [notice] GLES2 loading vertex shader from default source [notice] GLES2 loading fragment shader from default source [ofAppEGLWindow::setupEGL:notice] -----EGL----- [ofAppEGLWindow::setupEGL:notice] EGL_VERSION_MAJOR = 1 [ofAppEGLWindow::setupEGL:notice] EGL_VERSION_MINOR = 4 [ofAppEGLWindow::setupEGL:notice] EGL_CLIENT_APIS = OpenGL_ES [ofAppEGLWindow::setupEGL:notice] EGL_VENDOR = Imagination Technologies [ofAppEGLWindow::setupEGL:notice] EGL_VERSION = 1.4 build 1.9@2166536 https://github.com/1.9/openFrameworks/commit/2166536 [ofAppEGLWindow::setupEGL:notice] EGL_EXTENSIONS = EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_KHR_fence_sync EGL_IMG_hibernate_process EGL_WL_bind_wayland_display EGL_KHR_surfaceless_gles2 EGL_NV_post_sub_buffer [ofAppEGLWindow::setupEGL:notice] GL_RENDERER = [ofAppEGLWindow::setupEGL:notice] GL_VERSION = [ofAppEGLWindow::setupEGL:notice] GL_VENDOR = [ofAppEGLWindow::setupEGL:notice] ------------- [ofAppEGLWindow::setupOpenGL:notice] CREATED SCREEN WITH SIZE 1280 x 720 [ofAppEGLWindow:error] Peripherals not supported on X11 [ofFbo:verbose] FBO supported terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted. __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47 47 ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: No such file or directory. (gdb)

at least now with your GLES2 example the fbo is working partially , with the AlphaMaskingShaderExample i crash suddenly. Maybe it is alimitation on the size of the fbo?

— Reply to this email directly or view it on GitHub https://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/76#issuecomment-11644947.

kalwalt commented 11 years ago

thanks @arturoc , this make sense! so i can suppose that you tested successfully the ofFbo in the PandaBoard, right?

kalwalt commented 11 years ago

i did this in /openFrameworks/libs/openFrameworksCompiled/project/linuxarmv7l/config.linuxarmv7l.default.make:

PLATFORM_PKG_CONFIG_LIBRARIES += glesv1_cm

PLATFORM_PKG_CONFIG_LIBRARIES += glesv2 PLATFORM_PKG_CONFIG_LIBRARIES += glesv1_cm

but not solve the problem , maybe you are referring to another makefile.

bakercp commented 11 years ago

This should be fixed now with 68c817b6ee77cd6bd38482f64f2d0639c3f3b74e. Closing. If Pandaboard folks are still having problems, please reopen.

kalwalt commented 11 years ago

sorry @bakercp to re-open it, but i have still a issue... i'm using of course yours new changes in develop-raspberrypi. look:

gdb ./alphaMaskingShaderExample.app GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04 Copyright (C) 2012 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 "arm-linux-gnueabihf". For bug reporting instructions, please see: http://bugs.launchpad.net/gdb-linaro/... Reading symbols from /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gl/alphaMaskingShaderExample/bin/alphaMaskingShaderExample.app...done. (gdb) run Starting program: /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gl/alphaMaskingShaderExample/bin/alphaMaskingShaderExample.app [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [ofAppEGLWindow::getScreenSize:error] Tried to get display size, but failed. x11Screen is not inited. X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 1 (X_CreateWindow) Value in failed request: 0x0 Serial number of failed request: 8 Current serial number in output stream: 9 Inferior 1 (process 6627) exited with code 01

bakercp commented 11 years ago

Hi @kalwalt please try the latest. The issue was with x11 window creation in the latest (I couldn't test it so an obvious error snuck past) 9f85ffc44c3c7363c5a337ddad35f6a467184a68.

kalwalt commented 11 years ago

yet some issues @bakercp with framebuffer:

(gdb) run Starting program: /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gl/alphaMaskingShaderExample/bin/alphaMaskingShaderExample.app [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [ofAppEGLWindow::createSurface:notice] Setting up EGL Display PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c] PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c] [ofAppEGLWindow::createSurface:notice] EGL Display correctly set. PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c] [ofAppEGLWindow::createSurface:notice] ofGetCurrentRenderer()->getType()=GLES2 [ofAppEGLWindow::createSurface:notice] GLES2 Renderer detected. [ofAppEGLWindow::createSurface:error] Error creating context. EGL_BAD_CONFIG (Invald frame buffer configuration specified) [ofAppEGLWindow::setupPeripherals:notice] Peripherals not supported on X11 [ofAppEGLWindow::setupOpenGL:notice] Peripheral setup complete. [ofAppEGLWindow::runAppViaInfiniteLoop:notice] Entering infinite loop. terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted. __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47 47 ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: No such file or directory. (gdb)

bakercp commented 11 years ago

This may have something to do with the additional window settings I added in ofAppEGLWindow.cpp:

Here is the current version:

//-------------------------------------------------------------------------------------
ofAppEGLWindow::Settings::Settings() {
  eglWindowPreference = OF_APP_WINDOW_AUTO;
  eglWindowOpacity = 255;

  // these are usually set as default, but set them here just to be sure
  frameBufferAttributes[EGL_RED_SIZE]     = 8; // 8 bits for red
  frameBufferAttributes[EGL_GREEN_SIZE]   = 8; // 8 bits for green
  frameBufferAttributes[EGL_BLUE_SIZE]    = 8; // 8 bits for blue
  frameBufferAttributes[EGL_ALPHA_SIZE]   = 8; // 8 bits for alpha
  frameBufferAttributes[EGL_LUMINANCE_SIZE] = EGL_DONT_CARE; // 8 bits for alpha
  frameBufferAttributes[EGL_DEPTH_SIZE]   = 24; // 24 bits for depth
  frameBufferAttributes[EGL_STENCIL_SIZE] = 8; // 8 bits for stencil
  frameBufferAttributes[EGL_SAMPLES]      = 1;

  initialClearColor = ofColor(0.15 * 255, 0.15 * 255, 0.15 * 255, 255);

  screenNum = 0; /* 0 = LCD on the raspberry pi */
  layer = 0;
}

The easiest way to troubleshoot this is to start by commenting out the new settings :

//-------------------------------------------------------------------------------------
ofAppEGLWindow::Settings::Settings() {
  eglWindowPreference = OF_APP_WINDOW_AUTO;
  eglWindowOpacity = 255;

  // these are usually set as default, but set them here just to be sure
  frameBufferAttributes[EGL_RED_SIZE]     = 8; // 8 bits for red
  frameBufferAttributes[EGL_GREEN_SIZE]   = 8; // 8 bits for green
  frameBufferAttributes[EGL_BLUE_SIZE]    = 8; // 8 bits for blue
  frameBufferAttributes[EGL_ALPHA_SIZE]   = 8; // 8 bits for alpha
  //frameBufferAttributes[EGL_LUMINANCE_SIZE] = EGL_DONT_CARE; // 8 bits for alpha
  //frameBufferAttributes[EGL_DEPTH_SIZE]   = 24; // 24 bits for depth
  //frameBufferAttributes[EGL_STENCIL_SIZE] = 8; // 8 bits for stencil
  //frameBufferAttributes[EGL_SAMPLES]      = 1;

  initialClearColor = ofColor(0.15 * 255, 0.15 * 255, 0.15 * 255, 255);

  screenNum = 0; /* 0 = LCD on the raspberry pi */
  layer = 0;
}

and slowly uncomment

  //frameBufferAttributes[EGL_LUMINANCE_SIZE] = EGL_DONT_CARE; // 8 bits for alpha
  //frameBufferAttributes[EGL_DEPTH_SIZE]   = 24; // 24 bits for depth
  //frameBufferAttributes[EGL_STENCIL_SIZE] = 8; // 8 bits for stencil
  //frameBufferAttributes[EGL_SAMPLES]      = 1;

to see which one is incompatible.

bakercp commented 11 years ago

By the way, this one seems to have compiled with the new changes ... but the one in #80 doesn't seem like it was recompiled with the changes?

danzeeeman commented 11 years ago

Yeah everyone remember you have to recompile the core when you do an update. I know it sucks and takes a while on the device but CD into /libs/openframeworksCompiled/project/ and type sudo make clean and make

On Wed, Jan 2, 2013 at 9:21 AM, Christopher Baker notifications@github.comwrote:

By the way, this one seems to have compiled with the new changes ... but the one in #80https://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/80doesn't seem like it was recompiled with the changes?

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/76#issuecomment-11809483.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

bakercp commented 11 years ago

Also -- theoretically with some of @arturoc's makefile updates, if you have the latest makefile system it should auto-detect when the core needs to be recompiled. If that isn't working (which it appears not to be in @kalwalt's case), then you'll have to do it manually as @danthemellowman noted. @danthemellowman why the sudo?

kalwalt commented 11 years ago

CD into /libs/openframeworksCompiled/project/ and type sudo make clean and make

i have done the rebuid with the compileOF.sh script , should be the same but i'll do a rebuild as you suggesting.
Also i check again if i have all the git changes.

bakercp commented 11 years ago

p.s. the "latest makefile system" should be on the main develop-raspberrypi branch now. Just make sure that you are compiling your projects with a copy of the latest project makefile located here:

https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/scripts/linux/template/linuxarmv6l/Makefile

or for pandaboard folks

https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/scripts/linux/template/linuxarmv7l/Makefile

I believe they are identical actually ... :)

danzeeeman commented 11 years ago

I've been having to use sudo on the build of Debian I have whenever I go to compile the core otherwise it doesn't find the system libs well have permission to access them and to rm the files from the directory I'm using for building.

On Wed, Jan 2, 2013 at 9:42 AM, Christopher Baker notifications@github.comwrote:

Also -- theoretically with some of @arturoc https://github.com/arturoc's makefile updates, if you have the latest makefile system it should auto-detect when the core needs to be recompiled. If that isn't working (which it appears not to be in @kalwalt https://github.com/kalwalt's case), then you'll have to do it manually as @danthemellowmanhttps://github.com/danthemellowmannoted. @danthemellowman https://github.com/danthemellowman why the sudo?

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/76#issuecomment-11810050.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

bakercp commented 11 years ago

Odd. I'm going to completely build an openFrameworks SD image from scratch today to see where the hiccups are. I'll post results on the getting started wiki.

bakercp commented 11 years ago

I'm also going to give archlinux a try :)

kalwalt commented 11 years ago

I've been having to use sudo on the build of Debian I have whenever I go to compile the core otherwise it doesn't find the system libs well have permission to access them and to rm the files from the directory I'm using for building.

this happens to me also. Forgot to say...

danzeeeman commented 11 years ago

I've been doing that periodically and have updated the Wiki. But please add more items if you run into issues.

On Wed, Jan 2, 2013 at 9:48 AM, Christopher Baker notifications@github.comwrote:

Odd. I'm going to completely build an openFrameworks SD image from scratch today to see where the hiccups are. I'll post results on the getting started wiki.

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/76#issuecomment-11810239.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

arturoc commented 11 years ago

yes the makefiles should autocompile OF now and only the files that have changed so it shouldn't be necessary to clean and build OF Specifically.

the problem with sudo should be something with the install_dependencies script not giving the right permissions after compiling, it should work but perhaps we can just remove the compiling of the OF lib from the script now that we have project dependencies

danzeeeman commented 11 years ago

I agrees with removing compiling the core from the install_dep script. I just ran the install_dependencies script and there is an chown error at the end.

On Wed, Jan 2, 2013 at 9:55 AM, arturo notifications@github.com wrote:

yes the makefiles should autocompile OF now and only the files that have changed so it shouldn't be necessary to clean and build OF Specifically.

the problem with sudo should be something with the install_dependencies script not giving the right permissions after compiling, it should work but perhaps we can just remove the compiling of the OF lib from the script now that we have project dependencies

— Reply to this email directly or view it on GitHubhttps://github.com/openFrameworks-RaspberryPi/openFrameworks/issues/76#issuecomment-11810436.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

arturoc commented 11 years ago

yes, let's remove it, kind of curious why the error is happening i've never got it before, is this on the rPi or desktop debian?

danzeeeman commented 11 years ago

on Raspbian “wheezy”

On Wed, Jan 2, 2013 at 10:06 AM, arturo notifications@github.com wrote:

yes, let's remove it, kind of curious why the error is happening i've never got it before, is this on the rPi or desktop debian?

— Reply to this email directly or view it on GitHub.

"I believe in science. Unlike mathematical theorems, scientific results can't be proved. They can only be tested again and again, until only a fool would not believe them.

I cannot prove that electrons exist, but I believe fervently in their existence. And if you don't believe in them, I have a high voltage cattle prod I'm willing to apply as an argument on their behalf. Electrons speak for themselves."

-- Seth Lloyd: Quantum Mechanical Engineer, MIT

/.

kalwalt commented 11 years ago

ok 'im testing again on Pandaboard and to avoid confusion: 1 Now,i'm using this makefile and config.make from here: https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/scripts/linux/template/linuxarmv7l/Makefile 2 i'm using https://github.com/openFrameworks-RaspberryPi/openFrameworks/commit/9f85ffc44c3c7363c5a337ddad35f6a467184a68 i have again siggbart:

(gdb) run Starting program: /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gl/alphaMaskingShaderExample/bin/alphaMaskingShaderExample.app [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [ofAppEGLWindow::createSurface:notice] Setting up EGL Display PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c] PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c] [ofAppEGLWindow::createSurface:notice] EGL Display correctly set. PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c] [ofAppEGLWindow::createSurface:notice] ofGetCurrentRenderer()->getType()=GLES2 [ofAppEGLWindow::createSurface:notice] GLES2 Renderer detected. [ofAppEGLWindow::createSurface:error] Error creating context. EGL_BAD_CONFIG (Invald frame buffer configuration specified) [ofAppEGLWindow::setupPeripherals:notice] Peripherals not supported on X11 [ofAppEGLWindow::setupOpenGL:notice] Peripheral setup complete. [ofAppEGLWindow::runAppViaInfiniteLoop:notice] Entering infinite loop. terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted. __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47 47 ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: No such file or directory. (gdb) bt

0 __libc_do_syscall ()

at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47

1 0xb6b09e92 in __GI_raise (sig=6)

at ../nptl/sysdeps/unix/sysv/linux/raise.c:67

2 0xb6b0c26c in __GI_abort () at abort.c:91

3 0xb6cc65f4 in __gnu_cxx::__verbose_terminate_handler() ()

from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

4 0xb6cc5234 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

5 0xb6cc5234 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb)

this is without the framebuffer @bakercp suggestions . now i'm going to comment out step by step the ofAppEGLWindow::Settings::Settings()

arturoc commented 11 years ago

the problem comes from a null string, probably the gles version? haven't checked the code in a while but on pandaboard the version check will return null if the libraries are not linlked in the correct order.

it's also possible that it won't work unless only one of the libraries for gles is used which is impossible in the current state.

for platforms that only support 1 version of gles we'll need something like OF_USING_GLES1 OF_USING_GLES2 and then ifdefs in all the core for things that are supported in only one of those versions which should be anything that is enclosed in something like:

if(!ofGLIsFixedPipelineRenderer()){...}
kalwalt commented 11 years ago

so basically you are saiyng that this is not related to framebuffer settings but only to the way the GLES2 is linked?

arturoc commented 11 years ago

i think so, the crash you are getting comes from something like:

string a = NULL;

i suspect that NULL comes from a const char* returned by the function that gets the GL version

kalwalt commented 11 years ago

now at least with this makefile https://github.com/openFrameworks-RaspberryPi/openFrameworks/blob/develop-raspberrypi/scripts/linux/template/linuxarmv7l/Makefile OF static libs are builded from it . i can confirm this.( tried only with the debug version) The abovegdb output was from release mode but i can see that aren't difeerence from the debug:

(gdb) run Starting program: /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gl/alphaMaskingShaderExample/bin/alphaMaskingShaderExample_debug.app [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [ofAppEGLWindow::createSurface:notice] Setting up EGL Display PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c] PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c] [ofAppEGLWindow::createSurface:notice] EGL Display correctly set. PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c] [ofAppEGLWindow::createSurface:notice] ofGetCurrentRenderer()->getType()=GLES2 [ofAppEGLWindow::createSurface:notice] GLES2 Renderer detected. [ofAppEGLWindow::createSurface:error] Error creating context. EGL_BAD_CONFIG (Invald frame buffer configuration specified) [ofAppEGLWindow::setupPeripherals:notice] Peripherals not supported on X11 [ofAppEGLWindow::setupOpenGL:notice] Peripheral setup complete. [ofAppEGLWindow::runAppViaInfiniteLoop:notice] Entering infinite loop. terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted. __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47 47 ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: No such file or directory. (gdb) bt

0 __libc_do_syscall ()

at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47

1 0xb6b09e92 in __GI_raise (sig=6)

at ../nptl/sysdeps/unix/sysv/linux/raise.c:67

2 0xb6b0c26c in __GI_abort () at abort.c:91

3 0xb6cc65f4 in __gnu_cxx::__verbose_terminate_handler() ()

from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

4 0xb6cc5234 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

5 0xb6cc5234 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb)

bakercp commented 11 years ago

This error is suspicious:

[ofAppEGLWindow::createSurface:error] Error creating context. EGL_BAD_CONFIG (Invald frame buffer configuration specified) 

I just pushed a change with a better check to make sure that eglConfig is setup correctly.

c370c57

bakercp commented 11 years ago

If we can confirm that eglConfig is not setup correctly, then it should be a matter of reverting to the appropriate settings.frameBufferAttributes for pandaboard. The defaults are currently only tested / optimized for Rpi, as that's all I have to test with :)

kalwalt commented 11 years ago

@bakercp i'm doing the tests that you suggest; i go very slow because it takes to compile every time a lot . But do i test with this now https://github.com/openFrameworks-RaspberryPi/openFrameworks/commit/c370c57 ?

bakercp commented 11 years ago

Yes, I would pull the latest from develop-raspberrypi and continue the tests. It will give you better error output if the error is related to eglConfig.

kalwalt commented 11 years ago

ok now this with https://github.com/openFrameworks-RaspberryPi/openFrameworks/commit/c370c57

(gdb) run Starting program: /home/walter/OF-develop-raspberrypi/openFrameworks/examples/gl/alphaMaskingShaderExample/bin/alphaMaskingShaderExample_debug.app [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1". [ofAppEGLWindow::createSurface:notice] Setting up EGL Display PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c] PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c] [ofAppEGLWindow::createSurface:notice] EGL Display correctly set. PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c] [ofAppEGLWindow::createSurface:notice] ofGetCurrentRenderer()->getType()=GLES2 [ofAppEGLWindow::createSurface:notice] GLES2 Renderer detected. [ofAppEGLWindow::createSurface:error] Error creating context. EGL_BAD_CONFIG (Invald frame buffer configuration specified) [ofAppEGLWindow::setupPeripherals:notice] Peripherals not supported on X11 [ofAppEGLWindow::setupOpenGL:notice] Peripheral setup complete. [ofAppEGLWindow::runAppViaInfiniteLoop:notice] Entering infinite loop. [ofFbo:verbose] FBO supported terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid

Program received signal SIGABRT, Aborted. __libc_do_syscall () at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47 47 ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S: No such file or directory. (gdb) bt

0 __libc_do_syscall ()

at ../ports/sysdeps/unix/sysv/linux/arm/eabi/libc-do-syscall.S:47

1 0xb6b09e92 in __GI_raise (sig=6)

at ../nptl/sysdeps/unix/sysv/linux/raise.c:67

2 0xb6b0c26c in __GI_abort () at abort.c:91

3 0xb6cc65f4 in __gnu_cxx::__verbose_terminate_handler() ()

from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

4 0xb6cc5234 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

5 0xb6cc5234 in ?? () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6

Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb)

bakercp commented 11 years ago

I'm a bit confused on this one -- this error

[ofAppEGLWindow::createSurface:error] Error creating context. EGL_BAD_CONFIG (Invald frame buffer configuration specified)

and this error

what(): basic_string::_S_construct null not valid

I believe the problem is here (in ofAppEGLWindow.cpp):

  // create an EGL rendering eglContext  
  EGLint attribute_list_surface_context[] = {
    EGL_CONTEXT_CLIENT_VERSION, glesVersionForContext,
    EGL_NONE
  };

    eglContext = eglCreateContext(eglDisplay, 
                                  eglConfig, 
                                  EGL_NO_CONTEXT, 
                                  attribute_list_surface_context);

eglCreateContext is setting eglContext == EGL_NO_CONTEXT and it is getting no context because of a EGL_BAD_CONFIG. The only "configuration" we are doing is setting glesVersionForContext to 2. If eglConfig is not returning an error, then I suspect that eglCreateContext doesn't like the glesVersionForContext=2 in its attribute_list_surface_context array ...

Do any normal non-gles2 examples work?

I'm wondering if this really is a gles2 problem.