Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1082

[Question] Does Realm interfere with iOS native code?

      <!---

      Questions: If you have questions about HOW TO use Realm, please ask on
      StackOverflow: http://stackoverflow.com/questions/ask?tags=realm
      We monitor the realm tag.

      Feature Request: Just fill in the first two sections below.

      Bugs: To help you as fast as possible with an issue please describe your issue
      and the steps you have taken to reproduce it in as much detail as possible.

      -->

      Goals

      This a question about how realm injects itself into the source code / stack trace. Does Realm really interfere with native code execution at the C level?

      For instance, the following crash / exception is from a native camera library, yet, realm stack trace is all over the place.

      NSRangeException: *** -[AVCaptureDevice setExposureModeCustomWithDuration:ISO:completionHandler:] The passed ISO value 1534.060059 is outside the supported range - use activeFormat.minISO and activeFormat.maxISO
      
      0  CoreFoundation          ___exceptionPreprocess
      1  libobjc.A.dylib         _objc_exception_throw
      2  AVFCapture              -[AVCaptureFigVideoDevice setExposureModeCustomWithDuration:ISO:completionHandler:]
      3  AVFCapture              -[AVCaptureFigVideoDevice _setActiveVideoMaxFrameDurationInternal:]
      4  AVFCapture              -[AVCaptureFigVideoDevice _setActiveVideoMinFrameDurationInternal:]
      5  AVFCapture              -[AVCaptureFigVideoDevice setActiveVideoMinFrameDuration:]
      6  zinspector3             realm::util::FunctionRef<unsigned long (realm::BPlusTreeNode*, unsigned long)>::FunctionRef<realm::BPlusTree<realm::Decimal128>::erase(unsigned long)::{lambda(realm::BPlusTreeNode*, unsigned long)#1}&>(realm::BPlusTree<realm::Decimal128>::erase(unsigned long)::{lambda(realm::BPlusTreeNode*, unsigned long)#1}&)::{lambda(void*, realm::BPlusTreeNode*, unsigned long)#1}::__invoke(realm::BPlusTree<realm::Decimal128>::erase(unsigned long)::{lambda(realm::BPlusTreeNode*, unsigned long)#1}&, realm::BPlusTreeNode*, unsigned long) (zinspector3)
      

      Furthermore, the actual "crash" code is protected by a try/catch statement as shown here https://github.com/react-native-camera/react-native-camera/blob/master/ios/RN/RNCamera.m#L694 , and the exception that was thrown should have clearly been handled, rather than crashing the entire app.

      So the above tells me realm is maybe causing two issues:

      • First, it messes up the entire stack trace tree, which makes it harder to debug native crash logs
      • Lastly, it also changes the actual native code behaviour (e.g., the catch block was never used, and it crashed the entire app).

      Any ideas why this is happening?

      Version of Realm and Tooling

      • Realm JS SDK Version: 10.2.0
      • Node or React Native: React Native
      • Client OS & Version: iOS 14.2
      • Which debugger for React Native: None

            Assignee:
            kenneth.geisshirt@mongodb.com Kenneth Geisshirt
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: