question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bugsnag crashes: RNCConnectionState.m:65 Attempted to dereference null pointer

See original GitHub issue

Environment

info Fetching system and libraries information...
System:
    OS: macOS 12.2.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 19.59 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.0 - /usr/local/bin/node
    Yarn: 1.22.15 - /usr/local/bin/yarn
    npm: 8.3.1 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8139111
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.1 => 0.68.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Platforms

iOS

Versions

  • iOS: 15.4
  • react-native-netinfo: 8.3.0
  • react-native: 0.68.1
  • react: 17.0.2

Description

We got some stability issues since updating to the latest version of the library. The cause seams to be this error in the native code:

EXC_BAD_ACCESS in RNCConnectionState.m:65 Attempted to dereference null pointer.

Stacktrace

node_modules/@react-native-community/netinfo/ios/RNCConnectionState.m:65 - -[RNCConnectionState initWithReachabilityFlags:]
node_modules/@react-native-community/netinfo/ios/RNCConnectionStateWatcher.m:79 - -[RNCConnectionStateWatcher update:]
node_modules/@react-native-community/netinfo/ios/RNCConnectionStateWatcher.m:130 - -[RNCConnectionStateWatcher createReachabilityRef]
node_modules/@react-native-community/netinfo/ios/RNCConnectionStateWatcher.m:31 - -[RNCConnectionStateWatcher initWithDelegate:]
node_modules/@react-native-community/netinfo/ios/RNCNetInfo.m:70 - -[RNCNetInfo init]
node_modules/react-native/React/Base/RCTModuleData.mm:109 - __83-[RCTModuleData initWithModuleClass:bridge:moduleRegistry:viewRegistry_DEPRECATED:]_block_invoke
node_modules/react-native/React/Base/RCTModuleData.mm:173 - -[RCTModuleData setUpInstanceAndBridge:]
node_modules/react-native/React/Base/RCTUtils.m:275 - RCTUnsafeExecuteOnMainQueueSync
node_modules/react-native/React/Base/RCTModuleData.mm:401 - -[RCTModuleData instance]
node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:1001 - __49-[RCTCxxBridge _prepareModulesWithDispatchGroup:]_block_invoke

Reproducible Demo

We use the library as follows:

  /**
   * Start listening for network changes
   */
  startListening() {
    this.stopListening();
    this.subscription = NetInfo.addEventListener(this._handleConnectivityChange);
  }

  /**
   * Stop listening for network changes
   */
  stopListening() {
    if (this.subscription) {
      this.subscription(); // dispose listener
      this.subscription = null;
    }
  }


_handleConnectivityChange = connectionInfo => {
    this.connectionType = connectionInfo.type;
    this.isInternetReachable = connectionInfo.isInternetReachable;
};

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
andrei-tofancommented, May 31, 2022

Thanks for the info, closing this and will open a new issue / pr once I figure out the real line number.

0reactions
mikehardycommented, Nov 18, 2022

@bakiinitialcode I haven’t seen any progress on this closed issue no. Happy to merge and release any reasonable looking PR though, feel free to raise one if you need a fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attempted to dereference null pointer in + ... - GitHub
Description I get a lot of crashes with EXC_BAD_ACCESS: Attempted to dereference null pointer Environment Library versions: Bugsnag version ...
Read more >
Crash after block release, but thr… | Apple Developer Forums
We have a mysterious crash which is reported only on BugSnag StackTrace: Code Block. EXC_BAD_ACCESS · Attempted to dereference garbage pointer 0x20.
Read more >
React Native: EXC_BAD_ACCESS·Attempted to dereference ...
I'm not saying Bugsnag is causing the issue but people keep reporting that they are seeing the crash log in their Bugsnag reports....
Read more >
Identifying crashes at launch - iOS - Bugsnag docs
Learn how to identify crashes at launch. ... If your app crashes whilst it is launching, you may want to give the crash...
Read more >
Bug - Unity 2020 - null pointer dereference
After updating Unity from 2018.4.10 to 2020.3.26 our game started having a new nasty crash on Android (IL2CPP).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found