Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 138 forks source link

Andriod Apk crash when create cloudAnchor #402

Closed deno-wz closed 1 year ago

deno-wz commented 1 year ago

Description Andriod Apk crash when create cloudAnchor This bug appears infrequently, on average once in ten times,When this happens, the program exits directly to the phone screen。

Steps to reproduce the issue CloudNativeAnchor cna = anchorPointerObject?.GetComponent(); step one: NativeToClond if (cna.CloudAnchor == null) { await cna.NativeToCloud(); } step two: Collect environmental information while (!requreToStopCreateAnchor && createProgress < EnvScanRequire) { createProgress = cloudManager.SessionStatus.RecommendedForCreateProgress; finalResult = createProgress / EnvScanRequire; if (processInfo != null) processInfo("采集环境信息完成" + ((finalResult > 1.0f ? 1.0f : finalResult) * 100).ToString("f2") + "%", CloudAnchorInfoType.Start, finalResult > 1.0f ? 1.0f : finalResult); await Task.Delay(330); } stap three:CreateCloudAnchor,when the progeress grow to 100%, the crash accours.This bug appears infrequently, on average once in ten times. Most of the time it is successful to createcloudAnchor. await cloudManager.CreateAnchorAsync(cloudAnchor);

If the issue occurs in one of the ASA sample apps, please detail the steps required to reproduce it. Otherwise, provide details on how to reproduce it in your custom app.

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior 0001/01/01 00:00:00.000 -1 -1 Info --------- beginning of crash 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime FATAL EXCEPTION: UnityMain 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime Process: com.xunzhi.lyc.airtech, PID: 1735 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime java.lang.Error: 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime Version '2020.3.25f1c1 (fd09ccef852e)', Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a' 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime Build fingerprint: 'Xiaomi/mars/mars:11/RKQ1.201112.002/V12.5.20.0.RKACNXM:user/release-keys' 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime Revision: '0' 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime ABI: 'arm' 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime Timestamp: 2023-04-07 14:45:32+0800 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime pid: 1735, tid: 11163, name: Thread-80 >>> com.xunzhi.lyc.airtech <<< 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime uid: 10317 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime Cause: null pointer dereference 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime r0 00000000 r1 7baaeeb0 r2 00000001 r3 00000004 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime r4 7baaee80 r5 b3de6610 r6 00000000 r7 7baaeea8 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime r8 00000001 r9 7baaeeb0 r10 b3de65a0 r11 00000000 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime ip 00000000 sp 7baaee70 lr 91f537f9 pc 91f4f698 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime backtrace: 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #00 pc 0010c698 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #01 pc 001107f5 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #02 pc 001189d9 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #03 pc 00118957 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #04 pc 001186d7 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #05 pc 0011867b /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #06 pc 001182dd /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #07 pc 00118255 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #08 pc 001180b5 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #09 pc 00080a65 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #10 pc 0015bafb /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #11 pc 0015b241 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #12 pc 0015b05f /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #13 pc 0015afdb /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #14 pc 0015af6f /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #15 pc 0015af29 /data/app/~~d1fl-fFZO4tussGnvBSZgA==/com.xunzhi.lyc.airtech-nD4ZkePmUXiacHm_4NLLtA==/lib/arm/libazurespatialanchorsndk.so (BuildId: da96d9cfcd08760e68474973b322e403fc135ce1) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime #16 pc 000aa0bb /apex/com.android.runtime/lib/bionic/libc.so (pthread_attr_init+10) (BuildId: 6bed3a1f699b2a5987881b71f93456cd) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x10c698(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x1107f5(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x1189d9(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x118957(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x1186d7(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x11867b(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x1182dd(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x118255(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x1180b5(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x80a65(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x15bafb(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x15b241(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x15b05f(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x15afdb(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x15af6f(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libazurespatialanchorsndk.0x15af29(Native Method) 2023/04/07 14:45:32.341 1735 9959 Error AndroidRuntime at libc.pthread_attr_init(pthread_attr_init:10) A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Development information (please complete the following information) Visual Studio 2019, Unity 2020.3.25f1

AR Device information (please complete the following information): xiaomi11,SamsungS20,HUAWEIMate20

Additional context

Add any other context about the problem here.

deno-wz commented 1 year ago

Here is crash video

https://user-images.githubusercontent.com/49440476/232396924-c589f1b1-5f0d-4888-aded-87999c5f6e20.mp4

darax commented 1 year ago

hi @deno-wz, can you try 2.14.1?

deno-wz commented 1 year ago

Yes,I have tried,it actually works,thank you very much. Can you tell me more details about how you fixed,does it related to ARFoundtion's ARState,thank you.

darax commented 1 year ago

I'm not certain for this one, but it is more likely that ASA had some inconsistent state between the SDK and the service regarding how much data needed to be available to create an anchor.

deno-wz commented 1 year ago

There are two questions I want to know:

  1. For version 2.13.3, when the RecommendedForCreateProgress>1.0, immediately,I shake the phone ,thie ARFoundtion's ARState changed and" ARSession.state != ARSessionState.SessionTracking", but the application is executing "await cloudManager.CreateAnchorAsync(cloudAnchor);" then app crashed. the same to await CloudManager.createWatch() ,so I guess the ARSession.state change affect createAnchorAsync. But version 2.14.1 works well when I shake the phone violently. I really don't know why?
  2. For any version, when the application executes "await cloudManager.CreateAnchorAsync(cloudAnchor);" before created sucess, There is a stuck and stopped phenomenon about 2 seconds in the phone in my app. in the demo about 0.5 seconds. Is it relate to the service‘s thread or something. Thank you!