https://issues.apache.org/bugzilla/show_bug.cgi?id=48584

--- Comment #8 from Konstantin Kolinko <knst.koli...@gmail.com> 2010-01-29 
06:02:09 UTC ---
1. When the crash happens, no event is recorded in the Event Viewer. I think
that the crash is intercepted by JVM (that writes that crash report file) so
the system does not know about it. The crash report file is written to the
current working directory of java process. In my case it was
%CATALINA_HOME%/bin, but it can be elsewhere. Though it might be, indeed, that
6.0.14 does not experience the crash. Thank you for the report.


2. Attachment 24903 - a batch file, that calls catalina start/stop in a cycle
with some small delays.

Even if I cannot always reproduce the error with several tries, I can reproduce
it with the batch.


3. The message, that is printed by org.apache.tomcat.jni.Error, in English will
be
"A blocking operation was interrupted by a call to WSACancelBlockingCall"

It is the message for the WSAEINTR socket error code, and means that some
function call was interrupted, see

http://support.microsoft.com/kb/819124

After playing a bit with the ".encoding" option of a FileHandler (in
logging.properties) I was able to read it, but, indeed, TC-Native (or APR
functions that it calls) does not respect system encoding. The message was
processed with direct byte->char conversion, as if were in ISO-8859-1. By
setting "1catalina.org.apache.juli.FileHandler.encoding = ISO-8859-1" and
reading the log file with windows-1251 I was able to read it. It is wrong, but
it is another issue.

So, it looks that this error message is expected. What is wrong is that it
generates a crash.


4. I tested with TC 7(trunk), where I added diagnostic messages around the
AprLifecycleListener.terminateAPR() method - see attachment 24904.

In the logs I see four variations of how the events happen:

a)
29.01.2010 6:26:16 org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8009
29.01.2010 6:26:16 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminating APR
29.01.2010 6:26:16 org.apache.tomcat.util.net.AprEndpoint$Acceptor run
SEVERE: Socket accept failed
org.apache.tomcat.jni.Error: ???????? ???????????? ???????? ???????
WSACancelBlockingCall.  
    at org.apache.tomcat.jni.Socket.accept(Native Method)
    at
org.apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:777)
    at java.lang.Thread.run(Unknown Source)
29.01.2010 6:26:16 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminated APR

b)
29.01.2010 6:27:16 org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8009
29.01.2010 6:27:17 org.apache.tomcat.util.net.AprEndpoint$Acceptor run
SEVERE: Socket accept failed
org.apache.tomcat.jni.Error: ???????? ???????????? ???????? ???????
WSACancelBlockingCall.  
    at org.apache.tomcat.jni.Socket.accept(Native Method)
    at
org.apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:777)
    at java.lang.Thread.run(Unknown Source)
29.01.2010 6:27:17 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminating APR
29.01.2010 6:27:17 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminated APR

c)
29.01.2010 6:34:19 org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8009
29.01.2010 6:34:19 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminating APR
29.01.2010 6:34:19 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminated APR

d)
29.01.2010 6:40:45 org.apache.coyote.ajp.AjpAprProtocol destroy
INFO: Stopping Coyote AJP/1.3 on ajp-8009
29.01.2010 6:40:45 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminating APR
29.01.2010 6:40:45 org.apache.catalina.core.AprLifecycleListener terminateAPR
INFO: Terminated APR
29.01.2010 6:40:45 org.apache.tomcat.util.net.AprEndpoint$Acceptor run
SEVERE: Socket accept failed
org.apache.tomcat.jni.Error: ???????? ???????????? ???????? ???????
WSACancelBlockingCall.  
    at org.apache.tomcat.jni.Socket.accept(Native Method)
    at
org.apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:777)
    at java.lang.Thread.run(Unknown Source)


When c) happens, a crash report file is generated.

The AprLifecycleListener.terminateAPR() method calls
o.a.t.jni.Library#terminate() that is implemented as a method in jnilib.c.

TCN_IMPLEMENT_CALL(void, Library, terminate)(TCN_STDARGS)
calls
        apr_pool_destroy(p);
        apr_terminate();

so if return from
TCN_IMPLEMENT_CALL(jlong, Socket, accept)(TCN_STDARGS, jlong sock)
of network.c happens after that call ends, as in d), it will face a destroyed
pool and terminated APR. Thus it is no wonder that EXCEPTION_ACCESS_VIOLATION
is reported.

5. So, the question is why 
org.apache.tomcat.util.net.AprEndpoint$Acceptor.run(AprEndpoint.java:1156)
was still running when AprLifecycleListener.terminateAPR() was already called.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to