microsoft / MixedReality-WebRTC

MixedReality-WebRTC is a collection of components to help mixed reality app developers integrate audio and video real-time communication into their application and improve their collaborative experience
https://microsoft.github.io/MixedReality-WebRTC/
MIT License
913 stars 283 forks source link

Null pointer dereference - Failed to load native plugin: Unable to load library on (Unity / Android) Build #704

Open RyanWarwick opened 3 years ago

RyanWarwick commented 3 years ago

Android build using IL2CPP , NET 2.0 standard and ARM64 crashes upon peer attempting to publish, seems to occur at _nativePeer.createOffer(). Only occurs on 1/5 devices tested (OnePlus 7T Pro). Logs indicate a "signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0" error, of "Cause: null pointer dereference"

To Reproduce

  1. Initialise Peer with local media sources
  2. Press publish button on app
  3. Signaling is successful
  4. Peer starts connection attempt
  5. App hard crashes

Expected behavior

  1. Initialise Peer with local media sources
  2. Press publish button on app
  3. Signaling is successful
  4. Peer starts connection attempt
  5. Peer successfully publishes media after SDP/ICE negotiation
  6. App does not crash

Environment

tombstone_00.txt

djee-ms commented 3 years ago

Hi @RyanWarwick,

There's not much I can do with this. I don't see a callstack, so not sure how you know this is in createOffer(). Looking at this, I can't tell if it's in MixedReality-WebRTC or your own code. Could you try to get us more info please? A callstack at least would be great to confirm exactly where the crash happens.

RyanWarwick commented 3 years ago

I am currently trying to get a full output log from my developer's end. In the meantime upon further digging, the null pointer dereference seems to have been triggered when calling _nativePeer.createOffer() due to the libmrwebrtc.so library not being found by the device...

A more detailed error extracted from the device adb logs that I have attached: Failed to load native plugin: Unable to load library '/data/app/com.DefaultCompany.mixedrealitywebrtctest-hdRzfacFtumD_WK6EoHKlQ==/lib/arm64/libmrwebrtc.so', error 'java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.ClassLoader java.lang.Class.getClassLoader()' on a null object reference

I initially thought it was a installation location issue, but the problematic device does not have any attached external storage (sd card etc)

videocall cmd logcat.txt

RyanWarwick commented 3 years ago

After digging through more logs, i was able to find that the "Failed to load native plugin: Unable to load library" also occurs on my personal Poco X3. Could this be related to #677 ?

RyanWarwick commented 3 years ago

Upon further research on existing issues raised, i am quite certain this is related to #577. In both cases, a OnePlus android device was used. Please advise @djee-ms