google / conscrypt

Conscrypt is a Java Security Provider that implements parts of the Java Cryptography Extension and Java Secure Socket Extension.
Apache License 2.0
1.29k stars 275 forks source link

Attempt to invoke virtual method 'boolean com.android.org.conscrypt.SslWrapper.isClosed()Error Code #792

Open jeffrywu28 opened 4 years ago

jeffrywu28 commented 4 years ago

Error Code

E/System: Uncaught exception thrown by finalizer E/System: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.android.org.conscrypt.SslWrapper.isClosed()' on a null object reference at com.android.org.conscrypt.ConscryptFileDescriptorSocket.free(ConscryptFileDescriptorSocket.java:1015) at com.android.org.conscrypt.ConscryptFileDescriptorSocket.finalize(ConscryptFileDescriptorSocket.java:1043) at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237) at java.lang.Daemons$Daemon.run(Daemons.java:103) at java.lang.Thread.run(Thread.java:764) Uncaught exception thrown by finalizer E/System: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.android.org.conscrypt.SslWrapper.isClosed()' on a null object reference at com.android.org.conscrypt.ConscryptFileDescriptorSocket.free(ConscryptFileDescriptorSocket.java:1015) at com.android.org.conscrypt.ConscryptFileDescriptorSocket.finalize(ConscryptFileDescriptorSocket.java:1043) at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237) at java.lang.Daemons$Daemon.run(Daemons.java:103) at java.lang.Thread.run(Thread.java:764) Uncaught exception thrown by finalizer E/System: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.android.org.conscrypt.SslWrapper.isClosed()' on a null object reference at com.android.org.conscrypt.ConscryptFileDescriptorSocket.free(ConscryptFileDescriptorSocket.java:1015) at com.android.org.conscrypt.ConscryptFileDescriptorSocket.finalize(ConscryptFileDescriptorSocket.java:1043) at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237) at java.lang.Daemons$Daemon.run(Daemons.java:103) at java.lang.Thread.run(Thread.java:764)

Our Java Version

java version "13.0.1" 2019-10-15 Java(TM) SE Runtime Environment (build 13.0.1+9)

this is our code :

https://github.com/jeffrywu28/Petrachat-master/blob/master/app/src/main/java/com/petra/petrachat/Petrachat.java

help me please..

prbprbprb commented 4 years ago

What version of Conscrypt are you using? That stack trace doesn't match the current finalizer code, which has a null check for ssl and which hasn't changed in the last couple of years.

Also, I'm not sure whether ConscryptFileDescriptorSocket will work reliably on openjdk 13, see issue #737, in particular the suggestion to use ConscryptEngineSocket instead (which will be the default soon).