# Crash on calling glCheckFramebufferStatus

**URL:** <https://forums.imgtec.com/t/crash-on-calling-glcheckframebufferstatus/1505>\
**Category:** PowerVR Insider\
**Created:** [August 22, 2012, 5:24am UTC](https://forums.imgtec.com/t/crash-on-calling-glcheckframebufferstatus/1505 "2012-08-22T05:24:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pencyot3](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@pencyot3](https://forums.imgtec.com/u/pencyot3)\
**Post date:** [August 22, 2012, 5:24am UTC](https://forums.imgtec.com/t/crash-on-calling-glcheckframebufferstatus/1505/1 "2012-08-22T05:24:37Z")

</div>

Hi  
  
In Galaxy S, it was not able to get status because application crashed when glCheckFramebufferStatus was called.  
Output by “adb shell cat /proc/pvr/version” is as follows.  
  
&nbsp; Version 1.6.16.3947 (release) smdkc110\_android  
&nbsp; System Version String: SGX540 S5PC110  
  
  
This problem occurred in the source code such as the following.  
  
&nbsp; // create renderbuffer  
&nbsp; GLuint renderbuffer;  
&nbsp; glGenRenderbuffers( 1, &renderbuffer );  
&nbsp; glBindRenderbuffer( GL\_RENDERBUFFER, renderbuffer );  
&nbsp; glRenderbufferStorage( GL\_RENDERBUFFER, GL\_DEPTH\_COMPONENT16, 1, 1 );  
&nbsp; glBindRenderbuffer( GL\_RENDERBUFFER, 0 );  
  
&nbsp; // create framebuffer  
&nbsp; GLuint framebuffer;  
&nbsp; glGenFramebuffers( 1, &framebuffer );  
&nbsp; glBindFramebuffer( GL\_FRAMEBUFFER, framebuffer );  
&nbsp; glFramebufferRenderbuffer( GL\_FRAMEBUFFER, GL\_DEPTH\_ATTACHMENT, GL\_RENDERBUFFER, renderbuffer );  
&nbsp; glBindFramebuffer( GL\_FRAMEBUFFER, 0 );  
  
&nbsp; // check framebuffer status  
&nbsp; glBindFramebuffer( GL\_FRAMEBUFFER, framebuffer );  
&nbsp; if ( glGetError() != GL\_NO\_ERROR ) {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOGE( “GL error” );  
&nbsp; }  
&nbsp; LOGD( “Start glCheckFramebufferStatus()” );  
&nbsp; if ( glCheckFramebufferStatus( GL\_FRAMEBUFFER ) != GL\_FRAMEBUFFER\_COMPLETE ) {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOGE( “framebuffer is incomplete!” );  
&nbsp; }  
&nbsp; LOGD( “End glCheckFramebufferStatus()” );  
&nbsp; glBindFramebuffer( GL\_FRAMEBUFFER, 0 );  
  
  
The following log is output in glCheckFramebufferStatus call in the source code above, then the application was terminated abnormally.  
  
&nbsp; Build fingerprint: ‘samsung/SC-02B/SC-02B:2.3.3/GINGERBREAD/OMKE3:user/release-keys’  
&nbsp; pid: 5671, tid: 5679&nbsp; \>\>\> jp.co.ddd.test701c21 \<\<\<  
&nbsp; signal 11 (SIGSEGV), code 1 (SEGV\_MAPERR), fault addr 00000144  
&nbsp;&nbsp; r0 01ad4000&nbsp; r1 00000000&nbsp; r2 00000000&nbsp; r3 00800179  
&nbsp;&nbsp; r4 002d79a0&nbsp; r5 00000000&nbsp; r6 00800169&nbsp; r7 00000020  
&nbsp;&nbsp; r8 00000001&nbsp; r9 00000000&nbsp; 10 00000000&nbsp; fp 00000000  
&nbsp;&nbsp; ip 01ad4000&nbsp; sp 4689aad0&nbsp; lr 81a1baa8&nbsp; pc 81a0e3e8&nbsp; cpsr 20000010  
&nbsp;&nbsp; d0&nbsp; 7562656d61724675&nbsp; d1&nbsp; 7461745372656673  
&nbsp;&nbsp; d2&nbsp; 00530045004c0028&nbsp; d3&nbsp; 0074006e006f0029  
&nbsp;&nbsp; d4&nbsp; 004c0047006d0020&nbsp; d5&nbsp; 0065005600530045  
&nbsp;&nbsp; d6&nbsp; 006f006900730072&nbsp; d7&nbsp; 0020003d0020006e  
&nbsp;&nbsp; d8&nbsp; 0000000000000000&nbsp; d9&nbsp; 0000000000000000  
&nbsp;&nbsp; d10 0000000000000000&nbsp; d11 0000000000000000  
&nbsp;&nbsp; d12 0000000000000000&nbsp; d13 0000000000000000  
&nbsp;&nbsp; d14 0000000000000000&nbsp; d15 0000000000000000  
&nbsp;&nbsp; d16 2f62696c2f6d6574&nbsp; d17 3fe999999999999a  
&nbsp;&nbsp; d18 42eccefa43de3400&nbsp; d19 3fbc71c71c71c71c  
&nbsp;&nbsp; d20 4008000000000000&nbsp; d21 3fd99a27ad32ddf5  
&nbsp;&nbsp; d22 3fd24998d6307188&nbsp; d23 3fcc7288e957b53b  
&nbsp;&nbsp; d24 3fc74721cad6b0ed&nbsp; d25 3fc39a09d078c69f  
&nbsp;&nbsp; d26 0000000000000000&nbsp; d27 0000000000000000  
&nbsp;&nbsp; d28 0000000000000000&nbsp; d29 0000000000000000  
&nbsp;&nbsp; d30 0000000000000000&nbsp; d31 0000000000000000  
&nbsp;&nbsp; scr 60000012  
&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #00&nbsp; pc 0000e3e8&nbsp; /system/lib/egl/libGLESv2\_POWERVR\_SGX540\_120.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #01&nbsp; lr 81a1baa8&nbsp; /system/lib/egl/libGLESv2\_POWERVR\_SGX540\_120.so  
&nbsp;   
&nbsp; code around pc:  
&nbsp; 81a0e3c8 0a000005 e2466001 e1a05002 e1a06406   
&nbsp; 81a0e3d8 e3866502 e3866069 e1833006 e5941060   
&nbsp; 81a0e3e8 e5813144 e3003484 e5813148 e2833004   
&nbsp; 81a0e3f8 e5813150 e2833004 e5812164 e3a02d12   
&nbsp; 81a0e408 e5813158 e2833004 e5812140 e581c14c   
&nbsp;   
&nbsp; code around lr:  
&nbsp; 81a1ba88 e1a01006 ebff9cc3 e5845144 e5840138   
&nbsp; 81a1ba98 e5940124 ebff9ce3 e1a01005 ebff9cbd   
&nbsp; 81a1baa8 ea000011 e584613c e5940120 ebff9cdd   
&nbsp; 81a1bab8 e1a01006 ebff9cb7 e2853102 e5843144   
&nbsp; 81a1bac8 e5840138 e5970008 ebff9caf e1a06000   
&nbsp;   
&nbsp; stack:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aa90&nbsp; 002d0b68&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aa94&nbsp; 002d7a10&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aa98&nbsp; 002d7a4c&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aa9c&nbsp; 002d7a10&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaa0&nbsp; 00000001&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaa4&nbsp; 81a0cbec&nbsp; /system/lib/egl/libGLESv2\_POWERVR\_SGX540\_120.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaa8&nbsp; 002d79e0&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaac&nbsp; 002d79a0&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aab0&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aab4&nbsp; 00000001&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aab8&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aabc&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aac0&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aac4&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aac8&nbsp; df002777&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aacc&nbsp; e3a070ad&nbsp;   
&nbsp; #00 4689aad0&nbsp; 002d7a4c&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aad4&nbsp; 002d7a10&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aad8&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aadc&nbsp; 81a0cbec&nbsp; /system/lib/egl/libGLESv2\_POWERVR\_SGX540\_120.so  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aae0&nbsp; 002d79e0&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aae4&nbsp; 002d0b68&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aae8&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaec&nbsp; 00000010&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaf0&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaf4&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aaf8&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689aafc&nbsp; 4679af30&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689ab00&nbsp; 801a5374&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689ab04&nbsp; 4689ab60&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689ab08&nbsp; 00000000&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689ab0c&nbsp; 4689ac10&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689ab10&nbsp; 4679af4c&nbsp;   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4689ab14&nbsp; 4689ab40&nbsp;   
  
  
The complete source codes of this test application are as follows.  
[&nbsp; http://dl.dropbox.com/u/23346852/ticket-701\_21/Test701\_21-source.zip](http://dl.dropbox.com/u/23346852/ticket-701_21/Test701_21-source.zip)  
&nbsp; (md5sum=ca8c268ae5bee1e822f6b3a963f63442)  
&nbsp;

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [September 5, 2012, 8:30am UTC](https://forums.imgtec.com/t/crash-on-calling-glcheckframebufferstatus/1505/2 "2012-09-05T08:30:07Z")

</div>

Hi,  
  
Have you been able to resolve your problem yet?  
  
The crash is likely due to a driver bug. Unfortunately, I'm not sure if that device will get another official driver update.  
  
I've noticed that there seem to be some errors in your framebuffer setup. For example:  

1. You should only unbind the renderbuffer and framebuffer&nbsp; at the end of the frame buffer's setup, as they must be bound during the setup
2. You are creating a depth buffer that is 1x1. Is this correct? For a non-antialiased FBO, the resolutions of any colour, depth and stencil attachments should match

Thanks,

Joe
