Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault in ARCore Session Update #1332

Open
KiithNabaal opened this issue Dec 21, 2021 · 0 comments
Open

Segfault in ARCore Session Update #1332

KiithNabaal opened this issue Dec 21, 2021 · 0 comments
Labels

Comments

@KiithNabaal
Copy link

SPECIFIC ISSUE ENCOUNTERED

When building a very bare-bones ARCore app, which simply just tries to run/display the camera when the app starts, segfault errors occur after granting permission for the camera. Backtrace always immediately leads to libarcore_c.so. I was originally using Android 11, but saw a previous post saying something about trying Android 10 instead, but even on Android 10 it still fails. See the error output below in additional comments.

Segfault error:

2021-12-21 12:26:30.377 12587-12649/com.example.basicar A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 12649 (GLThread 514), pid 12587 (example.basicar)

I can run the sample_ar_core app just fine on both the emulator and my Samsung S10+, but there is an awful lot going on in this app, and I want to build a working AR app one small piece at a time. I also have not worked with AR before, so doing it this way will help my understanding.

VERSIONS USED

  • Android Studio: 4.1.3
  • ARCore SDK for Android: 1.28.0
  • Device manufacturer, model, and O/S: Android emulator - Pixel 4 XL - qemu-system-x86_64 - Android 10.0
  • Google Play Services for AR (ARCore):

Packages:
versionName=1.28.212840293
signatures=PackageSignatures{6c8cc94 version:3, signatures:[53bcc66f], past signatures:[]}
Packages
PackageSetting{ccd2da com.google.ar.core/10146}
Active APEX packages:
Inactive APEX packages:
Factory APEX packages:
packages
packages
packages
packages

  • Output of adb shell getprop ro.build.fingerprint: google/sdk_gphone_x86_64/generic_x86_64:10/QSR1.210802.001/7603624:userdebug/dev-keys

STEPS TO REPRODUCE THE ISSUE

  1. Activity requests camera permission in onCreate if it was not granted
  2. Activity creates ARCore session object in onCreate, and then passes it to a class which implements GLSurfaceView.Renderer
  3. GLSurfaceView.Renderer updates the session in onDrawFrame via session.update()
  4. In onResume, session object calls resume()
  5. Run the emulator, and get segfault

WORKAROUNDS (IF ANY)

ADDITIONAL COMMENTS

If I don't update the session in onDrawFrame, the emulator just shows a blue screen. On my Samsung, a black screen just shows instead. In either case, no segfaults occur, segfaults only happen once I try to update the session in onDrawFrame. I looked at sample_ar_core and didn't see anything in particular that starts the camera, just lots of OpenGL code. sample_ar_core also calls session.update() in onDrawFrame, so I can't imagine there is anything wrong with me calling it there either.

Error output:

2021-12-21 12:26:30.264 12587-12629/com.example.basicar E/ACameraMetadata: filterDurations: malformed duration key 1835010! count 0, type 3
2021-12-21 12:26:30.265 12587-12629/com.example.basicar E/ACameraMetadata: filterDurations: malformed duration key 1638407! count 0, type 3
2021-12-21 12:26:30.265 12587-12629/com.example.basicar E/ACameraMetadata: filterDurations: malformed duration key 1638408! count 0, type 93
2021-12-21 12:26:30.377 12587-12649/com.example.basicar A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 12649 (GLThread 514), pid 12587 (example.basicar)
2021-12-21 12:26:30.784 12664-12664/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2021-12-21 12:26:30.784 12664-12664/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86_64/generic_x86_64:10/QSR1.210802.001/7603624:userdebug/dev-keys'
2021-12-21 12:26:30.784 12664-12664/? A/DEBUG: Revision: '0'
2021-12-21 12:26:30.784 12664-12664/? A/DEBUG: ABI: 'x86_64'
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: Timestamp: 2021-12-21 12:26:30-0500
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: pid: 12587, tid: 12649, name: GLThread 514 >>> com.example.basicar <<<
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: uid: 10147
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: Cause: null pointer dereference
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: rax 00007a5df59b6820 rbx 00007a5d68260570 rcx 0000000000000001 rdx 00007a5d13393060
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: r8 0000000000000000 r9 0000000000000000 r10 00007a5df41e0610 r11 0000000000000206
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: r12 0000000000000001 r13 00007a5d130d5500 r14 00007a5d130d5480 r15 00007a5d13391690
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: rdi 0000000000009117 rsi 0000000000000000
2021-12-21 12:26:30.812 12664-12664/? A/DEBUG: rbp 00007a5d1aa2c800 rsp 00007a5d133915b8 rip 0000000000000000
2021-12-21 12:26:30.824 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:30.824 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65578
2021-12-21 12:26:30.852 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:30.883 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:30.958 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: backtrace:
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #00 pc 0000000000000000
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #1 pc 00000000021fe390 /data/app/com.google.ar.core-2sGeG3dJxhYoGHOUpZVWuQ==/lib/x86_64/libarcore_c.so (BuildId: eb6450ed053b1b6d217ba0c8d7f0ec3b)
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #2 pc 000000000010182f anonymous:7a5d13290000
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #3 pc 0000000001f20ed0 /data/app/com.google.ar.core-2sGeG3dJxhYoGHOUpZVWuQ==/lib/x86_64/libarcore_c.so (BuildId: eb6450ed053b1b6d217ba0c8d7f0ec3b)
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #4 pc 00000000000db217 [anon:libc_malloc]
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #5 pc 0000000001f238ec /data/app/com.google.ar.core-2sGeG3dJxhYoGHOUpZVWuQ==/lib/x86_64/libarcore_c.so (BuildId: eb6450ed053b1b6d217ba0c8d7f0ec3b)
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #6 pc 000000000114d7ff /data/app/com.google.ar.core-2sGeG3dJxhYoGHOUpZVWuQ==/lib/x86_64/libarcore_c.so (ArSession_pause+191) (BuildId: eb6450ed053b1b6d217ba0c8d7f0ec3b)
2021-12-21 12:26:30.967 12664-12664/? A/DEBUG: #7 pc 0000000000101b8f anonymous:7a5d13290000
2021-12-21 12:26:31.092 12587-12652/com.example.basicar E/native: E1221 12:26:31.092027 12652 camera_image_stream.cc:270] FAILED_PRECONDITION: Failed to extract the native metadata, status=DEADLINE_EXCEEDED: Timed out waiting for metadata.
=== Source Location Trace: ===

third_party/arcore/ar/camera/android/metadata_cache.cc:52
third_party/arcore/ar/camera/android/metadata_extraction.cc:53

=== Source Location Trace: ===

third_party/arcore/ar/camera/android/camera_image_stream.cc:204

2021-12-21 12:26:31.103 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:31.117 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:31.195 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:31.243 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
2021-12-21 12:26:31.301 12587-12652/com.example.basicar E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant