mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary:
Douring our routine crash report check we are occasionally seeing reports of exceptions like this in the wild from our crash stack:
```
java.lang.NullPointerException: bio == null
at com.android.org.conscrypt.NativeCrypto.SSL_pending_written_bytes_in_BIO(NativeCrypto.java)
at com.android.org.conscrypt.NativeSsl$BioWrapper.getPendingWrittenBytes(NativeSsl.java:660)
at com.android.org.conscrypt.ConscryptEngine.pendingOutboundEncryptedBytes(ConscryptEngine.java:566)
at com.android.org.conscrypt.ConscryptEngineSocket.drainOutgoingQueue(ConscryptEngineSocket.java:584)
at com.android.org.conscrypt.ConscryptEngineSocket.close(ConscryptEngineSocket.java:480)
at okhttp3.internal.Util.closeQuietly(Util.kt:501)
at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFile:245)
at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFile:106)
at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFile:74)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(ExchangeFile:255)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ExchangeFile:32)
...
```

This appears to only be happening on devices running Android 10 and 11. This happens because there is concurrency issue in Conscrypt where two threads race to close an SSLEngine-based SSLSocket and access to the underlying BIO is unsynchronized.
**The OkHttp team already released a fix for this issue on version 4.9.1** this PR aims to update our OkHttp package to version 4.9.1.
Related discussion:
[https://issuetracker.google.com/issues/177450597](https://issuetracker.google.com/issues/177450597)
[https://publicobject.com/2021/01/30/bio-null/](https://publicobject.com/2021/01/30/bio-null/)
cc dulmandakh fkgozali
## Changelog
[Android] [Changed] - Bumping OkHttp from 4.9.0 to 4.9.1.
Pull Request resolved: https://github.com/facebook/react-native/pull/31822
Test Plan: Manual & Automated from CI
Reviewed By: fkgozali
Differential Revision: D29590198
Pulled By: ShikaSD
fbshipit-source-id: 4228bfd3472114253e13acb436dc1dd9287a148d
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
|
|
load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_target", "rn_android_library", "rn_prebuilt_jar")
|
|
|
|
rn_android_library(
|
|
name = "okhttp3",
|
|
autoglob = False,
|
|
visibility = ["//ReactAndroid/..."],
|
|
exported_deps = [
|
|
":okhttp3-binary",
|
|
react_native_dep("third-party/java/okio:okio"),
|
|
# Forces resolver to use OSS Kotlin version
|
|
react_native_target("third-party/kotlin:kotlin-stdlib-jdk8"),
|
|
],
|
|
)
|
|
|
|
rn_android_library(
|
|
name = "okhttp3-urlconnection",
|
|
autoglob = False,
|
|
visibility = ["//ReactAndroid/..."],
|
|
exported_deps = [
|
|
":okhttp3",
|
|
":okhttp3-urlconnection-binary",
|
|
],
|
|
)
|
|
|
|
rn_prebuilt_jar(
|
|
name = "okhttp3-binary",
|
|
binary_jar = ":okhttp3-binary.jar",
|
|
)
|
|
|
|
fb_native.remote_file(
|
|
name = "okhttp3-binary.jar",
|
|
sha1 = "51215279c3fe472c59b6b7dd7491e6ac2e28a81b",
|
|
url = "mvn:com.squareup.okhttp3:okhttp:jar:4.9.1",
|
|
)
|
|
|
|
rn_prebuilt_jar(
|
|
name = "okhttp3-urlconnection-binary",
|
|
binary_jar = ":okhttp3-urlconnection-binary.jar",
|
|
)
|
|
|
|
fb_native.remote_file(
|
|
name = "okhttp3-urlconnection-binary.jar",
|
|
sha1 = "f45e809215bd0961350148cf5b78707865084e6f",
|
|
url = "mvn:com.squareup.okhttp3:okhttp-urlconnection:jar:4.9.1",
|
|
)
|