On 06/12/2020 21:49, Rainer Jung wrote:

<snip/>

> I don't know, whether this is new, but I observe a loop when running
>         at
> java.util.concurrent.CountDownLatch.await(CountDownLatch.java:236)
>         at org.apache.tomcat.util.net.TestSsl.testPost(TestSsl.java:153)

<snip/>

> The loop happens in
> 
> "Thread-8" prio=3 tid=0x00692800 nid=0x43 runnable [0xe5bff000]
>    java.lang.Thread.State: RUNNABLE
>         at sun.security.ssl.AppInputStream.read(AppInputStream.java:92)
>         - locked <0xed614d38> (a sun.security.ssl.AppInputStream)
>         at sun.security.ssl.AppInputStream.read(AppInputStream.java:69)
>         - locked <0xed614d38> (a sun.security.ssl.AppInputStream)
>         at org.apache.tomcat.util.net.TestSsl$1.run(TestSsl.java:128)
> 
> "Thread-8" prio=3 tid=0x00692800 nid=0x43 runnable [0xe5bff000]
>    java.lang.Thread.State: RUNNABLE
>         at org.apache.tomcat.util.net.TestSsl$1.run(TestSsl.java:128)
> 
> 
> Another stack I captured was:
> 
> Thread t@67: (state = IN_JAVA)
>  - java.lang.StringBuilder.append(java.lang.String) @bci=2, line=132
> (Compiled frame; information may be imprecise)
>  - sun.security.ssl.SSLSocketImpl.checkEOF() @bci=96, line=1496
> (Compiled frame)
>  - sun.security.ssl.AppInputStream.read(byte[], int, int) @bci=46,
> line=92 (Compiled frame)
>  - sun.security.ssl.AppInputStream.read() @bci=7, line=69 (Compiled frame)
>  - org.apache.tomcat.util.net.TestSsl$1.run() @bci=151, line=128
> (Compiled frame)
> 
> The test loops using a lot of CPU, it is not just a hang.

<snip/>

The code in question is:

while (found != endOfHeaders.length) {
    if (is.read() == endOfHeaders[found]) {
        found++;
    } else {
        found = 0;
    }
}

If the read receives EOF before it reaches the end of the headers that
is going to trigger an infinite loop.

I see references to EOF in the thread dump so I am guess something went
wrong that truncated the response and triggered the infinite loop.

I'll look at fixing the test.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to