alexey.m
alexey.m

Reputation: 1349

TestFlight TFLog exception crashing my app

I have a strange problem with TestFlight SDK. On iPhone5 I get this exception, app crashed.

Here is backtrace:

Reason: -[__NSArrayM length]: unrecognized selector sent to instance 0x20c76d80
UserInfo: (null)
Backtrace: (0x3abbc2a3 0x34aab97f 0x3abbfe07 0x3abbe531 0x3ab15f68 0x3591b0c1 0x996eb     0xb2b83 0x97b21 0x973ed 0x75913 0x83657 0x839e7 0x38eaf11f 0x38eb3961 0x38eb3ac1 0x35c18a11 0x35c188a4)
Stack symbols: (
0   CoreFoundation                      0x3abbc2bb <redacted> + 186
1   libobjc.A.dylib                     0x34aab97f objc_exception_throw + 30
2   CoreFoundation                      0x3abbfe07 <redacted> + 170
3   CoreFoundation                      0x3abbe531 <redacted> + 392
4   CoreFoundation                      0x3ab15f68 _CF_forwarding_prep_0 + 24
5   Foundation                          0x3591b0c1 <redacted> + 160
6   FlyerApp                            0x000996eb +[TFAirTrafficController logPath] + 102
7   FlyerApp                            0x000b2b83 -[TFMessagePackLogOperation writeLogData] + 50
8   FlyerApp                            0x00097b21 TFLogv + 92
9   FlyerApp                            0x000973ed TFLog + 60
10  FlyerApp                            0x00075913 -[KFRemoteLoadManager changesRequestFromDate:forDelegate:] + 834
11  FlyerApp                            0x00083657 -[KFSyncManager _startSync] + 574
12  FlyerApp                            0x000839e7 __31-[KFSyncManager tryToStartSync]_block_invoke_0132 + 54
13  libdispatch.dylib                   0x38eaf11f <redacted> + 10
14  libdispatch.dylib                   0x38eb3961 <redacted> + 252
15  libdispatch.dylib                   0x38eb3ac1 <redacted> + 84
16  libsystem_c.dylib                   0x35c18a11 <redacted> + 360
17  libsystem_c.dylib                   0x35c188a4 start_wqthread + 8
)

I suggest that code which cause this exception is next:

NSString *urlString = [NSString stringWithFormat:BASE_URL, [[KFLocalDataManager sharedManager] serverName]];
urlString = [[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByAppendingString:methodName];
NSURL *url = [NSURL URLWithString:urlString];
TTLog(@"Request URL - '%@'", url);

Where TTLog is

#define TTLog(__FORMAT__, ...) TFLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);

url string is url to server like this:

https://xxxxxx.xxxxxxx.com/xxxxx_xxxx/xxxx

This error occurs not every time but always in this place. I have several crash but I cannot see some similar environment for all same crash issues. Also this code running in not main app thread and sometimes in iOS background.

Maybe TFLog have some restrictions for incoming parameters or somebody receive same or similar exception with TestFlight?

Upvotes: 3

Views: 1038

Answers (1)

jasongregori
jasongregori

Reputation: 11656

I work at TestFlight on the SDK. @Nevir is correct. Unfortunately, TFLog is not thread safe. This issue has been recently brought to our attention. I'm working on an update that will fix this issue and hope to have a beta out soon. I'll keep you updated.

There is a new beta that fixes this issue: 1.3.0-beta. Get it here: https://testflightapp.com/sdk/download/ (look for "Feeling Adventurous?")

Upvotes: 3

Related Questions