Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4392195

Infinite loop in sun.net.www.http.KeepAliveStream [due to skip()]

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.1_11
    • 1.3.0
    • core-libs
    • 11
    • x86
    • windows_nt
    • Verified



        Name: krC82822 Date: 11/23/2000


        23 Nov 2000, eval1127@eng -- the current merlin sources indicate that
        skip() is now called ONLY if it won't block (see Comments section).
        This may eliminate the cited problem. Am filing a bug only to
        make sure the user's problem is addressed by the merlin changes.
        ------------
        java version "1.3.0"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
        Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)



        We have encountered a really strange problem with
        sun.net.www.http.KeepAliveStream. It seems that under certain network
        condition (ie proxy server goes down), KeepAliveStream.close() goes into an
        infinite loop and never exits. Upon further investigation, it seems that the
        following code inside that function is the reason.

        for (long l_0_ = 0L; l_0_ < l; l_0_ = skip(l)) {
        l -= l_0_;
                }

        Apparently under some network circumstances, skip() will return 0. As a result
        l never changes and the loop does not exit. Has anyone else encountered this
        problem? Can you tell us how you get around it? Thanks.

        It seems that this problem only happens when my program is reading from an
        inputstream gotten from a URLConnection and the connection somehow dies. I am
        going through a MS proxy 2.0 running on NT 4 sp6. But this problem happens
        even if we connect directly to the Internet.
        (Review ID: 112749)
        ======================================================================

              michaelm Michael McMahon
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: