iOS Crash Debugging Help

89 views
Skip to first unread message

luke...@gmail.com

unread,
Jun 23, 2014, 11:34:05 AM6/23/14
to codenameone...@googlegroups.com
After a lot of testing, debugging, and switching between different iOS options like newPipeline and newVM I'm completely stumped as to what is causing this crash.
I've never done iOS development before this, and so I'm really new to debugging a real iOS device.

With ios.newVM, it displays the initial screen than fades completely black (crashes).
And it crashes less often with newPipeline.

Any advice on where to start, or what I should do would be helpful.
I have the device output and crash logs from xcode, not sure how to (if possible) get the symbol names from the stack traces.

Version:             0.3 (0.3)
Code Type:           ARM (Native)
Parent Process:      launchd [1]

Date/Time:           2014-06-23 10:17:39.634 -0400
OS Version:          iOS 7.1.1 (11D201)
Report Version:      104

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xd71b2b9a
Triggered by Thread:  0

Thread 0 also seems to be the EDT
0-8 My App (Only memory addresses, no symbol names)
9   UIKit                         0x31b9950c -[UIApplication _handleApplicationSuspend:eventInfo:] + 876
10  UIKit                         0x31b1b22e -[UIApplication handleEvent:withNewEvent:] + 886
11  UIKit                         0x31b1adf4 -[UIApplication sendEvent:] + 68
12  UIKit                         0x31b7f400 _UIApplicationHandleEvent + 612
13  GraphicsServices               0x34162b52 _PurpleEventCallback + 606
14  GraphicsServices               0x3416273a PurpleEventCallback + 30
15  CoreFoundation                 0x2f2b1844 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
16  CoreFoundation                 0x2f2b17de __CFRunLoopDoSource1 + 342
17  CoreFoundation                 0x2f2affaa __CFRunLoopRun + 1402
18  CoreFoundation                 0x2f21a764 CFRunLoopRunSpecific + 520
19  CoreFoundation                 0x2f21a546 CFRunLoopRunInMode + 102
20  GraphicsServices               0x341616ce GSEventRunModal + 134
21  UIKit                         0x31b7988c UIApplicationMain + 1132
22-26  My App (Only memory addresses, no symbol names)
27  libdyld.dylib                 0x3a3d0ab4 start + 0

The crashes seem to happen randomly, after something loads, so its really hard to determine whats causing it.
And I can't recreated it anywhere outside of iOS, its working fine on native android devices (tested 4 so far), and the simulator.

Shai Almog

unread,
Jun 24, 2014, 1:00:37 AM6/24/14
to codenameone...@googlegroups.com, luke...@gmail.com
There are some issues with the new VM which we recently improved that might resolve the crash on startup.
Thread 0 is usually the native dispatch thread so its very likely the native code is crashing the question is why.

If you can provide some details on what your application does in those areas where it crashes I can start venturing guesses which we can test via a process of elimination.

luke...@gmail.com

unread,
Jun 24, 2014, 12:15:46 PM6/24/14
to codenameone...@googlegroups.com, luke...@gmail.com
A client wanted an app designed that pulls data from a forum like website, and displays it.
And also has modules for various things defined on the website, that are also displayed on the app.
So almost every form in the app downloads from a website and than displays various types of objects, buttons, text fields, and images.
The crashes ALWAYS happen right before its about to update the UI with the new content.

I see the form created, displaying various spinners and loading messages,
and than it fades to block or locks up entirely with the console saying its sending the data back to the UI thread to render.

So I'm guessing I've overloaded the network thread or something, really not sure.
with newVM set to true, it crashes on the landing form, with a few bits loaded and a few showing spinners.
with newVM set to false, it crashes almost randomly, you can use it, go into various areas of the app,
and after a while it crashes the same way newVM does, just before its about to do a layout update due to something it loaded off the website.
And for w,e reason, it crashes less often with the new pipeline which makes me think its something with how it renders, my app is modifying the UI a LOT during the initial load of a form,
I wouldn't doubt it ends up pretty much recreating the form after the initial render quite a few times as things load or read from cache.

Also I noticed the build server also sends out sources, I'm considering trying to load the iOS source your build server generates into xcode and tracking down the issue myself,
I have a few more features to finish up before I do anything like that though, but if I do figure this out I'll post the changes I had to make here.

I want to avoid giving too much source or detail because I agreed to a non-disclosure on this.
But I'm sure we could work something out to share the full source privately.

Its heavily based off android source I wrote originally, before I realized how horrible iOS development was going to be and just moved to cn1...

luke...@gmail.com

unread,
Jun 24, 2014, 12:33:18 PM6/24/14
to codenameone...@googlegroups.com, luke...@gmail.com
I just tried building with newVM again, its still crashing the exact same way at startup.

Shai Almog

unread,
Jun 24, 2014, 1:26:47 PM6/24/14
to codenameone...@googlegroups.com, luke...@gmail.com
We're improving the new VM with issues from various developers so it should be pretty stable in a few weeks time.
If this still doesn't work after the next server update contact us on the support email and we'll try to help.

luke...@gmail.com

unread,
Jun 24, 2014, 1:49:28 PM6/24/14
to codenameone...@googlegroups.com, luke...@gmail.com
I just downloaded the source code fro the build server and ran it in the iOS simulator of xcode:
With newVM it crashes here:
cn1_globals.m line 183

void retainObj(JAVA_OBJECT o) {
    if(o == JAVA_NULL) {
        return;
    }
    if(o->__codenameOneReferenceCount > 999990) {
        return;
    }
    
    //lockCriticalSection();
    (*o).__codenameOneReferenceCount++;
    //unlockCriticalSection();
}


Without newVM I can't actually get a stack trace, it won't crash for me the way it does on the iPad, instead of locks up but the other threads still output.

Shai Almog

unread,
Jun 25, 2014, 12:35:42 AM6/25/14
to codenameone...@googlegroups.com, luke...@gmail.com
We have a reproduction of that specific crash (although it might be a different crash). Seems to be a regression from the last update. We're looking into it.

Steve Hannah

unread,
Jun 25, 2014, 9:50:37 AM6/25/14
to codenameone...@googlegroups.com, luke...@gmail.com
You need to find out exactly *where* it is crashing.  Then either the solution will be clear to you - or you can provide that information to Shai et al, and they can do something on their end.

On iOS this can be a difficult task, because you may need to resort to the old "Log.p("I'm here now")" style debugging.   If you are on a Mac, you can use Xcode to view the output console of your phone.  

Steve


On Tue, Jun 24, 2014 at 9:33 AM, <luke...@gmail.com> wrote:
I just tried building with newVM again, its still crashing the exact same way at startup.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/fb09d9ab-302f-48ee-b3c5-1349466e8722%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Web Lite Solutions Corp.
Reply all
Reply to author
Forward
0 new messages