(char*) glGetString(GL_EXTENSIONS) crashes

231 views
Skip to first unread message

jor...@chinzilla.com

unread,
Apr 6, 2014, 5:06:38 PM4/6/14
to apportabl...@googlegroups.com
Hi all,

I've been trying to use Apportable to port my cocos2d 2.0 app to android. I got a roughly working build up on a device, but then stuff came up and I put it aside for a month. Now when I try running the app on Android though, it keeps crashing on line 168 of CCConfiguration.m which is:

glExtensions = (char*) glGetString(GL_EXTENSIONS);

It still works fine building to iOS, and I didn't change anything with initing the CCGLView so I'm at a total loss. Anyone run into this and have a fix?

Thanks,

Jordan

Philippe Hausler

unread,
Apr 6, 2014, 6:27:50 PM4/6/14
to apportabl...@googlegroups.com, jor...@chinzilla.com
can you attach a backtrace and version info?
--
You received this message because you are subscribed to the Google Groups "Apportable discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jor...@chinzilla.com

unread,
Apr 6, 2014, 6:38:52 PM4/6/14
to apportabl...@googlegroups.com, jor...@chinzilla.com

Program received signal SIGSEGV, Segmentation fault.

0x40920884 in glGetString () from /Users/jordan/.apportable/cache/devices/HT35EW900516/libs/libGLESv1_CM.so

(gdb) bt

#0  0x40920884 in glGetString () from /Users/jordan/.apportable/cache/devices/HT35EW900516/libs/libGLESv1_CM.so

#1  0x76314698 in __wrap_glGetString () from /Users/jordan/.apportable/SDK/Build/android-armeabi-debug/LittleAlchemistcopy/apk/lib/armeabi/libverde.so

#2  0x76502dcc in -[CCConfiguration getOpenGLvariables] (self=0x74671da0, _cmd=0x76844601 <L_OBJC_METH_VAR_NAME_44>)

    at /Users/jordan/Documents/cocosTest/LittleAlchemist/LittleAlchemist/LittleAlchemist/libs/cocos2d/CCConfiguration.m:168

#3  0x7650339c in -[CCConfiguration supportsDiscardFramebuffer] (self=0x74671da0, _cmd=0x7686899d <L_OBJC_METH_VAR_NAME_41>)

    at /Users/jordan/Documents/cocosTest/LittleAlchemist/LittleAlchemist/LittleAlchemist/libs/cocos2d/CCConfiguration.m:251

#4  0x7673c1f0 in -[CCGLView setupSurfaceWithSharegroup:] (self=0x6e9bf870, _cmd=0x76868883 <L_OBJC_METH_VAR_NAME_11>, sharegroup=0x0)

    at /Users/jordan/Documents/cocosTest/LittleAlchemist/LittleAlchemist/LittleAlchemist/libs/cocos2d/Platforms/iOS/CCGLView.m:200

#5  0x7673bca4 in -[CCGLView initWithFrame:pixelFormat:depthFormat:preserveBackbuffer:sharegroup:multiSampling:numberOfSamples:] (self=0x6e9bf870, 

    _cmd=0x76868820 <L_OBJC_METH_VAR_NAME_9>, frame=..., format=0x767e9ac0, depth=0, retained=0 '\000', sharegroup=0x0, sampling=0 '\000', nSamples=0)

    at /Users/jordan/Documents/cocosTest/LittleAlchemist/LittleAlchemist/LittleAlchemist/libs/cocos2d/Platforms/iOS/CCGLView.m:143

#6  0x7673b56c in +[CCGLView viewWithFrame:pixelFormat:depthFormat:preserveBackbuffer:sharegroup:multiSampling:numberOfSamples:] (

    self=0x76871564 <OBJC_CLASS_$_CCGLView>, _cmd=0x7685629f <L_OBJC_METH_VAR_NAME_96>, frame=..., format=0x767e9ac0, depth=0, retained=0 '\000', sharegroup=0x0, 

    multisampling=0 '\000', samples=0) at /Users/jordan/Documents/cocosTest/LittleAlchemist/LittleAlchemist/LittleAlchemist/libs/cocos2d/Platforms/iOS/CCGLView.m:120

#7  0x7665345c in -[AppController application:didFinishLaunchingWithOptions:] (self=0x7466b500, _cmd=0x76801377 <L_OBJC_METH_VAR_NAME_95>, application=0x74659ca0, 

    launchOptions=0x0) at /Users/jordan/Documents/cocosTest/LittleAlchemist/LittleAlchemist/LittleAlchemist/AppDelegate.m:125

