I have just built allegro and its dependencies targeting iOS 7 and 8.
I built real device and simulator binaries. I just created a simple test program to test things out.
It is basically ex_physfs
When using the iOS 7 simulators, everything is working great. When I use any of the iOS 8 simulators, almost everything works, except when I rotate the screen left, I immediately get an ex_bad_access from EAGLView.m on line 192.
- (BOOL)createFramebuffer { ALLEGRO_DISPLAY_IPHONE *d = (ALLEGRO_DISPLAY_IPHONE *)allegro_display; if (d->extra->adapter == 0 && [self respondsToSelector:@selector(contentScaleFactor)]) { scale = self.contentScaleFactor = [[UIScreen mainScreen] scale]; ALLEGRO_INFO("Screen scale is %f\n", self.contentScaleFactor); } else { scale = 1.0f; }
The cause of the crash is that the allegro display pointer is NULL. I do not know why. I would be tempted to do:
- (BOOL)createFramebuffer { ALLEGRO_DISPLAY_IPHONE *d = (ALLEGRO_DISPLAY_IPHONE *)allegro_display; if(d == NULL) return; if (d->extra->adapter == 0 && [self respondsToSelector:@selector(contentScaleFactor)]) { scale = self.contentScaleFactor = [[UIScreen mainScreen] scale]; ALLEGRO_INFO("Screen scale is %f\n", self.contentScaleFactor); }
But that seems evil.
In any case I wanted to bring this to the attention of the devs. I'm using Xcode 6.1 and OSX 10.9.4.
I will soon be posting my binaries so that everyone with Xcode 6 can quickly try this for themselves. My binaries have a debug version with debug symbols.
Do you have a backtrace?
If you mean a stack trace then I can get that to you, if not, please describe what you mean.
Two terms for the same thing
.
I can't seem to find a way to print a stack trace, but I'll just print it myself:
#0 0x000a4280 in -[EAGLView createFramebuffer] at /Users/josh/Downloads/allegro5-5.1/src/iphone/EAGLView.m:192
EAGLView.m -> line 192
locals:
self EAGLView * 0x7b681130 0x7b681130 _cmd SEL "createFramebuffer" 0x001e5c38 d ALLEGRO_DISPLAY_IPHONE * NULL 0x00000000 depth_stencil_format GLint
Contents of self at this point:
self EAGLView * 0x7b681130 0x7b681130 UIView UIView context EAGLContext * nil 0x00000000 allegro_display ALLEGRO_DISPLAY * NULL 0x00000000 viewRenderbuffer GLuint 0 0 viewFramebuffer GLuint 0 0 depthRenderbuffer GLuint 0 0 touch_list _AL_LIST * 0x7b681990 0x7b681990 touch_id_set NSMutableIndexSet * 0 indexes 0x7b6819f0 primary_touch UITouch * nil 0x00000000 next_free_touch_id int 1 1 scale float 0 0 backingWidth GLint 0 0 backingHeight GLint 0 0
#1 0x000a40c9 in -[EAGLView layoutSubviews] at /Users/josh/Downloads/allegro5-5.1/src/iphone/EAGLView.m:161
EAGLView.m -> line 161
locals:
self EAGLView * 0x7b681130 0x7b681130 _cmd SEL "layoutSubviews" 0x01d1c520
Contents of self at this point:
self EAGLView * 0x7b681130 0x7b681130 UIView UIView context EAGLContext * nil 0x00000000 allegro_display ALLEGRO_DISPLAY * NULL 0x00000000 viewRenderbuffer GLuint 0 0 viewFramebuffer GLuint 0 0 depthRenderbuffer GLuint 0 0 touch_list _AL_LIST * 0x7b681990 0x7b681990 touch_id_set NSMutableIndexSet * 0 indexes 0x7b6819f0 primary_touch UITouch * nil 0x00000000 next_free_touch_id int 1 1 scale float 0 0 backingWidth GLint 0 0 backingHeight GLint 0 0
Then:
#2 0x014a4dd1 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] ()
#44 0x014198b6 in UIApplicationMain ()
#45 0x00118a83 in +[allegroAppDelegate run::] at /Users/josh/Downloads/allegro5-5.1/src/iphone/allegroAppDelegate.m:391
Then:
iphone_main.m line 63
#46 0x00067716 in main at /Users/josh/Downloads/allegro5-5.1/src/iphone/iphone_main.m:63
Here is where Thread 7 (al_mangled_main thread is):
#0 0x02a147ca in __psynch_cvwait ()
#2 0x02a56bd9 in pthread_cond_wait$UNIX2003 ()
#3 0x00158d7a in _al_cond_wait at /Users/josh/Downloads/allegro5-5.1/misc/Allegro 5 iOS/../../include/allegro5/platform/aintuthr.h:81
#4 0x00158cf4 in al_wait_for_event at /Users/josh/Downloads/allegro5-5.1/src/events.c:392
#5 0x000189d9 in _al_mangled_main at /Users/josh/Desktop/Allegro 5.1.9 iOS/AllegroIOSTest/AllegroIOSTest/main.mm:440
#6 0x000675b0 in user_main at /Users/josh/Downloads/allegro5-5.1/src/iphone/iphone_main.m:19
#7 0x000744c1 in thread_func_trampoline at /Users/josh/Downloads/allegro5-5.1/src/threads.c:80
#8 0x0007d7a3 in thread_proc_trampoline at /Users/josh/Downloads/allegro5-5.1/src/unix/uxthread.c:44
#9 0x02a525fb in _pthread_body ()
#10 0x02a52485 in _pthread_start ()
#11 0x02a57cf2 in thread_start ()
---
I thought it only happened when I turn the device left, but as long as I have set the orientation as supported, it will cause this on iOS 8.1.
I can't seem to find a way to print a stack trace, but I'll just print it myself:
I think you can set up a trigger in XCode's debugger that fires on any exception/crash. then it should give you a backtrace on crash. Though i think it'd let you get a backtrace even if you don't if you find the debugger window.