How to fix AR Core Issue in Native Integration? - android

I am integrating ARcore sceneform in my Android Native Project . I am facing below issue while opening camera. It happens some times only . I am not able to find the exact issue .
E/third_party/arcore/ar/sceneform/android/jni/arsceneview_jni.cc: nativeReportEngineType: Couldn't get session's nativeHandle
2019-05-15 19:30:28.411 22577-22577/com.innovare.plugxr
E/NdkImageReader: AImageReader_getWindow
2019-05-15 19:30:28.600 22577-22577/com.innovare.plugxr
E/native: session.cc:1527 Invalid ray produced by view data!
2019-05-15 19:30:28.850 22577-22577/com.innovare.plugxr
A/libc: Fatal signal 7 (SIGBUS), code 1, fault addr 0x728e1b48 in tid 22577 (innovare.plugxr)

Related

Visual Studio 2019 - Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7a7bff4000 in tid 12503 (Thread Pool Wor), pid 11057

I have been stuck with Fatal Signal errors since using Visual Studio 2019 or 2022 to compile my Xamarin Android Project for more than 3 weeks.
I have used ndk-stack and other tools to see any meaningful stack trace I have failed and our project is not going ahead because of this.
Please note that the same exact code base works perfectly stable if I produce an APK using visual Studio 2017.
Visual Studio 2019 uses Xamarin.Andriod.SDK 12.0.0.3
Visual Studio 2017 uses Xamarin.Android.SDK 9.7.1.0
I have attempted to upgrade to Android 12 but our project is Huge and require significant amount of work. It does not seem to be an option at this point.
The reason I want to use 2019 or 2022 is because of google play store and producing app bundle instead of APK. Visual Studio 2017 does not have app bundle option.
My projects target Android 9 and I am also using PortSip Libraries. I have done extensive googling. I have not found any solid evidence if there is a problem with Xamarin Android SKD in 2019 or a problem with my Samsung Device Tab S6. The only answer I found here is:
Why application is dying randomly?
If this the case why an APK produced by 2017 does not have any segmentation faults or any race conditions.
I have handlers in c# to catch any error but non of them catches these. My app uses google MAPs and we are drawing many layers and updates on the MAP.
My app also receives many signalr updates and makes calls to WCF services.
Examples of errors:
03-09 19:54:53.811 9984 12254 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x40000000080 in tid 12254 (Thread Pool Wor), pid 9984 (------)
03-09 19:54:53.836 12404 12404 E chromium: [0309/195453.835730:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Operation not permitted (1)
03-11 00:35:05.469 27236 27236 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7c13725238
We had a very similar problem with PortSip (null reference exception that was caused by the Garbage Collection thread in PortSip). We found that the problem was in the way a key class PortSip constructor contained mutual references with other classes. When those classes were disposed a null reference exception occurred on the garbage collection thread.
You reported that "I have handlers in C# to catch any error but none of them catches these". We found that to be the case as well. It turned out that since the crash was happening on the CG thread inside the PortSip library - adding error handling in C# had no effect.
If your crashes are also experiencing these symptoms - I will dig into the code and document our fix.

Azure SpatialAnchors AppProperties crash in Android NDK

Azure SpatialAnchors NDK crashes on inserting/looking up AppProperties.
After unsuccessful attempts to fix it in my custom app I added the code to the official Microsoft tutorial which builds and works fine.
https://github.com/Azure/azure-spatial-anchors-samples/blob/master/Android/NDK/app/src/main/cpp/AzureSpatialAnchorsApplication.cpp#L570
visual.cloudAnchor = std::make_shared<CloudSpatialAnchor>();
visual.cloudAnchor->LocalAnchor(visual.localAnchor);
std::shared_ptr<IMap<std::string, std::string>> properties = visual.cloudAnchor->AppProperties(); // new code
// verified properties is not null
properties->Insert(R"(model-type)", R"(frame)"); // crash!
ERROR: A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 22056
Here is the documentation which shows how to set app properties https://learn.microsoft.com/en-us/azure/spatial-anchors/how-tos/create-locate-anchors-cpp-ndk
Thank you for reaching out!
This is a duplicate of this GitHub issue
The team will follow up there

Im trying to run the sample Arcore applications but the sample augmented Image app crashes when I try to run it

I'm trying to run the augmented image sample provided in the arcore sdk provided by google. The augmented image sample is an extension of the Hello_AR sample. The Hello_ar sample runs perfectly fine but when i try to run the augmented image sample it always crashes on startup. I want to try an extend it for a personal school project but i cant figure out why this is happening
I get this error:
################ ARCore Native Error ##################
BUILD_CHANGELIST:285895675
BUILD_BASELINE_CHANGELIST:280981321
################### Stack Trace Begin ################
ARCoreError: third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc:184 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/android/implementation/android_frame_manager_gl.cc?g=0&l=184
ARCoreError: third_party/arcore/ar/core/frame_manager.cc:293 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=293
ARCoreError: third_party/arcore/ar/core/frame_manager.cc:130 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/frame_manager.cc?g=0&l=130
ARCoreError: third_party/arcore/ar/core/session.cc:1410 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/session.cc?g=0&l=1410
ARCoreError: third_party/arcore/ar/core/c_api/session_lite_c_api.cc:51 https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/c_api/session_lite_c_api.cc?g=0&l=51
################### Stack Trace End #################
E/AugmentedImageActivity: Exception on the OpenGL thread
com.google.ar.core.exceptions.FatalException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at com.google.ar.core.Session.throwExceptionFromArStatus(Session.java:143)
at com.google.ar.core.Session.nativeUpdate(Native Method)
at com.google.ar.core.Session.update(Session.java:67)
at com.google.ar.core.examples.java.augmentedimage.AugmentedImageActivity.onDrawFrame(AugmentedImageActivity.java:261)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
W/native: tracking.cc:3753 Feature descriptors not exist
box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
getConstEntry: cannot find metadata tag 65578
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
getConstEntry: cannot find metadata tag 65578
E/EGL_emulation: tid 8075: eglMakeCurrent(1597): error 0x3009 (EGL_BAD_MATCH)
E/libEGL: eglMakeCurrent:1062 error 3009 (EGL_BAD_MATCH)
W/native: tracking.cc:3753 Feature descriptors not exist
box_detector.cc:180 Detection skipped due to empty features or descriptors.
E/ACameraMetadata: getConstEntry: cannot find metadata tag 65576
getConstEntry: cannot find metadata tag 65578
A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0xc917cffc in tid 8075 (GLThread 248), pid 8045 (.augmentedimage)
Process 8045 terminated.

SIGSEGV crash with Firebase MLKit barcode scanner

I recently ran into a problem with my application: a weird crash happens when scanning QR codes coming from a particular website.
Anything generated by https://businesscards.tec-it.com/it causes a SIGSEGV crash with the following line in the logcat:
Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 19717
(FirebaseMLHandl), pid 19583 (is.qrsync.debug)
I am using Firebase ML Kit version 16.0.0 and it works fine with, so far, any other QR code generator.
Is this a known issue? How can I investigate this further?
Thanks

can't find NDK-STACK.html in sdk\ndk-bundle folder

I also tried to run ndk-stack.cmd, but this did nothing. Does someone know how can I find it? I need it to see about the Fatal signal 11 (SIGSEGV), code 2, fault addr 0xa2a23804 in tid 3819 (RenderThread) error I get at runtime.
This is a bug in NDK. Once upon a time, all NDK docs were distributed in the same zip. Today you will find the guide online: https://developer.android.com/ndk/guides/ndk-stack.html.

Categories

Resources