google-ar / WebARonARCore

An experimental Chromium modification in the form of an app for Android that lets developers build Augmented Reality (AR) experiences using web technologies on top of Google's ARCore.
https://developers.google.com/ar/develop/web/getting-started
Apache License 2.0
756 stars 115 forks source link

App crashes loading ar page #44

Closed roelkok closed 6 years ago

roelkok commented 6 years ago

The WebARCore app crashes whenever I try to load one of the samples from the ' Getting Started with AR on the Web' page. I'm using the most recent ARCore and WebARCore apks

Device: Samsung S8 (SM-G950F) Android 7.0 Build number NRD90M.G950FXXU1AQI7

This is what appears in Logcat when the app crashes.

12-04 16:41:29.512 19867-20157/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 20157 (Chrome_InProcGp)

                                         [ 12-04 16:41:29.516  3130: 3130 W/         ]
                                         debuggerd: handling request: pid=19867 uid=10220 gid=10220 tid=20157
12-04 16:41:29.659 20248-20248/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-04 16:41:29.660 20248-20248/? A/DEBUG: Build fingerprint: 'samsung/dreamltexx/dreamlte:7.0/NRD90M/G950FXXU1AQI7:user/release-keys'
12-04 16:41:29.660 20248-20248/? A/DEBUG: Revision: '10'
12-04 16:41:29.660 20248-20248/? A/DEBUG: ABI: 'arm64'
12-04 16:41:29.661 20248-20248/? A/DEBUG: pid: 19867, tid: 20157, name: Chrome_InProcGp  >>> org.chromium.android_webview.shell <<<
12-04 16:41:29.661 20248-20248/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x18
12-04 16:41:29.661 20248-20248/? A/DEBUG:     x0   0000000000000000  x1   0000000000000002  x2   ffffffffffffffff  x3   000000000000002e
12-04 16:41:29.661 20248-20248/? A/DEBUG:     x4   000000000000002e  x5   0000000000800000  x6   0000800000000000  x7   6c68736f4dff2d6c
12-04 16:41:29.661 20248-20248/? A/DEBUG:     x8   0000000000000049  x9   00000076075ffb00  x10  0000000000400000  x11  0101010101010101
12-04 16:41:29.661 20248-20248/? A/DEBUG:     x12  0000000000000010  x13  00000076082c4940  x14  0000000000000005  x15  0000000000000005
12-04 16:41:29.661 20248-20248/? A/DEBUG:     x16  0000007651cbf778  x17  000000767a8cab80  x18  0000000000ffffeb  x19  00000076075ffba8
12-04 16:41:29.661 20248-20248/? A/DEBUG:     x20  00000076082cbc40  x21  00000076115ae580  x22  0000000000000017  x23  0000000000000002
12-04 16:41:29.661 20248-20248/? A/DEBUG:     x24  0000007608324f18  x25  0000007611117850  x26  0000000000000001  x27  0000007611117840
12-04 16:41:29.662 20248-20248/? A/DEBUG:     x28  0000000000000015  x29  0000007612606e50  x30  0000007650106664
12-04 16:41:29.662 20248-20248/? A/DEBUG:     sp   0000007612606e20  pc   0000007650106728  pstate 0000000060000000
12-04 16:41:29.745 20248-20248/? A/DEBUG: backtrace:
12-04 16:41:29.745 20248-20248/? A/DEBUG:     #00 pc 0000000000a46728  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.745 20248-20248/? A/DEBUG:     #01 pc 0000000000a46660  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.745 20248-20248/? A/DEBUG:     #02 pc 0000000001c10df0  /system/vendor/lib64/egl/libGLES_mali.so (_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+352)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #03 pc 0000000001c1100c  /system/vendor/lib64/egl/libGLES_mali.so (_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+44)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #04 pc 0000000001c11460  /system/vendor/lib64/egl/libGLES_mali.so (_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+784)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #05 pc 000000000091f168  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #06 pc 000000000091fc58  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #07 pc 000000000082bda8  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #08 pc 00000000008301e0  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #09 pc 0000000000830078  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #10 pc 000000000082edfc  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #11 pc 00000000006a65cc  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #12 pc 00000000006a6ae4  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #13 pc 00000000005ae584  /system/vendor/lib64/egl/libGLES_mali.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #14 pc 0000000000005a04  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libarcore_camera_utility.so (LoadShader+68)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #15 pc 0000000000006118  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libarcore_camera_utility.so (_ZN26TextureReaderComputeShader14createResourceEv+224)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #16 pc 0000000000005f50  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libarcore_camera_utility.so (_ZN13TextureReader10initializeEiiii+284)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #17 pc 0000000000005610  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libarcore_camera_utility.so (TextureReader_initialize+324)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #18 pc 00000000000138bc  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libtango_chromium.so (_ZN14tango_chromium12TangoHandler28updateCameraImageIntoTextureEj+156)
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #19 pc 00000000000b7f00  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #20 pc 00000000000b7fb0  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so
12-04 16:41:29.746 20248-20248/? A/DEBUG:     #21 pc 00000000000ddc5c  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #22 pc 00000000000867ac  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so (_ZN3gpu13CommandParser15ProcessCommandsEi+76)
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #23 pc 0000000000087908  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so (_ZN3gpu15CommandExecutor10PutChangedEv+600)
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #24 pc 000000000014b7cc  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #25 pc 000000000008696c  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so (_ZN3gpu20CommandBufferService5FlushEi+44)
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #26 pc 00000000001654f4  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so (_ZN3gpu20GpuCommandBufferStub12OnAsyncFlushEijRKNSt6__ndk16vectorIN2ui11LatencyInfoENS1_9allocatorIS4_EEEE+368)
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #27 pc 0000000000165764  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #28 pc 0000000000166c9c  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so (_ZN3gpu20GpuCommandBufferStub17OnMessageReceivedERKN3IPC7MessageE+2244)
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #29 pc 00000000000271f8  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libipc.cr.so (_ZN3IPC13MessageRouter12RouteMessageERKNS_7MessageE+68)
12-04 16:41:29.747 20248-20248/? A/DEBUG:     #30 pc 0000000000163398  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so (_ZN3gpu10GpuChannel19HandleMessageHelperERKN3IPC7MessageE+52)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #31 pc 0000000000163448  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so (_ZN3gpu10GpuChannel13HandleMessageERK13scoped_refptrINS_22GpuChannelMessageQueueEE+68)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #32 pc 0000000000155834  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libgpu.cr.so
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #33 pc 000000000009cb4c  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base5debug13TaskAnnotator7RunTaskEPKcPNS_11PendingTaskE+232)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #34 pc 00000000000bd1d4  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base11MessageLoop7RunTaskEPNS_11PendingTaskE+264)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #35 pc 00000000000bdbdc  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base11MessageLoop21DeferOrRunPendingTaskENS_11PendingTaskE+216)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #36 pc 00000000000be034  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base11MessageLoop6DoWorkEv+368)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #37 pc 00000000000bf430  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base18MessagePumpDefault3RunEPNS_11MessagePump8DelegateE+48)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #38 pc 00000000000bcd10  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base11MessageLoop10RunHandlerEv+120)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #39 pc 00000000000deb9c  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base7RunLoop3RunEv+64)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #40 pc 0000000000109064  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so (_ZN4base6Thread10ThreadMainEv+264)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #41 pc 0000000000103360  /data/app/org.chromium.android_webview.shell-1/lib/arm64/libbase.cr.so
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #42 pc 000000000006c4a0  /system/lib64/libc.so (_ZL15__pthread_startPv+208)
12-04 16:41:29.748 20248-20248/? A/DEBUG:     #43 pc 000000000001e220  /system/lib64/libc.so (__start_thread+16)
12-04 16:41:29.788 13689-20120/? E/tango_tracker: Frame Drop! Failed to find metadata after tracking!
12-04 16:41:33.238 3327-3327/? E/audit: type=1701 audit(1512402093.230:313): auid=4294967295 uid=10220 gid=10220 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=20157 comm="Chrome_InProcGp" exe="/system/bin/app_process64" sig=11
12-04 16:41:33.351 3754-3965/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
12-04 16:41:33.409 3356-20143/? E/Surface: queueBuffer: error queuing buffer to SurfaceTexture, -32
12-04 16:41:33.409 3356-20143/? E/Camera3-OutputStream: returnBufferCheckedLocked: Stream 0: Error queueing buffer to native window: Broken pipe (-32)
12-04 16:41:33.409 3356-20143/? E/Camera3-Device: Can't return buffer to its stream: Broken pipe (-32)
12-04 16:41:33.412 3356-20139/? E/Camera3-OutputStream: getBufferLocked: Stream 0: Can't dequeue next output buffer: Broken pipe (-32)
12-04 16:41:33.412 3356-20139/? E/Camera3-Device: RequestThread: Can't get output buffer, skipping request: Broken pipe (-32)
...
judax commented 6 years ago

