Skip to content

Commit 6caec9d

Browse files
gedeagasfacebook-github-bot
authored andcommitted
Android: upgrading to OkHttp from 4.9.0 to 4.9.1 to fix java.lang.NullPointerException: bio == null crash (#31822)
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) ... ``` ![Screen Shot 2021-07-07 at 1 38 23 PM](https://user-images.githubusercontent.com/8868908/124711795-b5fee980-df28-11eb-98c4-9668661340b6.png) 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: #31822 Test Plan: Manual & Automated from CI Reviewed By: fkgozali Differential Revision: D29590198 Pulled By: ShikaSD fbshipit-source-id: 4228bfd3472114253e13acb436dc1dd9287a148d
1 parent 94a2b2c commit 6caec9d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

ReactAndroid/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ JUNIT_VERSION=4.12
1212

1313
ANDROIDX_TEST_VERSION=1.1.0
1414
FRESCO_VERSION=2.5.0
15-
OKHTTP_VERSION=4.9.0
15+
OKHTTP_VERSION=4.9.1
1616
SO_LOADER_VERSION=0.10.1
1717

1818
BOOST_VERSION=1_63_0

ReactAndroid/src/main/third-party/java/okhttp/BUCK

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ rn_prebuilt_jar(
3030

3131
fb_native.remote_file(
3232
name = "okhttp3-binary.jar",
33-
sha1 = "08e17601d3bdc8cf57902c154de021931d2c27c1",
34-
url = "mvn:com.squareup.okhttp3:okhttp:jar:4.9.0",
33+
sha1 = "51215279c3fe472c59b6b7dd7491e6ac2e28a81b",
34+
url = "mvn:com.squareup.okhttp3:okhttp:jar:4.9.1",
3535
)
3636

3737
rn_prebuilt_jar(
@@ -41,6 +41,6 @@ rn_prebuilt_jar(
4141

4242
fb_native.remote_file(
4343
name = "okhttp3-urlconnection-binary.jar",
44-
sha1 = "94f82aaabdf53e48d7a1c515bf89ce60dcebfbeb",
45-
url = "mvn:com.squareup.okhttp3:okhttp-urlconnection:jar:4.9.0",
44+
sha1 = "f45e809215bd0961350148cf5b78707865084e6f",
45+
url = "mvn:com.squareup.okhttp3:okhttp-urlconnection:jar:4.9.1",
4646
)

ReactAndroid/src/main/third-party/java/okio/BUCK

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ rn_prebuilt_jar(
1919

2020
fb_native.remote_file(
2121
name = "okio-binary.jar",
22-
sha1 = "0dcc813b08ce5933f8bdfd1dfbab4ad4bd170e7a",
23-
url = "mvn:com.squareup.okio:okio:jar:2.9.0",
22+
sha1 = "accaddddbb597fb70290fd40358b1ce66b8c2b3d",
23+
url = "mvn:com.squareup.okio:okio:jar:2.10.0",
2424
)

0 commit comments

Comments
 (0)