#8  0x763403fc in -[UIApplication finishedLaunching] () from /Users/jordan/.apportable/SDK/Build/android-armeabi-debug/LittleAlchemistcopy/apk/lib/armeabi/libverde.so

#9  0x76341194 in __20_2D__5B_UIApplication_20_run_5D__block_invoke218 ()

   from /Users/jordan/.apportable/SDK/Build/android-armeabi-debug/LittleAlchemistcopy/apk/lib/armeabi/libverde.so

#10 0x7392304c in _dispatch_call_block_and_release () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libSystem.so

#11 0x73923068 in _dispatch_client_callout () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libSystem.so

#12 0x73925bc8 in _dispatch_main_queue_callback_4CF () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libSystem.so

#13 0x73f08518 in ?? () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libCoreFoundation.so

#14 0x73f038e4 in ?? () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libCoreFoundation.so

#15 0x73f02f34 in CFRunLoopRunSpecific () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libCoreFoundation.so

#16 0x73f03c60 in CFRunLoopRunInMode () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libCoreFoundation.so

#17 0x744cc444 in ?? () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libFoundation.so

To unsubscribe from this group and stop receiving emails from it, send an email to apportable-discuss+unsub...@googlegroups.com.

jor...@chinzilla.com

unread,
Apr 6, 2014, 6:41:21 PM4/6/14
to apportabl...@googlegroups.com, jor...@chinzilla.com
Not sure how to check apportable version. I ran apportable update Friday though.

Philippe Hausler

unread,
Apr 6, 2014, 6:43:09 PM4/6/14
to apportabl...@googlegroups.com, jor...@chinzilla.com, jor...@chinzilla.com
That is the worst possible backtrace :/ it looks like it is crashing in the GL driver itself!

Which device is this? What are the circumstances of the crash (100% repro?)
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.

Jordan Ferber

unread,
Apr 6, 2014, 6:48:10 PM4/6/14
to Philippe Hausler, apportabl...@googlegroups.com
Hi Philippe,

This crash is happening a 100% of time. Its on an HTC One. It was building fine 2 weeks ago, but I don't think I've change any of the initialization code since then. Like you noticed, its crashing very early.

Thanks,
Jordan

jor...@chinzilla.com

unread,
Apr 6, 2014, 6:53:49 PM4/6/14
to apportabl...@googlegroups.com, jor...@chinzilla.com
Hi Philippe,

This crash is happening a 100% of time. Its on an HTC One. It was building fine 2 weeks ago, but I don't think I've change any of the initialization code since then. Like you noticed, its crashing very early.

Thanks,
Jordan

Philippe Hausler

unread,
Apr 6, 2014, 6:54:02 PM4/6/14
to Jordan Ferber, apportabl...@googlegroups.com
I know we have had many applications work just fine on the HTC One (it is one of our go-to devices to test on). The only conceivable way for that function to fail like that (albeit that I would say that failure is a bit harsh to SIGSEGV; perhaps an abort w/ a logged error from the driver would be better imho) is the potential that you do not have a context current.

For just debugging purposes, can you disable all frame buffer, render buffer and context destruction code and give it a whirl?
To unsubscribe from this group and stop receiving emails from it, send an email to apportable-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jordan Ferber

unread,
Apr 6, 2014, 7:03:13 PM4/6/14
to Philippe Hausler, apportabl...@googlegroups.com
If I run just_debug and make sure phone doesn't go to sleep while building, I get a different error.

Program received signal SIGSEGV, Segmentation fault.

0x7391f864 in objc_msgSend () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libSystem.so

(gdb) bt

#0  0x7391f864 in objc_msgSend () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libSystem.so

#1  0x7391f8b0 in objc_msgSend_uncached () from /Users/jordan/.apportable/SDK/sysroot/android/usr/lib/armeabi/libSystem.so

#2  0x43a00000 in ?? ()

#3  0x43a00000 in ?? ()

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

Philippe Hausler

unread,
Apr 6, 2014, 7:05:25 PM4/6/14
to Jordan Ferber, apportabl...@googlegroups.com
Ok that makes sense now; if the device is asleep the context cannot be made current. This only occurs in debugging scenarios since you cannot launch the app when the device is asleep.

Two potential info points for the objc_msgSend crash:

in the debugger instead of using bt, you can examine the stack by x/200a $sp

or you can run the app w/o the debugger and watch logcat, and hopefully debuggerd can catch the crash and unwind it.

Jordan Ferber

unread,
Apr 6, 2014, 7:08:59 PM4/6/14
to Philippe Hausler, apportabl...@googlegroups.com
I realized it once I was reading about context destruction. Thanks for the help and I'll keep trying to debug while keeping the phone awake.
Reply all
Reply to author
Forward
0 new messages