Skip to content

EXC_BAD_ACCESS RCTModuleMethod.mm #23950

@markamccorkle

Description

@markamccorkle

🐛 Bug Report

Line 456 crashes during iOS build. EXC_BAD_ACCESS
com.facebook.react.JavaScript (7): EXC_BAD_ACCESS (code=1, address=0x1a1e6887e00)

To Reproduce

Just build the project for iOS from Xcode

Expected Behavior

No crash, app should continue building

Code Example

- (const char *)JSMethodName
{
  NSString *methodName = _JSMethodName;
  if (!methodName) {
    const char *jsName = _methodInfo->jsName;
*456 HERE*    if (jsName && strlen(jsName) > 0) {
      methodName = @(jsName);
    } else {
      methodName = @(_methodInfo->objcName);
      NSRange colonRange = [methodName rangeOfString:@":"];
      if (colonRange.location != NSNotFound) {
        methodName = [methodName substringToIndex:colonRange.location];
      }
      methodName = [methodName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
      RCTAssert(methodName.length, @"%s is not a valid JS function name, please"
                " supply an alternative using RCT_REMAP_METHOD()", _methodInfo->objcName);
    }
    _JSMethodName = methodName;
  }
  return methodName.UTF8String;
}

Environment

React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Memory: 693.45 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.10.1 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 21, 22, 24, 25, 26, 27, 28
Build Tools: 26.0.1, 27.0.1, 27.0.3, 28.0.3
System Images: android-27 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5264788
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: ^16.8.4 => 16.8.4
react-native: ^0.59.1 => 0.59.1
npmGlobalPackages:
react-native-cli: 2.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions