Strange persistent crash on ios

hi all,
I’ve finally been able to catch a weird crash that is happening in my
ios application.
After some minutes of testing on device the app misteriously crashes
– never happens on simulator. What I find strange is that this bug is
persistent, always happens after some time of playing but if i leave
the app on without interaction it never crashes.

From the limited information of the backtrace below all I can gather
is that something is ‘distubing’ the ios event queue, but I have no
idea how I can debug this further.
Is there any advice on how/what/why this is happening? Can anyone shed
some light on the event queue processing on ios?

thanks
Vittorio

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 CoreFoundation 0x32973708
___CFBasicHashFindBucket_Linear + 120
1 CoreFoundation 0x328c4db8 CFBasicHashRemoveValue + 368
2 CoreFoundation 0x328c69e2 CFSetRemoveValue + 54
3 CoreFoundation 0x328c63ae CFRunLoopRemoveTimer + 122
4 Foundation 0x338a169a __NSFireDelayedPerform + 310
5 CoreFoundation 0x32937a40
CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 8
6 CoreFoundation 0x32939ec4 __CFRunLoopDoTimer + 844
7 CoreFoundation 0x3293a83e __CFRunLoopRun + 1082
8 CoreFoundation 0x328caebc CFRunLoopRunSpecific + 224
9 CoreFoundation 0x328cadc4 CFRunLoopRunInMode + 52
10 Hedgewars 0x001914e4 UIKit_PumpEvents
(SDL_uikitevents.m:49)
11 Hedgewars 0x00160eac SDL_PumpEvents (SDL_events.c:302)
12 Hedgewars 0x001917b4 UIKit_GL_SwapWindow
(SDL_uikitopengles.m:94)
13 Hedgewars 0x0018d3e8 SDL_GL_SwapWindow
(SDL_video.c:2550)
14 Hedgewars 0x00002e24 HWENGINE_DOTIMER$LONGINT + 456
15 Hedgewars 0x000e3264 -[GameInterfaceBridge
prepareEngineLaunch] (GameInterfaceBridge.m:160)
16 Hedgewars 0x000e35b0 -[GameInterfaceBridge
startLocalGame:] (GameInterfaceBridge.m:200)
17 Hedgewars 0x000a74dc
-[GameConfigViewController startGame:]
(GameConfigViewController.m:238)
18 Hedgewars 0x000a64dc
-[GameConfigViewController buttonPressed:]
(GameConfigViewController.m:55)
19 CoreFoundation 0x328d056a -[NSObject(NSObject)
performSelector:withObject:withObject:] + 18
20 UIKit 0x32405ec2 -[UIApplication
sendAction:to:from:forEvent:] + 78
21 UIKit 0x32492c1a
-[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86
22 CoreFoundation 0x328d056a -[NSObject(NSObject)
performSelector:withObject:withObject:] + 18
23 UIKit 0x32405ec2 -[UIApplication
sendAction:to:from:forEvent:] + 78
24 UIKit 0x32405e62 -[UIApplication
sendAction:toTarget:fromSender:forEvent:] + 26
25 UIKit 0x32405e34 -[UIControl
sendAction:to:forEvent:] + 32
26 UIKit 0x32405b86 -[UIControl(Internal)
_sendActionsForEvents:withEvent:] + 350
27 UIKit 0x3240641c -[UIControl
touchesEnded:withEvent:] + 336
28 UIKit 0x32404bee -[UIWindow
_sendTouchesForEvent:] + 362
29 UIKit 0x32404568 -[UIWindow sendEvent:] + 256
30 UIKit 0x323ed30c -[UIApplication sendEvent:] + 292
31 UIKit 0x323ecc4c _UIApplicationHandleEvent + 5084
32 GraphicsServices 0x33433e70 PurpleEventCallback + 660
33 CoreFoundation 0x32937a90
CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 20
34 CoreFoundation 0x32939838 __CFRunLoopDoSource1 + 160
35 CoreFoundation 0x3293a606 __CFRunLoopRun + 514
36 CoreFoundation 0x328caebc CFRunLoopRunSpecific + 224
37 CoreFoundation 0x328cadc4 CFRunLoopRunInMode + 52
38 GraphicsServices 0x33433418 GSEventRunModal + 108
39 GraphicsServices 0x334334c4 GSEventRun + 56
40 UIKit 0x32417d62 -[UIApplication _run] + 398
41 UIKit 0x32415800 UIApplicationMain + 664
42 Hedgewars 0x00193aa4 main (SDL_uikitappdelegate.m:55)
43 Hedgewars 0x00002c50 start + 32

i am trying to use SDL in my iOS application without any luck
i am using sdk 4.3 and SDL 1.3
any advices or suggestions?
thanks

What signal is being thrown? Does it crash with signal “0”, or SIGSEGV or
what?

Note that most unusual crashes in iOS are signal “0” crashes, when the OS
pulls the rug from under your app due to memory limitations. You’ve got to
be really conservative with memory on iOS, best to stay under 64 megs, under
40 is preferable, even on devices like the iPhone 4, with 512 megs of memory
:stuck_out_tongue: !!!

That’s for signal “0” crashes (which I can never get a stack trace for!).On Thu, Sep 15, 2011 at 4:17 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hi all,
I’ve finally been able to catch a weird crash that is happening in my
ios application.
After some minutes of testing on device the app misteriously crashes
– never happens on simulator. What I find strange is that this bug is
persistent, always happens after some time of playing but if i leave
the app on without interaction it never crashes.
From the limited information of the backtrace below all I can gather
is that something is ‘distubing’ the ios event queue, but I have no
idea how I can debug this further.
Is there any advice on how/what/why this is happening? Can anyone shed
some light on the event queue processing on ios?

thanks
Vittorio

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 CoreFoundation 0x32973708
___CFBasicHashFindBucket_Linear + 120
1 CoreFoundation 0x328c4db8 CFBasicHashRemoveValue +
368
2 CoreFoundation 0x328c69e2 CFSetRemoveValue + 54
3 CoreFoundation 0x328c63ae CFRunLoopRemoveTimer +
122
4 Foundation 0x338a169a __NSFireDelayedPerform +
310
5 CoreFoundation 0x32937a40
CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 8
6 CoreFoundation 0x32939ec4 __CFRunLoopDoTimer + 844
7 CoreFoundation 0x3293a83e __CFRunLoopRun + 1082
8 CoreFoundation 0x328caebc CFRunLoopRunSpecific +
224
9 CoreFoundation 0x328cadc4 CFRunLoopRunInMode + 52
10 Hedgewars 0x001914e4 UIKit_PumpEvents
(SDL_uikitevents.m:49)
11 Hedgewars 0x00160eac SDL_PumpEvents
(SDL_events.c:302)
12 Hedgewars 0x001917b4 UIKit_GL_SwapWindow
(SDL_uikitopengles.m:94)
13 Hedgewars 0x0018d3e8 SDL_GL_SwapWindow
(SDL_video.c:2550)
14 Hedgewars 0x00002e24 HWENGINE_DOTIMER$LONGINT

  • 456
    15 Hedgewars 0x000e3264 -[GameInterfaceBridge
    prepareEngineLaunch] (GameInterfaceBridge.m:160)
    16 Hedgewars 0x000e35b0 -[GameInterfaceBridge
    startLocalGame:] (GameInterfaceBridge.m:200)
    17 Hedgewars 0x000a74dc
    -[GameConfigViewController startGame:]
    (GameConfigViewController.m:238)
    18 Hedgewars 0x000a64dc
    -[GameConfigViewController buttonPressed:]
    (GameConfigViewController.m:55)
    19 CoreFoundation 0x328d056a -[NSObject(NSObject)
    performSelector:withObject:withObject:] + 18
    20 UIKit 0x32405ec2 -[UIApplication
    sendAction:to:from:forEvent:] + 78
    21 UIKit 0x32492c1a
    -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86
    22 CoreFoundation 0x328d056a -[NSObject(NSObject)
    performSelector:withObject:withObject:] + 18
    23 UIKit 0x32405ec2 -[UIApplication
    sendAction:to:from:forEvent:] + 78
    24 UIKit 0x32405e62 -[UIApplication
    sendAction:toTarget:fromSender:forEvent:] + 26
    25 UIKit 0x32405e34 -[UIControl
    sendAction:to:forEvent:] + 32
    26 UIKit 0x32405b86 -[UIControl(Internal)
    _sendActionsForEvents:withEvent:] + 350
    27 UIKit 0x3240641c -[UIControl
    touchesEnded:withEvent:] + 336
    28 UIKit 0x32404bee -[UIWindow
    _sendTouchesForEvent:] + 362
    29 UIKit 0x32404568 -[UIWindow sendEvent:] +
    256
    30 UIKit 0x323ed30c -[UIApplication
    sendEvent:] + 292
    31 UIKit 0x323ecc4c
    _UIApplicationHandleEvent + 5084
    32 GraphicsServices 0x33433e70 PurpleEventCallback +
    660
    33 CoreFoundation 0x32937a90
    CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 20
    34 CoreFoundation 0x32939838 __CFRunLoopDoSource1 +
    160
    35 CoreFoundation 0x3293a606 __CFRunLoopRun + 514
    36 CoreFoundation 0x328caebc CFRunLoopRunSpecific +
    224
    37 CoreFoundation 0x328cadc4 CFRunLoopRunInMode + 52
    38 GraphicsServices 0x33433418 GSEventRunModal + 108
    39 GraphicsServices 0x334334c4 GSEventRun + 56
    40 UIKit 0x32417d62 -[UIApplication _run] +
    398
    41 UIKit 0x32415800 UIApplicationMain + 664
    42 Hedgewars 0x00193aa4 main
    (SDL_uikitappdelegate.m:55)
    43 Hedgewars 0x00002c50 start + 32

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Unfortunately it receives a SIGSEGV signal; I sincerely doubt it is a
memory management problem, there is nothing being allocated when the
crash happens and when there is no user interaction, the app remains
on for a long time. Hence I believe there is some problem with the
event handling, most likely due to the transparent overlay I added to
the sdl view (with uikit buttons and so on).
Is there any way to safely debug this or can anyone better explain how
the event handling on ios works?
Best
VittorioOn Mon, Sep 19, 2011 at 10:51 AM, Jeremy Jurksztowicz wrote:

What signal is being thrown? Does it crash with signal “0”, or SIGSEGV or
what?
Note that most unusual crashes in iOS are signal “0” crashes, when the OS
pulls the rug from under your app due to memory limitations. You’ve got to
be really conservative with memory on iOS, best to stay under 64 megs, under
40 is preferable, even on devices like the iPhone 4, with 512 megs of memory
:stuck_out_tongue: !!!
That’s for signal “0” crashes (which I can never get a stack trace for!).

On Thu, Sep 15, 2011 at 4:17 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hi all,
I’ve finally been able to catch a weird crash that is happening in my
ios application.
After some minutes of testing on device the app misteriously crashes
– never happens on simulator. What I find strange is that this bug is
persistent, always happens after some time of playing but if i leave
the app on without interaction it never crashes.
From the limited information of the backtrace below all I can gather
is that something is ‘distubing’ the ios event queue, but I have no
idea how I can debug this further.
Is there any advice on how/what/why this is happening? Can anyone shed
some light on the event queue processing on ios?

thanks
Vittorio

Thread 0 name: ?Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32973708
___CFBasicHashFindBucket_Linear + 120
1 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328c4db8 CFBasicHashRemoveValue

  • 368
    2 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328c69e2 CFSetRemoveValue + 54
    3 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328c63ae CFRunLoopRemoveTimer +
    122
    4 ? Foundation ? ? ? ? ? ? ? ? ? ? ? ? ?0x338a169a __NSFireDelayedPerform
  • 310
    5 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32937a40
    CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 8
    6 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32939ec4 __CFRunLoopDoTimer +
    844
    7 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x3293a83e __CFRunLoopRun + 1082
    8 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328caebc CFRunLoopRunSpecific +
    224
    9 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328cadc4 CFRunLoopRunInMode + 52
    10 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x001914e4 UIKit_PumpEvents
    (SDL_uikitevents.m:49)
    11 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00160eac SDL_PumpEvents
    (SDL_events.c:302)
    12 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x001917b4 UIKit_GL_SwapWindow
    (SDL_uikitopengles.m:94)
    13 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x0018d3e8 SDL_GL_SwapWindow
    (SDL_video.c:2550)
    14 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00002e24
    HWENGINE_DOTIMER$LONGINT + 456
    15 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000e3264 -[GameInterfaceBridge
    prepareEngineLaunch] (GameInterfaceBridge.m:160)
    16 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000e35b0 -[GameInterfaceBridge
    startLocalGame:] (GameInterfaceBridge.m:200)
    17 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000a74dc
    -[GameConfigViewController startGame:]
    (GameConfigViewController.m:238)
    18 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000a64dc
    -[GameConfigViewController buttonPressed:]
    (GameConfigViewController.m:55)
    19 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328d056a -[NSObject(NSObject)
    performSelector:withObject:withObject:] + 18
    20 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405ec2 -[UIApplication
    sendAction:to:from:forEvent:] + 78
    21 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32492c1a
    -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86
    22 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328d056a -[NSObject(NSObject)
    performSelector:withObject:withObject:] + 18
    23 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405ec2 -[UIApplication
    sendAction:to:from:forEvent:] + 78
    24 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405e62 -[UIApplication
    sendAction:toTarget:fromSender:forEvent:] + 26
    25 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405e34 -[UIControl
    sendAction:to:forEvent:] + 32
    26 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405b86 -[UIControl(Internal)
    _sendActionsForEvents:withEvent:] + 350
    27 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x3240641c -[UIControl
    touchesEnded:withEvent:] + 336
    28 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32404bee -[UIWindow
    _sendTouchesForEvent:] + 362
    29 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32404568 -[UIWindow sendEvent:]
  • 256
    30 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x323ed30c -[UIApplication
    sendEvent:] + 292
    31 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x323ecc4c
    _UIApplicationHandleEvent + 5084
    32 ?GraphicsServices ? ? ? ? ? ? ? ? ? ?0x33433e70 PurpleEventCallback +
    660
    33 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32937a90
    CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 20
    34 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32939838 __CFRunLoopDoSource1 +
    160
    35 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x3293a606 __CFRunLoopRun + 514
    36 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328caebc CFRunLoopRunSpecific +
    224
    37 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328cadc4 CFRunLoopRunInMode + 52
    38 ?GraphicsServices ? ? ? ? ? ? ? ? ? ?0x33433418 GSEventRunModal + 108
    39 ?GraphicsServices ? ? ? ? ? ? ? ? ? ?0x334334c4 GSEventRun + 56
    40 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32417d62 -[UIApplication _run] +
    398
    41 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32415800 UIApplicationMain + 664
    42 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00193aa4 main
    (SDL_uikitappdelegate.m:55)
    43 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00002c50 start + 32

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Upon further testing I am finding out that there must be some
incompatibility with the sdl touch interface and the cocoa overlay
that I’ve added above it.
I’ve run the sdl app without it for a while, implementing SDL_TOUCH*
events handling and the app didn’t crash.
I find it very strange, the event queue should lose a touch event,
not making the app crash.
If this is absolutely new to everybody, do you think it is worthwhile
to submit a bugreport to apple?
Best
VittorioOn Tue, Sep 20, 2011 at 10:53 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

Unfortunately it receives a SIGSEGV signal; I sincerely doubt it is a
memory management problem, there is nothing being allocated when the
crash happens and when there is no user interaction, the app remains
on for a long time. Hence I believe there is some problem with the
event handling, most likely due to the transparent overlay I added to
the sdl view (with uikit buttons and so on).
Is there any way to safely debug this or can anyone better explain how
the event handling on ios works?
Best
Vittorio

On Mon, Sep 19, 2011 at 10:51 AM, Jeremy Jurksztowicz wrote:

What signal is being thrown? Does it crash with signal “0”, or SIGSEGV or
what?
Note that most unusual crashes in iOS are signal “0” crashes, when the OS
pulls the rug from under your app due to memory limitations. You’ve got to
be really conservative with memory on iOS, best to stay under 64 megs, under
40 is preferable, even on devices like the iPhone 4, with 512 megs of memory
:stuck_out_tongue: !!!
That’s for signal “0” crashes (which I can never get a stack trace for!).

On Thu, Sep 15, 2011 at 4:17 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hi all,
I’ve finally been able to catch a weird crash that is happening in my
ios application.
After some minutes of testing on device the app misteriously crashes
– never happens on simulator. What I find strange is that this bug is
persistent, always happens after some time of playing but if i leave
the app on without interaction it never crashes.
From the limited information of the backtrace below all I can gather
is that something is ‘distubing’ the ios event queue, but I have no
idea how I can debug this further.
Is there any advice on how/what/why this is happening? Can anyone shed
some light on the event queue processing on ios?

thanks
Vittorio

Thread 0 name: ?Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32973708
___CFBasicHashFindBucket_Linear + 120
1 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328c4db8 CFBasicHashRemoveValue

  • 368
    2 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328c69e2 CFSetRemoveValue + 54
    3 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328c63ae CFRunLoopRemoveTimer +
    122
    4 ? Foundation ? ? ? ? ? ? ? ? ? ? ? ? ?0x338a169a __NSFireDelayedPerform
  • 310
    5 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32937a40
    CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 8
    6 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32939ec4 __CFRunLoopDoTimer +
    844
    7 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x3293a83e __CFRunLoopRun + 1082
    8 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328caebc CFRunLoopRunSpecific +
    224
    9 ? CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328cadc4 CFRunLoopRunInMode + 52
    10 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x001914e4 UIKit_PumpEvents
    (SDL_uikitevents.m:49)
    11 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00160eac SDL_PumpEvents
    (SDL_events.c:302)
    12 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x001917b4 UIKit_GL_SwapWindow
    (SDL_uikitopengles.m:94)
    13 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x0018d3e8 SDL_GL_SwapWindow
    (SDL_video.c:2550)
    14 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00002e24
    HWENGINE_DOTIMER$LONGINT + 456
    15 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000e3264 -[GameInterfaceBridge
    prepareEngineLaunch] (GameInterfaceBridge.m:160)
    16 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000e35b0 -[GameInterfaceBridge
    startLocalGame:] (GameInterfaceBridge.m:200)
    17 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000a74dc
    -[GameConfigViewController startGame:]
    (GameConfigViewController.m:238)
    18 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x000a64dc
    -[GameConfigViewController buttonPressed:]
    (GameConfigViewController.m:55)
    19 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328d056a -[NSObject(NSObject)
    performSelector:withObject:withObject:] + 18
    20 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405ec2 -[UIApplication
    sendAction:to:from:forEvent:] + 78
    21 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32492c1a
    -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86
    22 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328d056a -[NSObject(NSObject)
    performSelector:withObject:withObject:] + 18
    23 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405ec2 -[UIApplication
    sendAction:to:from:forEvent:] + 78
    24 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405e62 -[UIApplication
    sendAction:toTarget:fromSender:forEvent:] + 26
    25 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405e34 -[UIControl
    sendAction:to:forEvent:] + 32
    26 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32405b86 -[UIControl(Internal)
    _sendActionsForEvents:withEvent:] + 350
    27 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x3240641c -[UIControl
    touchesEnded:withEvent:] + 336
    28 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32404bee -[UIWindow
    _sendTouchesForEvent:] + 362
    29 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32404568 -[UIWindow sendEvent:]
  • 256
    30 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x323ed30c -[UIApplication
    sendEvent:] + 292
    31 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x323ecc4c
    _UIApplicationHandleEvent + 5084
    32 ?GraphicsServices ? ? ? ? ? ? ? ? ? ?0x33433e70 PurpleEventCallback +
    660
    33 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32937a90
    CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 20
    34 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x32939838 __CFRunLoopDoSource1 +
    160
    35 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x3293a606 __CFRunLoopRun + 514
    36 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328caebc CFRunLoopRunSpecific +
    224
    37 ?CoreFoundation ? ? ? ? ? ? ? ? ? ? ?0x328cadc4 CFRunLoopRunInMode + 52
    38 ?GraphicsServices ? ? ? ? ? ? ? ? ? ?0x33433418 GSEventRunModal + 108
    39 ?GraphicsServices ? ? ? ? ? ? ? ? ? ?0x334334c4 GSEventRun + 56
    40 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32417d62 -[UIApplication _run] +
    398
    41 ?UIKit ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0x32415800 UIApplicationMain + 664
    42 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00193aa4 main
    (SDL_uikitappdelegate.m:55)
    43 ?Hedgewars ? ? ? ? ? ? ? ? ? ? ? ? ? 0x00002c50 start + 32

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

How are you reconciling the SDL event handling with Cocoa event handling? I
think that should be the first place to look for issues. Maybe when you try
to handle an event in cocoa you (or the event pump) are releasing it and
then when SDL tries to access it, the crash occurs.

I have been using only the SDL interface to iOS events with no problem thus
far. Looking at the cocoa code for mouse handling I see that SDL dequeues
the event, reads some data from it and then requeues without retaining or
releasing anything. Perhaps you can post the crash log or some code
demonstrating your event usage. If you’ve exhausted all possibilities then
by all means post a bug report.

Good luck.On Mon, Sep 26, 2011 at 3:17 PM, Vittorio G. <vitto.giova at yahoo.it> wrote:

Upon further testing I am finding out that there must be some
incompatibility with the sdl touch interface and the cocoa overlay
that I’ve added above it.
I’ve run the sdl app without it for a while, implementing SDL_TOUCH*
events handling and the app didn’t crash.
I find it very strange, the event queue should lose a touch event,
not making the app crash.
If this is absolutely new to everybody, do you think it is worthwhile
to submit a bugreport to apple?
Best
Vittorio

On Tue, Sep 20, 2011 at 10:53 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

Unfortunately it receives a SIGSEGV signal; I sincerely doubt it is a
memory management problem, there is nothing being allocated when the
crash happens and when there is no user interaction, the app remains
on for a long time. Hence I believe there is some problem with the
event handling, most likely due to the transparent overlay I added to
the sdl view (with uikit buttons and so on).
Is there any way to safely debug this or can anyone better explain how
the event handling on ios works?
Best
Vittorio

On Mon, Sep 19, 2011 at 10:51 AM, Jeremy Jurksztowicz <@Jeremy_Jurksztowicz> wrote:

What signal is being thrown? Does it crash with signal “0”, or SIGSEGV
or

what?
Note that most unusual crashes in iOS are signal “0” crashes, when the
OS

pulls the rug from under your app due to memory limitations. You’ve got
to

be really conservative with memory on iOS, best to stay under 64 megs,
under

40 is preferable, even on devices like the iPhone 4, with 512 megs of
memory

:stuck_out_tongue: !!!
That’s for signal “0” crashes (which I can never get a stack trace
for!).

On Thu, Sep 15, 2011 at 4:17 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hi all,
I’ve finally been able to catch a weird crash that is happening in my
ios application.
After some minutes of testing on device the app misteriously crashes
– never happens on simulator. What I find strange is that this bug is
persistent, always happens after some time of playing but if i leave
the app on without interaction it never crashes.
From the limited information of the backtrace below all I can gather
is that something is ‘distubing’ the ios event queue, but I have no
idea how I can debug this further.
Is there any advice on how/what/why this is happening? Can anyone shed
some light on the event queue processing on ios?

thanks
Vittorio

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 CoreFoundation 0x32973708
___CFBasicHashFindBucket_Linear + 120
1 CoreFoundation 0x328c4db8
CFBasicHashRemoveValue

  • 368
    2 CoreFoundation 0x328c69e2 CFSetRemoveValue +
    54

3 CoreFoundation 0x328c63ae CFRunLoopRemoveTimer

122
4 Foundation 0x338a169a
__NSFireDelayedPerform

  • 310
    5 CoreFoundation 0x32937a40
    CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 8
    6 CoreFoundation 0x32939ec4 __CFRunLoopDoTimer +
    844
    7 CoreFoundation 0x3293a83e __CFRunLoopRun +
    1082

8 CoreFoundation 0x328caebc CFRunLoopRunSpecific

224
9 CoreFoundation 0x328cadc4 CFRunLoopRunInMode +
52

10 Hedgewars 0x001914e4 UIKit_PumpEvents
(SDL_uikitevents.m:49)
11 Hedgewars 0x00160eac SDL_PumpEvents
(SDL_events.c:302)
12 Hedgewars 0x001917b4 UIKit_GL_SwapWindow
(SDL_uikitopengles.m:94)
13 Hedgewars 0x0018d3e8 SDL_GL_SwapWindow
(SDL_video.c:2550)
14 Hedgewars 0x00002e24
HWENGINE_DOTIMER$LONGINT + 456
15 Hedgewars 0x000e3264
-[GameInterfaceBridge

prepareEngineLaunch] (GameInterfaceBridge.m:160)
16 Hedgewars 0x000e35b0
-[GameInterfaceBridge

startLocalGame:] (GameInterfaceBridge.m:200)
17 Hedgewars 0x000a74dc
-[GameConfigViewController startGame:]
(GameConfigViewController.m:238)
18 Hedgewars 0x000a64dc
-[GameConfigViewController buttonPressed:]
(GameConfigViewController.m:55)
19 CoreFoundation 0x328d056a -[NSObject(NSObject)
performSelector:withObject:withObject:] + 18
20 UIKit 0x32405ec2 -[UIApplication
sendAction:to:from:forEvent:] + 78
21 UIKit 0x32492c1a
-[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86
22 CoreFoundation 0x328d056a -[NSObject(NSObject)
performSelector:withObject:withObject:] + 18
23 UIKit 0x32405ec2 -[UIApplication
sendAction:to:from:forEvent:] + 78
24 UIKit 0x32405e62 -[UIApplication
sendAction:toTarget:fromSender:forEvent:] + 26
25 UIKit 0x32405e34 -[UIControl
sendAction:to:forEvent:] + 32
26 UIKit 0x32405b86
-[UIControl(Internal)

_sendActionsForEvents:withEvent:] + 350
27 UIKit 0x3240641c -[UIControl
touchesEnded:withEvent:] + 336
28 UIKit 0x32404bee -[UIWindow
_sendTouchesForEvent:] + 362
29 UIKit 0x32404568 -[UIWindow
sendEvent:]

  • 256
    30 UIKit 0x323ed30c -[UIApplication
    sendEvent:] + 292
    31 UIKit 0x323ecc4c
    _UIApplicationHandleEvent + 5084
    32 GraphicsServices 0x33433e70 PurpleEventCallback

660
33 CoreFoundation 0x32937a90
CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 20
34 CoreFoundation 0x32939838 __CFRunLoopDoSource1

160
35 CoreFoundation 0x3293a606 __CFRunLoopRun + 514
36 CoreFoundation 0x328caebc CFRunLoopRunSpecific

224
37 CoreFoundation 0x328cadc4 CFRunLoopRunInMode +
52

38 GraphicsServices 0x33433418 GSEventRunModal +
108

39 GraphicsServices 0x334334c4 GSEventRun + 56
40 UIKit 0x32417d62 -[UIApplication
_run] +

398
41 UIKit 0x32415800 UIApplicationMain +
664

42 Hedgewars 0x00193aa4 main
(SDL_uikitappdelegate.m:55)
43 Hedgewars 0x00002c50 start + 32


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

For future history, the issue was found to be in the language binding (from
pascal to c): too little space got allocated for the different event sizes
and so when a ‘big’ event was received it corrupted the stack… fun times.
We fixed this by adding a 256byte event size as higher bound and stack
didn’t crash any more.

Cheers,
VittorioOn Mon, Sep 26, 2011 at 10:12 AM, Jeremy Jurksztowicz < jurksztowicz at gmail.com> wrote:

How are you reconciling the SDL event handling with Cocoa event handling?
I think that should be the first place to look for issues. Maybe when you
try to handle an event in cocoa you (or the event pump) are releasing it
and then when SDL tries to access it, the crash occurs.

I have been using only the SDL interface to iOS events with no problem
thus far. Looking at the cocoa code for mouse handling I see that SDL
dequeues the event, reads some data from it and then requeues without
retaining or releasing anything. Perhaps you can post the crash log or some
code demonstrating your event usage. If you’ve exhausted all possibilities
then by all means post a bug report.

Good luck.

On Mon, Sep 26, 2011 at 3:17 PM, Vittorio G. <vitto.giova at yahoo.it> wrote:

Upon further testing I am finding out that there must be some
incompatibility with the sdl touch interface and the cocoa overlay
that I’ve added above it.
I’ve run the sdl app without it for a while, implementing SDL_TOUCH*
events handling and the app didn’t crash.
I find it very strange, the event queue should lose a touch event,
not making the app crash.
If this is absolutely new to everybody, do you think it is worthwhile
to submit a bugreport to apple?
Best
Vittorio

On Tue, Sep 20, 2011 at 10:53 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

Unfortunately it receives a SIGSEGV signal; I sincerely doubt it is a
memory management problem, there is nothing being allocated when the
crash happens and when there is no user interaction, the app remains
on for a long time. Hence I believe there is some problem with the
event handling, most likely due to the transparent overlay I added to
the sdl view (with uikit buttons and so on).
Is there any way to safely debug this or can anyone better explain how
the event handling on ios works?
Best
Vittorio

On Mon, Sep 19, 2011 at 10:51 AM, Jeremy Jurksztowicz wrote:

What signal is being thrown? Does it crash with signal “0”, or SIGSEGV
or

what?
Note that most unusual crashes in iOS are signal “0” crashes, when the
OS

pulls the rug from under your app due to memory limitations. You’ve
got to

be really conservative with memory on iOS, best to stay under 64 megs,
under

40 is preferable, even on devices like the iPhone 4, with 512 megs of
memory

:stuck_out_tongue: !!!
That’s for signal “0” crashes (which I can never get a stack trace
for!).

On Thu, Sep 15, 2011 at 4:17 AM, Vittorio G. <vitto.giova at yahoo.it> wrote:

hi all,
I’ve finally been able to catch a weird crash that is happening in my
ios application.
After some minutes of testing on device the app misteriously crashes
– never happens on simulator. What I find strange is that this bug is
persistent, always happens after some time of playing but if i leave
the app on without interaction it never crashes.
From the limited information of the backtrace below all I can gather
is that something is ‘distubing’ the ios event queue, but I have no
idea how I can debug this further.
Is there any advice on how/what/why this is happening? Can anyone shed
some light on the event queue processing on ios?

thanks
Vittorio

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 CoreFoundation 0x32973708
___CFBasicHashFindBucket_Linear + 120
1 CoreFoundation 0x328c4db8
CFBasicHashRemoveValue

  • 368
    2 CoreFoundation 0x328c69e2 CFSetRemoveValue +
    54

3 CoreFoundation 0x328c63ae
CFRunLoopRemoveTimer +

122
4 Foundation 0x338a169a
__NSFireDelayedPerform

  • 310
    5 CoreFoundation 0x32937a40
    CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 8
    6 CoreFoundation 0x32939ec4 __CFRunLoopDoTimer

844
7 CoreFoundation 0x3293a83e __CFRunLoopRun +
1082

8 CoreFoundation 0x328caebc
CFRunLoopRunSpecific +

224
9 CoreFoundation 0x328cadc4 CFRunLoopRunInMode

  • 52

10 Hedgewars 0x001914e4 UIKit_PumpEvents
(SDL_uikitevents.m:49)
11 Hedgewars 0x00160eac SDL_PumpEvents
(SDL_events.c:302)
12 Hedgewars 0x001917b4 UIKit_GL_SwapWindow
(SDL_uikitopengles.m:94)
13 Hedgewars 0x0018d3e8 SDL_GL_SwapWindow
(SDL_video.c:2550)
14 Hedgewars 0x00002e24
HWENGINE_DOTIMER$LONGINT + 456
15 Hedgewars 0x000e3264
-[GameInterfaceBridge

prepareEngineLaunch] (GameInterfaceBridge.m:160)
16 Hedgewars 0x000e35b0
-[GameInterfaceBridge

startLocalGame:] (GameInterfaceBridge.m:200)
17 Hedgewars 0x000a74dc
-[GameConfigViewController startGame:]
(GameConfigViewController.m:238)
18 Hedgewars 0x000a64dc
-[GameConfigViewController buttonPressed:]
(GameConfigViewController.m:55)
19 CoreFoundation 0x328d056a
-[NSObject(NSObject)

performSelector:withObject:withObject:] + 18
20 UIKit 0x32405ec2 -[UIApplication
sendAction:to:from:forEvent:] + 78
21 UIKit 0x32492c1a
-[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86
22 CoreFoundation 0x328d056a
-[NSObject(NSObject)

performSelector:withObject:withObject:] + 18
23 UIKit 0x32405ec2 -[UIApplication
sendAction:to:from:forEvent:] + 78
24 UIKit 0x32405e62 -[UIApplication
sendAction:toTarget:fromSender:forEvent:] + 26
25 UIKit 0x32405e34 -[UIControl
sendAction:to:forEvent:] + 32
26 UIKit 0x32405b86
-[UIControl(Internal)

_sendActionsForEvents:withEvent:] + 350
27 UIKit 0x3240641c -[UIControl
touchesEnded:withEvent:] + 336
28 UIKit 0x32404bee -[UIWindow
_sendTouchesForEvent:] + 362
29 UIKit 0x32404568 -[UIWindow
sendEvent:]

  • 256
    30 UIKit 0x323ed30c -[UIApplication
    sendEvent:] + 292
    31 UIKit 0x323ecc4c
    _UIApplicationHandleEvent + 5084
    32 GraphicsServices 0x33433e70
    PurpleEventCallback +

660
33 CoreFoundation 0x32937a90
CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 20
34 CoreFoundation 0x32939838
__CFRunLoopDoSource1 +

160
35 CoreFoundation 0x3293a606 __CFRunLoopRun +
514

36 CoreFoundation 0x328caebc
CFRunLoopRunSpecific +

224
37 CoreFoundation 0x328cadc4 CFRunLoopRunInMode

  • 52

38 GraphicsServices 0x33433418 GSEventRunModal +
108

39 GraphicsServices 0x334334c4 GSEventRun + 56
40 UIKit 0x32417d62 -[UIApplication
_run] +

398
41 UIKit 0x32415800 UIApplicationMain

  • 664

42 Hedgewars 0x00193aa4 main
(SDL_uikitappdelegate.m:55)
43 Hedgewars 0x00002c50 start + 32


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org