tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: Buggy java native call kills tomcat
Date Thu, 04 Apr 2013 04:11:33 GMT
> From: Dale Ogilvie [mailto:Dale_Ogilvie@trimble.com] 
> Subject: Buggy java native call kills tomcat

> My question: can we protect ourselves from total instance failure, i.e.
> restrict the damage to the death of just the app calling the native
> library? Is there a way to make the tomcat VM survive a badly written
> native component?

Simple answer: nope.  In a Windows or Linux environment, native code has full access to the
entire address space of the process, and can therefore scribble over anything it feels like,
corrupting the JVM.  In general, you should try to avoid native code called from Java like
the plague; not doing so means you might as well write in C (or worse, C++).  If you must
use native code, running it in a separate process and communicating with it via pipes or sockets
is much safer, but then you have to deal with timeouts and other error recovery issues.  Another
option is to run a webapp that uses native code in a separate Tomcat instance (using a different
port), and forward requests to it from the primary Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus
for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message