Skip to main content

Smooth code, but SIGABRT



The crash log of SIGABRT from the device is pointing on the lines:







NSArray *results = [self.managedObjectContext executeFetchRequest:request &error];

if ([results count] > 0 ) { // SIGABRT on this line.







and (for the same device):







if (myfunc(myobj)) { // SIGABRT on this line.







where myobj is a pointer that must be nil from the app configuration, and it is initialized in the line just before the line of the crash. myfunc is a function looking like:







BOOL myfunc(id object) {

return object != nil;

}







so i would consider the second crash as







myobj = something

if (myobj != nil) { // SIGABRT on this line.







My knowledge is not enough to understand the possibility of such crashes (probably they're even random) on certain devices (on the most devices everything works fine and stable).





Anyone had such issues or have an experience debugging it ?


Comments

  1. There's no way how a pointer comparison can crash. Also, if myfunc is not a function pointer, if (myfunc(myobj)) cannot crash.

    The Objective-C code has not problems either.

    Are you sure you're interpreting the debugger's output correctly? Are the debugging symbols correct? Try turn off optimization.

    Maybe you are looking at the wrong stack: Check all thread's stacks.

    SIGABRT is a signal sent to tell the process that something's wrong. Maybe it's just iOS killing your app because memory is running out. Or the process hits abort() due to a failed assertion.

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.