setStayLoggedIn iOS SDK causes crash

Without any changes to my code, today I got crashes which I can replicate every time:

  1. Remove app
  2. Compile/run app
  3. Login in backendless with backendless.userService.setStayLoggedIn(true)
  4. Stop application (really quite it)
  5. start application again -> Crash

When I comment out the backendless.userService.setStayLoggedIn(true) line everything works fine.

Crash shows;

ProProject`+[AMFSerializer filePath:]:
0x1002c1208 <+0>: stp x29, x30, [sp, #-16]!
0x1002c120c <+4>: mov x29, sp
0x1002c1210 <+8>: sub sp, sp, #48
0x1002c1214 <+12>: movz x8, #0x9
0x1002c1218 <+16>: orr x9, xzr, #0x1
0x1002c121c <+20>: orr w10, wzr, #0x1
0x1002c1220 <+24>: stur x0, [x29, #-8]
0x1002c1224 <+28>: stur x1, [x29, #-16]
0x1002c1228 <+32>: str x2, [sp, #24]
0x1002c122c <+36>: mov x0, x8
0x1002c1230 <+40>: mov x1, x9
0x1002c1234 <+44>: and w2, w10, #0x1
0x1002c1238 <+48>: bl 0x10035921c ; symbol stub for: NSSearchPathForDirectoriesInDomains
-> 0x1002c123c <+52>: movz x8, #0
0x1002c1240 <+56>: adrp x9, 358
0x1002c1244 <+60>: add x9, x9, #3944
0x1002c1248 <+64>: str x0, [sp, #16]
0x1002c124c <+68>: ldr x0, [sp, #16]
0x1002c1250 <+72>: ldr x1, [x9]
0x1002c1254 <+76>: mov x2, x8
0x1002c1258 <+80>: bl 0x100359924 ; symbol stub for: objc_msgSend
0x1002c125c <+84>: adrp x8, 363
0x1002c1260 <+88>: add x8, x8, #3640
0x1002c1264 <+92>: str x0, [sp, #8]
0x1002c1268 <+96>: ldr x9, [sp, #8]
0x1002c126c <+100>: ldr x0, [sp, #24]
0x1002c1270 <+104>: ldr x1, [x8]
0x1002c1274 <+108>: mov x8, sp
0x1002c1278 <+112>: str x0, [x8]
0x1002c127c <+116>: adrp x2, 267
0x1002c1280 <+120>: add x2, x2, #416
0x1002c1284 <+124>: mov x0, x9
0x1002c1288 <+128>: bl 0x100359924 ; symbol stub for: objc_msgSend
0x1002c128c <+132>: mov sp, x29
0x1002c1290 <+136>: ldp x29, x30, [sp], #16
0x1002c1294 <+140>: ret

Does the crash occur if you do setStayLoggedIn(false) ?

Nope, then it works fine.

Something must’ve changed on the device because changing it from true to false does not impact how client communicates with the server.

Im having this problem on all my devices / simulators.

If it is set to true the app crashes directly after backendless.initApp(APP_ID, secret:SECRET_KEY, version:VERSION_NUM) is called.

All other code has been disabled.

Stack Trace:

#90x000000010dcee798 in +[RequestParser readData:context:] at /Users/slava/Documents/Projects/WebORBiOS/CommLibiOS/weborb/Protocols/Amf/RequestParser.m:74
#100x000000010dcf7e1c in -[V3ObjectReader read:context:] at /Users/slava/Documents/Projects/WebORBiOS/CommLibiOS/weborb/Reader/V3ObjectReader.m:109
#110x000000010dcee765 in +[RequestParser readData:context:] at /Users/slava/Documents/Projects/WebORBiOS/CommLibiOS/weborb/Protocols/Amf/RequestParser.m:72
#120x000000010dcee651 in +[RequestParser readData:version:] at /Users/slava/Documents/Projects/WebORBiOS/CommLibiOS/weborb/Protocols/Amf/RequestParser.m:57

I could not reproduce the problem. Here’s what I did:

  1. Generated login app using Backendless Code Generator:
    http://support.backendless.com/public/attachments/479322d133d0b0baedc7bb4bdbe94c42.jpg</img>

  2. Ran the code without any changes - the code is automatically configured to work with the app for which it was created. The generated code also supports the setStayLoggedIn method:
    http://support.backendless.com/public/attachments/57abbc9ccba779a8182f86b634c05de7.jpg</img>

  3. Once I enter a valid user for the app and click login, the code works just fine without any errors:
    http://support.backendless.com/public/attachments/c053e7a91b1f7d8e13a41325cc7d3724.jpg</img>

You could try the same with your app. Also, when you do this, use backendless.a from the generated app. We will update the downloadable package on our website shortly.

Regards,
Mark

I Used code generation in the exact same way as you did -> extracted -> compiled -> logged in -> quit the application. Rebuild (run) the app again -> crash. See screenshot.

I might have to do with the way the backendless database is setup? (I use a custom user property that is a one to many to the group entity, which is set to autoload).

Try creating a brand new app and do the codegen for it. I just want to isolate the device as the root cause of the problem.

And now I got it confirmed! When I turnoff autoload for the groups field in the user table: No more crashing.

Problem is: I need it to autoload :slight_smile:

Any way to solve this?

Not needed, see my next reply!

Now if you turn on an autoload for the groups in Users table - you have to turn off an autoload for the users in BLGroups table, and vice versa.

We are going to investigate this issue ASAP and we will let you know about.

Thanks a lot!

Great support guys!