Skip to content

[iOS] Debug-only SIGABRT in React Native DevTools when inspecting a network response containing non-ASCII (UTF-8 multi-byte) text #57061

@ahmedemc2

Description

@ahmedemc2

Description

In Debug builds on iOS, the app crashes with SIGABRT whenever a network response body containing non-ASCII text (e.g. French accented characters like é, è, à) is inspected from the Network tab in React Native DevTools.
The root cause is an incorrect length calculation when storing XHR response bodies for the inspector. In Libraries/Network/RCTNetworkConversions.h, the helper builds a std::string_view over the UTF-8 bytes of an NSString but uses string.length (number of UTF-16 code units) as the byte length:

inline std::string_view RCTStringViewFromNSString(NSString *string) { return std::string_view{string.UTF8String, string.length}; // BUG: length is UTF-16 units, not UTF-8 bytes }

Steps to reproduce

  1. Run an app in Debug on iOS (RN 0.85.3).
  2. Make a network request (fetch/XHR) whose text response body contains at least one non-ASCII character (e.g. a body containing é).
  3. Open React Native DevTools and go to the Network tab.
  4. Click the request to view its response body (this triggers Network.getResponseBody).
  5. The app crashes with SIGABRT.

React Native Version

0.85.3

Output of npx @react-native-community/cli info

System:
  OS: macOS 26.2
  CPU: (8) arm64 Apple M4
  Memory: 149.44 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.12.0
    path: /Users/asmaaasmaa/.nvm/versions/node/v24.12.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 11.16.0
    path: /Users/asmaaasmaa/.nvm/versions/node/v24.12.0/bin/npm
  Watchman:
    version: 2025.05.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/asmaaasmaa/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2512.13930704
  Xcode:
    version: 26.0.1/17A400
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.7.5
    path: /Users/asmaaasmaa/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.3
    wanted: ^20.1.3
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.85.3
    wanted: 0.85.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DebuggingIssues related to React Native DevTools or legacy JavaScript/Hermes debuggingNeeds: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.Platform: iOSiOS applications.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions