1

Unable to determine what is going on with this error.

I am uploading a file in multiple segments.

I have threaded my api calls into 7 concurrent threads.

Here is the assembly code that it stops at.

Assembly Code

Here is my printed stack trace

Printed Stack Trace

Finally the Stack window

Stack Window

I do not have any DISPATCH_QUEUE_PRIORITY_LOW except for a #define for dispatch_get_low() and I do not have any calls to dispatch_get_low()

as a little background, I am developing my app from xcode 4.4 and recently installed GM Seed 4.5 to test on ios 6. All of my code is still ios5 and this bug plagued me before and after the update of xcode.

UPDATE

After adding back NSZombieEnabled YES to my environment variables

NSZombieEnabled environment variable

I was presented with a different error in much the same fashion, This one however is called forwarding

Assembly breakpoint

Breakpoint Assembly

Stack Trace Printout

Stack Trace Printout

Call Stack Window

Call Stack Window

I am still at a loss as to what is actually going on.

I am still investigating. any further assistance will be much appreciated.

==== New Developments ====

Apparently while trying to get some output of the malloc calls. I completely alleviated the bug.

This is disheartening because I dont think I can compile for release with this flag enabled.

enter image description here

the EXC_BAD_ACCESS no longer appears, therefore the log is going to be useless. This bug is turning out to be the weirdest problem I have faced yet, And I have faced a lot of weird iOS bugs.

Update again

I have been tracking this error down. Turns out the object being a problem is a -[CFNumber release] call The number is being created in a block, then being passed down to the delegate.

It may also be combined with the Core Data object saving and then going away.

I have added a method HSLogBrute(@"") which logs the line number and filename.

I have tracked it down to the following code.

    if (progressMatch > progressPercent){
        HSLogBrute(@"");
        TransferStatus *transferStatus = [TransferStatus objectByID:task.transferStatusID];
        HSLogBrute(@"");
        transferStatus.segmentsTransferred = [NSNumber numberWithInt:segmentsTransferred.intValue];
        HSLogBrute(@"");
        transferStatus.segmentsTotal = [NSNumber numberWithInt:segmentsTotal.intValue];
        HSLogBrute(@""); // This is the last log I am getting.
        [transferStatus save];
        HSLogBrute(@"");
    }
    HSLogBrute(@"");// Before putting in the [NSNumber numberWithInt:] calls this was the last line.
The Lazy Coder
  • 11,560
  • 4
  • 51
  • 69
  • 4
    Have you tried NSZombies yet? – brynbodayle Sep 14 '12 at 18:22
  • I put that in a long time ago. I will ensure it still has this in the app. – The Lazy Coder Sep 14 '12 at 18:22
  • See here to know how to enable that properly http://stackoverflow.com/questions/5386160/how-to-enable-nszombie-in-xcode – brynbodayle Sep 14 '12 at 18:25
  • make sure the block you are trying to execute is valid. I've had bad access memory problems when trying to execute bad blocks. – J2theC Sep 14 '12 at 18:28
  • well the blocks should be getting retained and released by their enclosing blocks. I have added `BlockType block = [blockVar copy];` to enable the copy and let the stack block go away. but I do not see any improvement. – The Lazy Coder Sep 14 '12 at 18:31
  • After adding the MallocStackLoggingNoCompact it stopped crashing. but that is not very helpful from a development or debugging standpoint. – The Lazy Coder Sep 14 '12 at 20:06
  • Looks like the isa pointer in your object has been zero'd out somehow... (just a guess) – nielsbot Sep 14 '12 at 20:57
  • What would be your recommendation on finding out what is zeroed out? As there is no stack information and not really any memory addresses. Is there some command you know of that I can run in the lldb prompt that will give me more information ? – The Lazy Coder Sep 14 '12 at 21:13
  • I have updated the post with more information. It appears to be linked slightly to my coredata object. – The Lazy Coder Sep 14 '12 at 21:47

1 Answers1

0

Turns out we were creating an NSMutableDictionary and using numbers within it. Creating and Destroying NSNumbers as fast as we were doing seems to have confused arc at some point. And the objects were being retained and released out of order.

My solution has been to create a custom object that has the numbers that I need within it. And increment and decrement those primitive number types rather than create and destroy so many NSNumber values.

The Lazy Coder
  • 11,560
  • 4
  • 51
  • 69