You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/03/26 20:49:39 UTC
[Bug 54756] New: EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
Bug ID: 54756
Summary: EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Product: Tomcat 7
Version: 7.0.37
Hardware: PC
Status: NEW
Severity: major
Priority: P2
Component: Connectors
Assignee: dev@tomcat.apache.org
Reporter: mshaw@cortive.ca
Classification: Unclassified
Created attachment 30105
--> https://issues.apache.org/bugzilla/attachment.cgi?id=30105&action=edit
Crash log
We updated server from 7.0.29 to 7.0.37 and within 48 hours we have observed a
crash. Log is attached.
Another similar report can be found here:
https://issues.apache.org/bugzilla/show_bug.cgi?id=54046
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |RESOLVED
Resolution|--- |FIXED
--- Comment #10 from Mark Thomas <ma...@apache.org> ---
No further reports of errors in almost 2 months. I am going to assume that this
issue is fixed. Feel free to re-open it if that is not the case.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
--- Comment #3 from Michael <su...@shaw.ca> ---
Thanks Konstantin. Didn't see where I could update the MIME type, but I see
that now.
Running a few test to see if I can pin point the issue. Thought I would start
with the crash log. Originally I suspected the Atmosphere Framework, but they
suggested it looks like a Tomcat issue.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
--- Comment #4 from Sebb <se...@apache.org> ---
A bit more info from the crash log: the original cause of the crash is an
access violation:
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [tcnative-1.dll+0x52f0] Java_org_apache_tomcat_jni_Socket_send+0xa0
The thread that invoked the JNI code is as shown in comment 2.
Ideally, it should not be possible to crash the JVM - whether that is by bugs
in the JVM native code or in user-provided JNI code as is the case here.
Seems to me it should be possible to fix tcnative so it does not generate this
access violation. The calling code has likely violated an expected calling
sequence or pre-condition, but IMO that should still not be able to cause an
access violation. Rather, some kind of exception should be thrown & should give
a clue as to what went wrong so the application can be more readily fixed.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
--- Comment #6 from Sebb <se...@apache.org> ---
(In reply to comment #5)
> (In reply to comment #4)
> > Ideally, it should not be possible to crash the JVM - whether that is by
> > bugs in the JVM native code or in user-provided JNI code as is the case here.
>
> Unfortunately, that's not true. Native code invoked by JNI has full access
> to the memory of the process, so it can scribble all over the Java heap, C
> heap, the stack of any thread, or any other writable bits and pieces. Get a
> bit of pointer arithmetic wrong or make use of a dead object and it's game
> over.
Indeed.
[Sorry, my comment was ambiguous / too terse.]
What I meant by the phrase "Ideally, it should not ..." was that JNI code
should be defensively written such that the calling Java code cannot cause a
crash.
> However, since the problem does appear to be in tcnative, one has to
> presume it's fixable.
Yes, hopefully!
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
Michael <ms...@cortive.ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #30105|0 |1
is obsolete| |
--- Comment #1 from Michael <ms...@cortive.ca> ---
Created attachment 30106
--> https://issues.apache.org/bugzilla/attachment.cgi?id=30106&action=edit
Crash log
Adding log as plain text. Didn't see it was set to auto detect.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #7 from Mark Thomas <ma...@apache.org> ---
I've taken a look at this and have found an issue in that errors on the
outbound side were silently swallowed when APR/native was being used. I suspect
the crash observed here is the result of continuing using a socket that has
already closed due to an error.
I have fixed this particular issue and the fix will be in 7.0.40 onwards.
Please test once 7.0.40 is released and let us know if the issue is resolved.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
--- Comment #9 from Sebb <se...@apache.org> ---
(In reply to comment #7)
> I've taken a look at this and have found an issue in that errors on the
> outbound side were silently swallowed when APR/native was being used. I
> suspect the crash observed here is the result of continuing using a socket
> that has already closed due to an error.
>
> I have fixed this particular issue and the fix will be in 7.0.40 onwards.
What if the user code ignores the new error?
Is it still possible for user code to continue using the socket?
I had a look at the patch but it only seemed to report the error, but maybe I'm
missing something and it's not possible to get at the closed socket using Java
code external to Tomcat.
It's good to report the error, but I would have thought the safest option would
be to fix APR/native so it cannot be crashed externally - whether from Tomcat
code or application code.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
--- Comment #8 from Michael <su...@shaw.ca> ---
Thanks Mark, will do.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
--- Comment #5 from Chuck Caldarale <ch...@unisys.com> ---
(In reply to comment #4)
> Ideally, it should not be possible to crash the JVM - whether that is by
> bugs in the JVM native code or in user-provided JNI code as is the case here.
Unfortunately, that's not true. Native code invoked by JNI has full access to
the memory of the process, so it can scribble all over the Java heap, C heap,
the stack of any thread, or any other writable bits and pieces. Get a bit of
pointer arithmetic wrong or make use of a dead object and it's game over.
However, since the problem does appear to be in tcnative, one has to presume
it's fixable.
This particular problem is attempting to read from address 0x0000000000000040,
so I'm guessing the native code picked up a null pointer to something and is
trying to look at offset 0x40 within the structure. Since this is using the
relatively new WebSocket capability with APR, I would suspect some timing issue
in socket handling.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 54756] EXCEPTION_ACCESS_VIOLATION with APR crashing Tomcat
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54756
Konstantin Kolinko <kn...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> ---
1. No need to re-upload an attachment. You can edit its mime-type.
2. You have not mentioned, but here is the essential bit. The thread that
crashed:
(citing it for sake of those who search through bugzilla)
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j org.apache.tomcat.jni.Socket.send(J[BII)I+0
j org.apache.coyote.http11.upgrade.UpgradeAprProcessor.write(I)V+14
j org.apache.coyote.http11.upgrade.UpgradeOutbound.write(I)V+5
j
org.apache.catalina.websocket.WsOutbound.doWriteBytes(Ljava/nio/ByteBuffer;Z)V+45
j
org.apache.catalina.websocket.WsOutbound.doWriteText(Ljava/nio/CharBuffer;Z)V+65
j
org.apache.catalina.websocket.WsOutbound.writeTextMessage(Ljava/nio/CharBuffer;)V+44
j
org.atmosphere.container.version.TomcatWebSocket.write(Lorg/atmosphere/cpr/AtmosphereResponse;Ljava/lang/String;)Lorg/atmosphere/websocket/WebSocket;+103
j
org.atmosphere.container.version.TomcatWebSocket.write(Lorg/atmosphere/cpr/AtmosphereResponse;Ljava/lang/String;)Lorg/atmosphere/cpr/AsyncIOWriter;+3
j org.atmosphere.cpr.AtmosphereResponse$4.write(Ljava/lang/String;)V+36
j
org.atmosphere.handler.AbstractReflectorAtmosphereHandler.onStateChange(Lorg/atmosphere/cpr/AtmosphereResourceEvent;)V+337
j
org.atmosphere.cpr.DefaultBroadcaster.invokeOnStateChange(Lorg/atmosphere/cpr/AtmosphereResource;Lorg/atmosphere/cpr/AtmosphereResourceEvent;)V+7
j
org.atmosphere.cpr.DefaultBroadcaster.prepareInvokeOnStateChange(Lorg/atmosphere/cpr/AtmosphereResource;Lorg/atmosphere/cpr/AtmosphereResourceEvent;)V+97
j
org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(Lorg/atmosphere/cpr/DefaultBroadcaster$AsyncWriteToken;)V+313
j org.atmosphere.cpr.DefaultBroadcaster$3.run()V+385
j java.util.concurrent.Executors$RunnableAdapter.call()Ljava/lang/Object;+4
j java.util.concurrent.FutureTask$Sync.innerRun()V+30
j java.util.concurrent.FutureTask.run()V+4
j
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Ljava/lang/Runnable;)V+59
j java.util.concurrent.ThreadPoolExecutor$Worker.run()V+28
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org