Projects > cpp > Issues > Bug #3610

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

SIGSEGV, Segmentation fault.

Bug #3610 [Closed]
js_42106 2014-01-08 14:41 . Updated over 10 years ago

after clicking next on ShaderRetroEffect, App crashes(may be on ShaderFail ).

here debug trace………

cocos2d-x debug info [cocos2d: ERROR: Failed to compile shader:
uniform mat4 CC_PMatrix;
uniform mat4 CC_MVMatrix;
uniform mat4 CC_MVPMatrix;
uniform vec4 CC_Time;
uniform vec4 CC_SinTime;
uniform vec4 CC_CosTime;
uniform vec4 CC_Random01;
//CC INCLUDES END


#ifdef GL_ES                    
precision lowp float;           
#endif                          

varying vec2 v_texCoord;                
uniform sampler2D CC_Texture0;          

vec4 colors[10];                        

void main(void)                             
{                                       
colors[0] = vec4(1,0,0,1);              
colors[1] = vec4(0,1,0,1);              
colors[2] = vec4(0,0,1,1);              
colors[3] = vec4(0,1,1,1);              
colors[4] = vec4(1,0,1,1);              
colors[5] = vec4(1,1,0,1);              
colors[6] = vec4(1,1,1,1);              
colors[7] = vec4(1,0.5,0,1);            
colors[8] = vec4(1,0.5,0.5,1);          
colors[9] = vec4(0.5,0.5,1,1);          

int y = int( mod(gl_FragCoord.y / 3.0, 10.0 ) );                
gl_FragColor = colors[z] * texture2D(CC_Texture0, v_texCoord);          
}                                       ]

Program received signal SIGSEGV, Segmentation fault.

0x00007ffff7141068 in __glewGetShaderiv ()
   from /usr/lib/x86_64-linux-gnu/libGLEW.so.1.8
#0  0x00007ffff7141068 in __glewGetShaderiv ()
   from /usr/lib/x86_64-linux-gnu/libGLEW.so.1.8
#1  0x00007ffff79e0b2c in cocos2d::CCGLProgram::logForOpenGLObject (
    this=0x150a7a0, object=30, infoFunc=0x7ffff7141068 <__glewGetShaderiv>, 
    logFunc=0x7ffff7141078 <__glewGetShaderInfoLog>)
    at ../shaders/CCGLProgram.cpp:330
#2  0x00007ffff79e0c65 in cocos2d::CCGLProgram::fragmentShaderLog (
    this=0x150a7a0) at ../shaders/CCGLProgram.cpp:350
#3  0x00007ffff79e07ea in cocos2d::CCGLProgram::compileShader (this=0x150a7a0, 
    shader=0x150a7c0, type=35632, 
    source=0x689f68 "\n#ifdef GL_ES\t\t\t\t\t\nprecision lowp float;\t\t\t\n#endif\t\t\t\t\t\t\t\n\nvarying vec2 v_texCoord;\t\t\t\t\nuniform sampler2D CC_Texture0;\t\t\t\n\nvec4 colors[10];\t\t\t\t\t\t\n\nvoid main(void)\t\t\t\t\t\t\t\t\n{", '\t' , "\ncolors[0] = vec4"...)
    at ../shaders/CCGLProgram.cpp:227
#4  0x00007ffff79e0454 in cocos2d::CCGLProgram::initWithVertexShaderByteArray (
    this=0x150a7a0, 
    vShaderByteArray=0x7ffff7afe920 '\t' , "\nattribute vec4 a_position;\t\t\t\t\t\t\t\t\nattribute vec2 a_texCoord;\t\t\t\t\t\t\t\t\n", '\t' , "\n#ifdef GL_ES", '\t' , "\nvarying mediump vec2 v_texCoord;\t\t\t\t\t\t\n#else", '\t' , "\nvarying vec2 v_tex"..., 
    fShaderByteArray=0x689f68 "\n#ifdef GL_ES\t\t\t\t\t\nprecision lowp float;\t
