Crash in backendless iOS SDK (malloc: *** error for object 0x1660c000: double free ***)

Hello Guys. We are using last version of your iOS SDK (3.0.44).
And we experience one type of crash constantly (every fifth launch of the app)
Crash occurs when find method is called.
For example,
BackendlessCollection *collection = [[self dataStore] find:query fault:&fault];
http://support.backendless.com/public/attachments/187442782100f8a0badbdd1e1e3dc062.png</img>

The same crash we got when we used paged queries.
http://support.backendless.com/public/attachments/be1139a239e4065c066f6a4f9bd4727b.png</img>

Hello Evgeny,

Please refer to below example how to use find method. Hope it will help you.
-(void)fetchingFirstPage {

NSLog(@"\n============ Fetching first page using the SYNC API ============");

@try {
   
    NSDate *startTime = [NSDate date];
    
    DataQueryBuilder *query = [[DataQueryBuilder alloc] init];
    NSArray *restaurants = [[backendless.persistenceService of:[Restaurant class]] find:query];
    
    NSNumber *restaurantCount = [[backendless.persistenceService ofTable:@"Restaurant"] getObjectCount:query];
    NSLog(@"Total restaurants in the Backendless storage - %@", restaurantCount);
    
    for (Restaurant *restuarant in restaurants) {
        NSLog(@"Restaurant name = %@", restuarant.name);
    }
    
    NSLog(@"Total time (ms) - %g", 1000*[[NSDate date] timeIntervalSinceDate:startTime]);
}

@catch (Fault *fault) {
    NSLog(@"Server reported an error: %@", fault);
}

}

I don’t see class DataQueryBuilder in the last version of your ios SDK

That was a snippet of Backendless 4.0 which of course does not apply to the currently released version of Backendless…

Replace DataQueryBuilder with BackendlessDataQuery. Also, the return type will be BackendlessCollection instead of NSArray.

When i use this code:
BackendlessDataQuery *query = [BackendlessDataQuery query];

BackendlessCollection *collection = [[backendless.persistenceService ofTable:@“Workout”] find:query];
i get dictionaries (NSDictionary) in collection.data array instead of backendless entities (”Workout" in this case). Is it expected behaviour? It looks strange cause old methods (for example, -(BackendlessCollection *)find:(BackendlessDataQuery *)dataQuery fault:(Fault **)fault;) return collection where property “data" contains objects inherited from BackendlessEntity.

It isn’t working. We experienced the same crash with suggested code ([[backendless.persistenceService ofTable:@“UnlockedExercise”] find:query] in our case)
Please give an answer as soon as possible.

com.guitarability.guitarabilitytest_issue_75_crash_8d3e0b1b932c473988bdca2b85f358c6_6300c6bd3e6149ebb9df974ca4e204fa_0_v1.txt (17.29kB)

Can you kindly let me know what the status is for this issue?

Hi Evgeny.

  1. If you use 'ofTable:@“Workout” ’ - it return NSDictionary, if ‘of:[“Workout” class]’ - backendless entities. It’s correct, documented behavior.
  2. Please provide your AppID and ‘query’ definition

Also there was another question that shoud be answered.
Can you kindly give any response here?

This is my message. Plesse, review it ONCE AGAIN.
It isn’t working. We experienced the same crash with suggested code ([[backendless.persistenceService ofTable:@“UnlockedExercise”] find:query] in our case)
Please give an answer as soon as possible.

com.guitarability.guitarabilitytest_issue_75_crash_8d3e0b1b932c473988bdca2b85f358c6_6300c6bd3e6149ebb9df974ca4e204fa_0_v1.txt (17.29kB)

Hi!
I’m looking forward to the response to my message:
It isn’t working. We experienced the same crash with suggested code ([[backendless.persistenceService ofTable:@“UnlockedExercise”] find:query] in our case)

Please, give me the update on this issue ASAP!!

Hello,

When you use code:
BackendlessCollection *collection = [[self dataStore] find:query fault:&fault];
you pass parameter ‘query’, please send to us description for ‘query’ in your case.
Also please provide your ApplicationID and we will test your ‘query’ find at your application environment.

BackendlessDataQuery *query = [BackendlessDataQuery query];

query.whereClause = @“user.objectId = ‘316D60CF-BF63-8DE2-FF08-18D49F778E00’ AND created > ‘1970-01-01 00:00:00 +0000’”;

QueryOptions *queryOptions = [QueryOptions new];

queryOptions.related = [NSMutableArray arrayWithObjects:@“exercise”, @“exercise.technique”, @“exercise.VideoLinks”, @“technique.videoLink”, @“technique.skill”, @“technique.skill.videoLink”, nil];

query.queryOptions = queryOptions;

App id = A649A321-BF0E-DC5E-FF3C-1BF7ADC6E000

Please, keep me updated how long it’ll take to test this.
Also, can you kindly provide me with the crash statistics after your testing?

Hi!
Please, let me know what is the progress on this issue ASAP.

Hi!
How is the testing going?
Please, let me know what is the progress on this issue ASAP.

Hi!
Hope you’re well.
Please, tell me when you could send me the answer.

Hi Evgeny,

The task is in progress, though it’s priority is currently low. We shall notify you as soon as we have any news. For now I can only suggest you to try to investigate the problem by yourself since our iOS SDK in open-source and available on GitHub: https://github.com/Backendless/ios-SDK