Skip to content

Android O CastException #3438

Closed
GulajavaMinistudio/okhttp
#55

Description

@TheLester

For Android O i noticed such crash in crashlytic,

Fatal Exception: java.lang.ClassCastException: android.system.UnixSocketAddress cannot be cast to java.net.InetSocketAddress
       at libcore.io.IoBridge.getLocalInetSocketAddress(IoBridge.java:700)
       at libcore.io.IoBridge.connectDetail(IoBridge.java:197)
       at libcore.io.IoBridge.connect(IoBridge.java:138)
       at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:129)
       at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:356)
       at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
       at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
       at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:356)
       at java.net.Socket.connect(Socket.java:616)
       at okhttp3.internal.platform.AndroidPlatform.connectSocket(AndroidPlatform.java:63)
       at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:223)
       at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
       at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:192)
       at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
       at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
       at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at com.pubnub.api.interceptors.SignatureInterceptor.intercept(SignatureInterceptor.java:32)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
       at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
       at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
       at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
       at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at java.lang.Thread.run(Thread.java:764)

Will this be fixed in new version of library?

Activity

  1. JakeWharton commented on Jun 29, 2017

    @JakeWharton
    Collaborator
  2. sjudd commented on Sep 7, 2017

    @sjudd

    It looks like the fix for this missed O. Is there any workaround in OkHttp other than not calling cancel? It's ugly to skip cancelling queued requests made with OkHttp in O only.

  3. swankjesse commented on Sep 7, 2017

    @swankjesse
    Collaborator

    Yeah we'll work around and catch the exception.

  4. brunoreisportela commented on Sep 18, 2017

    @brunoreisportela

    Gosh! Getting same issue also.

  5. added a commit that references this issue on Sep 23, 2017
  6. datayja commented on Sep 23, 2017

    @datayja
    Contributor

    @swankjesse any chances of the fix making it into production sometime soon? 💟

  7. added a commit that references this issue on Sep 25, 2017
  8. added this to the 3.10 milestone on Sep 25, 2017
  9. leofirespotter commented on Oct 11, 2017

    @leofirespotter

    @yschimke any chance of getting an intermediate release that fixes just this bug before 3.10 is released?

  10. yschimke commented on Oct 12, 2017

    @yschimke
    Collaborator

    cc @swankjesse @JakeWharton Seems like a clean fix to apply to a 3.9.1 branch.

  11. added
    bug
    on Oct 12, 2017
  12. added a commit that references this issue on Oct 30, 2017
  13. swankjesse commented on Nov 18, 2017

    @swankjesse
    Collaborator

    Released as OkHttp 3.9.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions