Skip to content

Concurrency issue in NetworkingModule causes _STL_VERIFY to fail #4174

@lamxdoan

Description

@lamxdoan

Environment

If you are using latest version:

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native: 0.60.6
  2. react-native run-windows --info:
    System:
    OS: Windows 10 10.0.18363
    CPU: (12) x64 Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz
    Memory: 12.28 GB / 31.92 GB
    Binaries:
    Node: 11.3.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.16.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.6 => 0.60.6
    react-native-windows: 0.60.0-vnext.141 => 0.60.0-vnext.141
    rnpm-plugin-windows: 0.3.5 => 0.3.5
    Installed UWP SDKs:
    10.0.16299.0
    10.0.17134.0
    10.0.17749.0
    10.0.17763.0
    10.0.18362.0

Then, specify:

  • Target Platform Version(s): 10.0.18362.0
  • Target Device(s): Desktop
  • Visual Studio Version: 2017
  • Build Configuration: Debug

Steps to Reproduce

  1. In RNW app, make a large number of network requests so that NetworkModule.cpp gets hammered. (We use axios and we see this issue often after we kick off 800+ requests)

Expected Behavior

No _STL_VERIFY asserts get hit.

Actual Behavior

STL_VERIFY asserts get hit and the app is forced to close.

Additional context

(Write any other additional context that may help in root causing the issue.)
image

image

The issue is that the large number of requests increases the chances that m_requests map gets modified while an add or erase is being done which causes the iterators to be invalidated.

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