It seems the library that is being used to access the camera frame is failing on the Samsung Galaxy S8. I will try to get my hands on a device a test it to try to resolve the issue. Thanks for reporting.

robertjuh commented 6 years ago

same problem on same device. I get the message "webarcore keeps stopping"

roelkok commented 6 years ago

@robertjuh In case this is blocking you, I got the apk from an random older commit (22b75c18d4aeb4232e47556cc27f067f4115c75b) and that one works for me.

robertjuh commented 6 years ago

Thanks a lot Roel! Works for me too!

judax commented 6 years ago

Ok, I finally got a S8 to test with and I tested the latest APK in the webarcore_57.0.2987.5 branch and it does not crash. Could it be that the S8 GPU is different?

judax commented 6 years ago

Ok, confirmed. It is something that happens in some S8s (mainly Asian version of S8) because of the GPU they use. Working on a fix. Sorry for the inconveniences.

judax commented 6 years ago

First of all sorry for the delay on this. I am working on a temporary solution. This solution, if it works, it will disable marker detection. Would that work for you? As I mentioned, it is a temporary solution.

roelkok commented 6 years ago

Thanks for picking this up. I'm not sure what marker detection means in this case. Recognizing a predefined image for tracking the camera position like old school ar? Or is it being able to place an anchor on a plane and track that in space?

In my opinion, besides positional tracking of the camera, plane detection is a very essential part of the app. I think it would be confusing for devs if plane detection wouldn't work on a specific device.

judax commented 6 years ago

Marker detection is a new feature we have added to WebARonARCore. Apart from pose tracking and plane detection, the system is also able to detect markers upon request (QRCodes and special AR markers) that can be useful. This crash is related to how this feature is currently implemented. The fix would make the feature only to kick in (initialize) if marker detection is requested and thus, I hope, solve the problem. Tracking, planes and the new anchors would still work, just that if you try to use the marker detection feature, the app is very likely to keep crashing.

We have a solution for it too but it will take some time and thus, I preferred to have this patch added so at least you can use the basic browser prototype working on those specific S8 devices that crash.

judax commented 6 years ago

Please, test PR #51 and let me know if the app still crashes. I do not own an specific S8 device with the chipset that makes the app to crash. Thanks in advance!

cosmo-naut commented 6 years ago

@judax 's fix works on SM-G950F (Australian release), on which the observed bug occurs.

roelkok commented 6 years ago

Works here too!

judax commented 6 years ago

Thank you for testing it. As soon as a review give the PR a thumbs up, it will land.

judax commented 6 years ago

The PR #51 has landed. Closing.