osx persistentService Save throws EXC_BAD_ACCESS (code=1, address=0x...) at random

Hello,
I’m writing an OSX app using Backendless. I have a view inside of my master view controller with a button in it. When that button is pressed, I call the following from the inner view’s controller:

- (void)createRequestForFixture:(Fixture *)fixture andSku:(Sku *)sku {
//CREATE ACTION
Action *action = [Action new];
if (sku) {
action.sku = sku;
}
action.type = [NSNumber numberWithInt:ACTION_TYPE_REQUEST];
action.status = [NSNumber numberWithInt:ACTION_STATUS_NONE];
Fault *error;
if (backendless.persistenceService == nil) {
NSLog(@"Shucks");
}
id<IDataStore> actionDataStore = [backendless.persistenceService of:[Action class]];
Action *savedAction = [actionDataStore save:action fault:&error];
if (error || savedAction == nil){
NSLog(@"Darn:%@", error.detail);
return;
}
//CREATE TICKET
Ticket *ticket = [Ticket new];
ticket.store = fixture.store;
ticket.status = [NSNumber numberWithInt:TICKET_STATUS_OPEN];
ticket.fixture = fixture.user;
if (ticket.actions == nil) {
ticket.actions = [NSArray arrayWithObject:savedAction];
} else {
NSMutableArray *newActions = [NSMutableArray arrayWithArray:ticket.actions];
[newActions addObject:savedAction];
ticket.actions = newActions;
}
id<IDataStore> ticketDataStore = [backendless.persistenceService of:[Ticket class]];
Ticket *savedTicket = [ticketDataStore save:ticket fault:&error];
if (error) {
NSLog(@"Darn: %@", error.detail);
}
// return ticket;
}

It always runs fine the first button press, but then randomly between 2-20 presses it throws a EXC_BAD_ACCESS error on one of the two saves (line 14, 32) above. No fault is printed or returned, and it appears to crash in [LicenseManager isBackendlessBehaviourResponse].
From what I’ve seen so far, the only thing that is different during the crash is that in [PersistentService save:error], self = nil during the crash state, where otherwise it is equal to the object being saved. There is always a non-nil object being passed to the save function.
I have attached a photo of the stack trace. Also attached a photo of the line the error occured, showing the object that is being passed to it.
Any help is much appreciated!

Hi Steven,

Do you use it with the Cloud or the Standalone version of Backendless?

Also, how recent was your download of our SDK?

Regards,
Mark

Hi Mark,

Thanks for the quick reply.
The SDK I’m using was downloaded today, and I’m using the Cloud.
I actually made a Podspec that gets grabs the newest SDK for me. (~> 3.0.0)

Thanks, Steven. I would need to pass it to an iOS engineer for further investigation. Do you think you could package a project for us so we could run it to reproduce the problem? If so, please zip it up and upload to google drive or dropbox and send an email to support@backendless.com with a link to this support topic.

Thanks!
Mark

Hi Steven,

I tried running the app and got the following errors. In the end I get a blank window with nothing on it. Any ideas?

2016-05-02 15:19:28.672 KL-Living-Wall[21088:24410790] ### Failed to load Addressbook class CNContactNameFormatter

2016-05-02 15:19:28.787 KL-Living-Wall[21088:24410790] Unknown class NSDocumentView in Interface Builder file at path /Users/mark/Library/Developer/Xcode/DerivedData/KL-Living-Wall-bqrtvethtarlucfysfqmbujcqilv/Build/Products/Debug/KL-Living-Wall.app/Contents/Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib.

2016-05-02 15:19:28.836 KL-Living-Wall[21088:24410790] Could not connect action, target class ViewController does not respond to -vannaWhiteModeToggle:

2016-05-02 15:19:28.837 KL-Living-Wall[21088:24410790] Could not connect action, target class ViewController does not respond to -hibernationDisable:

Hey Mark,

Ya, i really stripped down the project to send it to you so it would not be too large.
The blank screen is actually a button (not the most user friendly, sorry).

Just keep clicking on the blank screen and the error will eventually be thrown.

You’re right! I got the error. Thanks for sending the project, it will help in getting this resolved.

Excellent! Thank you!

<Comment Deleted>

This issue is fixed, please update Backendless SDK from github (CommLib & backendless).

Just tried it, working perfectly now! Thank you very much for the quick support!