SVN Head crash on Mac OSX

Mar 16, 2013 at 10:53 PM
Edited Mar 16, 2013 at 10:54 PM
Experimenting with latest and greatest(SVN head) on Mac OSX i'm getting a crash as soon as i try to start anything emulating, even just running the bios or an iso that works on the previous stable release.

Call stack is :-
#0  0x00007fff880e2b51 in glFinishObjectAPPLE ()
#1  0x00000001024866b2 in -[NetSfPeopsSoftGPUPluginGLView swapBuffer] at /Users/robin/code/pcsxr/macosx/plugins/DFXVideo/macsrc/PluginGLView.m:617
#2  0x000000010248aae7 in GPUupdateLace at /Users/robin/code/pcsxr/macosx/plugins/DFXVideo/../../../plugins/dfxvideo/gpu.c:966
#3  0x0000000100046f35 in psxRcntUpdate at /Users/robin/code/pcsxr/macosx/../libpcsxcore/psxcounters.c:313
#4  0x000000010004f3de in psxBranchTest at /Users/robin/code/pcsxr/macosx/../libpcsxcore/r3000a.c:150
#5  0x000000010004bbe1 in doBranch at /Users/robin/code/pcsxr/macosx/../libpcsxcore/psxinterpreter.c:472
#6  0x000000010004c32c in psxBNE at /Users/robin/code/pcsxr/macosx/../libpcsxcore/psxinterpreter.c:618
#7  0x000000010004d45c in execI at /Users/robin/code/pcsxr/macosx/../libpcsxcore/psxinterpreter.c:1101
#8  0x000000010004d47e in intExecute at /Users/robin/code/pcsxr/macosx/../libpcsxcore/psxinterpreter.c:1075
#9  0x000000010000bb12 in -[EmuThread EmuThreadRunBios:] at /Users/robin/code/pcsxr/macosx/EmuThread.m:113
#10 0x00007fff8904072a in -[NSThread main] ()
#11 0x00007fff890406a2 in __NSThread__main__ ()
#12 0x00007fff8a2c38bf in _pthread_start ()
#13 0x00007fff8a2c6b75 in thread_start ()
looking at frame 1, its
glFinishObjectAPPLE(GL_TEXTURE, 2-whichImage);
causing the crash, which i believe is caused by creating the opengl context using a dispatch_sync() to the main thread.

Doing a quick svn bisection, i can see that commit 82588 causes this crash for me and anything before that eg 82586 works. By removing the dispatch_sync(dispatch_get_main_queue(), ^{ } from ulInitDisplay(void) i can get head working again.

By removing the dispatch_sync() i get warnings about QLError(): +[QLSeamlessDocumentOpener seamlessDocumentOpenerForURL:] should only be called in the main thread.. which is understandable but no crash, so it points to something but what i have done is no fix currently.

I'm not familar with the code at all currently so just though I would post my analysis in case someone finds it helpful
Mar 17, 2013 at 6:04 PM
I ran into that too. It only happens with the SoftGL graphics plugin, not the OpenGL graphics plugin, so it seems to be a problem with that plugin or its use. If you use the OpenGL plugin, things should work. (That plugin is faster, anyway, since it uses the GPU hardware for graphics rendering.)
Mar 17, 2013 at 10:25 PM
I have a fix incoming.