\t\t\n#endif\t\t\t\t\t\t\t\n\nvarying vec2 v_texCoord;\t\t\t\t\nuniform sampler2D CC_Texture0;\t\t\t\n\nvec4 colors[10];\t\t\t\t\t\t\n\nvoid main(void)\t\t\t\t\t\t\t\t\n{", '\t' , "\ncolors[0] = vec4"...)
    at ../shaders/CCGLProgram.cpp:117
#5  0x000000000051aca6 in ShaderFail::ShaderFail (this=0x14e4f70)
    at ../Classes/ShaderTest/ShaderTest.cpp:805
#6  0x0000000000517491 in createShaderLayer (nIndex=8)
    at ../Classes/ShaderTest/ShaderTest.cpp:21
#7  0x00000000005175bf in nextAction ()
    at ../Classes/ShaderTest/ShaderTest.cpp:32
#8  0x0000000000517e19 in ShaderTestDemo::nextCallback (this=0x14e5880, 
    pSender=0x1a3d9b0) at ../Classes/ShaderTest/ShaderTest.cpp:109
#9  0x00007ffff796e4d9 in cocos2d::CCMenuItem::activate (this=0x1a3d9b0)
    at ../menu_nodes/CCMenuItem.cpp:114
#10 0x00007ffff796b1b8 in cocos2d::CCMenu::ccTouchEnded (this=0x146c2b0, 
    touch=0x1639340, event=0x0) at ../menu_nodes/CCMenu.cpp:260
#11 0x00007ffff79de1e2 in cocos2d::CCTouchDispatcher::touches (this=0xeca660, 
    pTouches=0x7fffffffd9c0, pEvent=0x0, uIndex=2)
    at ../touch_dispatcher/CCTouchDispatcher.cpp:377
#12 0x00007ffff79de7e9 in cocos2d::CCTouchDispatcher::touchesEnded (
    this=0xeca660, touches=0x7fffffffd9c0, pEvent=0x0)
    at ../touch_dispatcher/CCTouchDispatcher.cpp:507
#13 0x00007ffff7989b77 in cocos2d::CCEGLViewProtocol::handleTouchesEnd (
this=0xa3afc0, num=1, ids=0x7fffffffda1c, xs=0x7fffffffda20, 
    ys=0x7fffffffda24) at ../platform/CCEGLViewProtocol.cpp:334
#14 0x00007ffff799609c in cocos2d::mouseButtonEventHandle (iMouseID=0, 
    iMouseState=0) at ../platform/linux/CCEGLView.cpp:132
#15 0x00007ffff5ef5f00 in ?? () from /usr/lib/libglfw.so.2
#16 0x00007ffff5ef66f5 in _glfwPlatformPollEvents () from /usr/lib/libglfw.so.2
#17 0x00007ffff7996769 in cocos2d::CCEGLView::swapBuffers (this=0xa3afc0)
    at ../platform/linux/CCEGLView.cpp:289
#18 0x00007ffff79ee9fd in cocos2d::CCDirector::drawScene (this=0xeca270)
    at ../CCDirector.cpp:294
#19 0x00007ffff79f0f2e in cocos2d::CCDisplayLinkDirector::mainLoop (
    this=0xeca270) at ../CCDirector.cpp:1076
#20 0x00007ffff79953b2 in cocos2d::CCApplication::run (this=0x7fffffffdcd0)
    at ../platform/linux/CCApplication.cpp:53
#21 0x0000000000565321 in main (argc=1, argv=0x7fffffffdde8) at main.cpp:18
walzer@cocos2d-x.org 2014-01-09 02:53
  • Description updated (diff)
walzer@cocos2d-x.org 2014-01-09 02:54

What’s the version of cocos2d-x are you using?
And which version of Linux are you running on?

js_42106 2014-01-09 13:34

I am using cocos2d-x-2.2.2 on Ubuntu 13.10(64bit) with 3.11.1-031101-generic Kernel
Latest Drivers for AMD A8-4500M APU from AMD

walzer@cocos2d-x.org 2014-10-08 02:45

Redmine issue system is closed, we are using github issue system instead.

This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8299

Atom PDF

Status:Closed
Start date:2014-01-08
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:linux
Target version:-