| SDL_INIT_EVERYTHING crashes on IOS 7.0 simulator |
| SDL_INIT_EVERYTHING crashes on IOS 7.0 simulator |
|
Ryan C. Gordon
Guest
|
How did you build SDL? Line 119 is only SDL_DestroySemaphore() if you use the SDL_syssem.c in the "generic" folder. You want the one in the "pthread" folder for iOS. (If you're compiling SDL with the rest of your app...that's sort of risky, for just this sort of reason.) --ryan. _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
|
||||||||||||||
| SDL_INIT_EVERYTHING crashes on IOS 7.0 simulator |
|
Alexander Chaliovski
Guest
|
I copied all the sources and headers from the Xcode template and I made my own custom cmake build. I coped all files form src and include to my build. The Cmake is explicit for the source and headers but I will double check if it is not mixing some wrong files.
Thanks, Alex |
|||||||||||
|
|
||||||||||||
| SDL_INIT_EVERYTHING crashes on IOS 7.0 simulator |
|
Alexander Chaliovski
Guest
|
Hi again, I can see the exactly same behavior from the Xcode SDL project in SDL 2.0.2 .
These are the steps to reproduce the problem. 1. Build with the SDL 2.0.2 with the Xcode project provided for the simulator 2. Open the SDL template and add the static SDL library to the project and the headers from the include directory of the SDL source. 4. If we run with SDL_INIT_VIDEO its all fine it runs properly. 5. if we run with SDL_INIT_EVERYTHING the same problems it seems it is referencing wrong files somewhere . ==18042==ERROR: AddressSanitizer: attempting double-free on 0x0aa789a0 in thread T0: #0 0xf3035 in wrap_free _asan_rtl_ #1 0x281ed in SDL_DestroySemaphore SDL_syssem.c:119 #2 0x28bba in SDL_CreateThread SDL_thread.c:382 #3 0x4422 in SDL_TimerInit SDL_timer.c:233 #4 0x27a54 in SDL_InitSubSystem SDL.c:158 #5 0x3a17 in SDL_main main.c:59 #6 0x5d340 in -[SDLUIKitDelegate postFinishLaunch] SDL_uikitappdelegate.m:18 Let me know if it is worth trying another version . Thanks, Alex . |
|||||||||||
|
|
||||||||||||
| SDL_INIT_EVERYTHING crashes on IOS 7.0 simulator |
|
Sam Lantinga
|
That call stack looks good, since we use the generic semaphore support on iOS, but I don't see any way for there to be a double free on that semaphore. It's allocated in that function, and then freed in a single place in that same function.
SDL_INIT_EVERYTHING does initialize the haptic system, which isn't supported on iOS, so SDL_Init() fails... maybe there's something else going on? Do you have memory corruption happening in your program? Maybe there's a bug in AddressSanitizer? On Sun, Mar 16, 2014 at 10:20 AM, Alexander Chaliovski wrote:
|
|||||||||||||
|
|
||||||||||||||
| SDL_INIT_EVERYTHING crashes on IOS 7.0 simulator |
|
Alexander Chaliovski
Guest
|
Ok I think I know what is happening
This macro inside /thread/pthread/SDL_syssem.c doesn't seem to work under the simulator #if defined(__MACOSX__) || defined(__IPHONEOS__) /* Mac OS X doesn't support sem_getvalue() as of version 10.4 */ #include "../generic/SDL_syssem.c" #else then the compiler includes /generic/SDL_syssem.c And this function causes problems. SDL_DestroySemaphore(SDL_sem * sem) { if (sem) { sem->count = 0xFFFFFFFF; while (sem->waiters_count > 0) { SDL_CondSignal(sem->count_nonzero); SDL_Delay(10); } SDL_DestroyCond(sem->count_nonzero); if (sem->count_lock) { SDL_LockMutex(sem->count_lock); SDL_UnlockMutex(sem->count_lock); SDL_DestroyMutex(sem->count_lock); } SDL_free(sem); } } LLDB is triggered as well but I guess this is not suppose to be compiled in the first place. ~Alex |
|||||||||||
|
|
||||||||||||
| SDL_INIT_EVERYTHING crashes on IOS 7.0 simulator |
|
Alexander Chaliovski
Guest
|
I can confirm that after commenting this line
SDL_DestroyCond(sem->count_nonzero); cleared any crashes or issues I had. So far I did some tests with most of the subsystems and they seem to be stable. I switched to 2.0.3 mercurial . ~Alex |
|||||||||||
|
|
||||||||||||

