Skip to content

EXC_BAD_ACCESS adding to KSPromise callbacks #52

@chrisellsworth

Description

@chrisellsworth

I'm seeing a bunch of these crashes at various places throughout our app:

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000
Thread : Crashed: com.apple.main-thread
0  CoreFoundation                 0x18301a698 -[__NSArrayM insertObject:atIndex:] + 504
1  my-app                         0x10028f870 -[KSPromise then:error:] (KSPromise.m:124)

The offending line, KSPromise.m:124, reads [self.callbacks addObject:callbacks];. Seems like self.callbacks has disappeared by the time we call -[KSPromise then:error:]. I suspect our misusage of the library might be at fault. Any idea of what usage pattern might cause something like this? Perhaps multiple attempts at resolution? We do have this plugged into an asynchronous API that is known to call its own callbacks more than once, so I could see how this could be the case.

Running KSDeferred 0.3.0 via CocoaPods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions