ReaderReferenceCache crashes coming from Backendless iOS SDK?

I keep receiving crashes that originate from a class named ReaderReferenceCache. I don’t use such a class directly so I believe they originate from Backendless which seems to use it
There are also crashes from HttpEngine which is also found in the SDK.

I’m using the latest v5.5.0. Here are the crash logs: com.helpapaw.helpapaw_issue_crash_1a6e0c31ad3c4229808bc8ae425e89d1_DNE_0_v2.txt (9.3 KB) com.helpapaw.helpapaw_issue_crash_52479a793ddd4a34b23d133f9de6068f_DNE_0_v2.txt (11.2 KB) com.helpapaw.helpapaw_issue_crash_a1da8e0f9f684febbcf2da2e593b29d9_DNE_0_v2.txt (9.6 KB) com.helpapaw.helpapaw_issue_crash_a6cfd46471894a57a2786cbe470e8f11_DNE_0_v2.txt (8.0 KB) com.helpapaw.helpapaw_issue_crash_f37422428b9d4537a3b4b76547454ca4_DNE_0_v2.txt (9.2 KB)

Let me know if you need more info!

Hello,

According to your logs crashes appear when calling different methods - the lookup method (called, when initialising the offline mode) and save method.
I’ve tried to call them in my own test project and they works fine, so
I’d like to ask you to provide the steps this issue could be reproduced on your project (I assume it is here https://github.com/HelpAPaw/FriendsInNeed, but if not please provide).

Did these crashes occur using the previous version of iOS_SDK 5.4.x?

Regards,
Olha

Hi Olha,

Yes, this crashes occurred in previous SDK versions, too. Unfortunately, I don’t have the steps for reproduction since these are user crashes that I receive in Crashlytics :frowning:

Unfortunately we cannot provide a support without those steps, because no issue occurs in our tests…

Regards,
Olha

So how should we deal with these crashes?

Hi @milen-marinov

Can you please specify your Crashlytics version?

Best Regards,
Maksym

Hi,

I’m using the current latest versions:
Using Crashlytics (3.14.0)
Using Fabric (1.10.2)

Hello,

I’ve checked your project (downloaded it from github: https://github.com/HelpAPaw/FriendsInNeed) and I’m a little bit confused.
Some of the logs you provided contains these lines:

7  Help A Paw      0x10017b0c8 +[RTHelper lookup] + 33 (RTHelper.m:33)
8  Help A Paw      0x1001541d4 __26-[RTClient connectSocket:]_block_invoke + 91 (RTClient.m:91)

but I couldn’t find any RT mention in your code. Maybe I’m looking into the incorrect branch (master) or maybe you can help me with finding the desired line of code where RT is mentioned…

Regards,
Olha

Hi,

I am not calling RTHelper or RTClient directly in my code. I’m using only documented classes and methods so this may be the result of such a call. I don’t know if the SDK makes any synchronization on its own but this is another possibility.

Best,
Milen

I am not calling RTHelper or RTClient directly in my code. I’m using only documented classes and methods so this may be the result of such a call.

Yes, I understand. But RT can be connected only these ways:
for DataService:

EventHandler *rtHandler = [backendless.data ofTable:@"TABLE-NAME"].rt;
EventHandler *rtHandler = [backendless.data of:[YOUR-CLASS class]].rt;

and MessagingService:

Channel *channel = [backendless.messaging subscribe:@"ChannelName"];

and I don’t see these calls in your project.
So it’s weird for me that logs contain those lines with RT. That’s why I’ve asked to provide the lines of code where the RT subscription is conceived.

Regards,
Olha

That is strange! I’m not using [backendless.messaging subscribe:] anywhere in my code. I do use [backendless.data ofTable:] and [backendless.data of:] but I don’t obtain the EventHandler. All the calls to Backendless SDK pass through FINDataManager so what you see there are all direct references to the SDK.

Yeah, it seems weird because RT inits only on first subscription call, it couldn’t be inited on its own - just checked it once more to make sure.

I’m not familiar with the SDK code but took a look and found the following references to the RTFactory singleton:

I may be wrong but it looks like using the data service indirectly initializes RTFactory

Yes, we do init the rt property of the MapDrivenDataStore and DataStoreFactory classes, but the RTClient methods aren’t called from there. The EventHandler initialisation only setups the necessary properties for the further work:

-(instancetype)initWithTableName:(NSString *)tableName withEntity:(Class)tableEntity dataStoreType:(UInt32)dataStoreType {
    if (self = [super init]) {
        table = tableName;
        entity = tableEntity;
        dataStore = dataStoreType;
    }
    return self;
}

and the methods mentioned in logs

7  Help A Paw      0x10017b0c8 +[RTHelper lookup] + 33 (RTHelper.m:33)
8  Help A Paw      0x1001541d4 __26-[RTClient connectSocket:]_block_invoke + 91 (RTClient.m:91)

are called only on subscription, not on the rt property initialisation - I’ve already checked it.