You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jerry Malcolm <te...@malcolms.com> on 2015/08/31 02:33:04 UTC

Webapp killing entire Tomcat process

I am running TC 8.0.24.  It's been stable ever since I installed it.  I 
have been making changes/enhancements to a web app that has been in 
production for many years.  I have now encountered a situation when I 
request a certain page, the entire Tomcat process dies.  Literally, the 
Windows service is stopped.  There are no errors in any of the Tomcat 
log files.  It's like I went to the task manager and killed the process 
from there.  Fortunately it's on a development machine.  But I've got to 
figure this out before I put it on a production machine.

I have been developing web apps for over 15 years.  I've obviously had 
lots of bugs in my code over the years.  But I've never encountered a 
situation where a coding problem caused the entire web app server to 
die.  I'm am pretty much certain that it's something I'm doing in my 
code to cause it.  But in my opinion, no matter what happens in the 
code, TC shouldn't completely die, correct?  So it looks like my bad 
code has possibly exposed a vulnerability in TC. it's very frustrating 
and just about impossible to debug when every time I call the page that 
has the problem, I then have to wait 3-4 minutes after restarting the TC 
service for it to come back up before I can do anything again.  I'm 
pretty much relegated to table-top visual debug of the code and hope I 
accidentally see what's wrong.  Difficult process at best.  I feel like 
I'm shooting blind.

I guess my question is, do you have any suggestions for anything my code 
might do that could kill the process?  At least it might give me a start 
at what to look for.

Thanks.

Jerry

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


Re: Webapp killing entire Tomcat process

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Chuck,

On 8/30/15 8:52 PM, Caldarale, Charles R wrote:
>> From: Jerry Malcolm [mailto:techstuff@malcolms.com] Subject:
>> Webapp killing entire Tomcat process
> 
>> But in my opinion, no matter what happens in the code, TC
>> shouldn't completely die, correct?
> 
> Nope, it's all one process, and any thread can take it out.
> Running with a security manager reduces the chance, but doesn't
> preclude it.  Simple silliness such as calling System.exit() will
> also stop everything.
> 
>> I guess my question is, do you have any suggestions for anything
>> my code might do that could kill the process?  At least it might
>> give me a start at what to look for.
> 
> The first step is to stop running Tomcat as a service, and instead
> start it from a command prompt using the startup.bat script.  You
> can also attach a debugger this way and watch what's going on, set
> breakpoints, etc.

+1

Having access to stdout/stderr is very helpful. I'm not sure what the
Windows service runner does with those streams, but you ought to find
them and look at the history.

If it's not a System.exit() (which would be very susprising to find in
a web application's code), it's more likely to be something like a JVM
bug or some native component (like tcnative) crashing the JVM.

Even OOME doesn't kill the JVM... it just likely lobotomizes the
application that's currently running within it.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJV5GihAAoJEBzwKT+lPKRYUb8P/0uvJukA9SJFrWCjwo+FwVAG
eGTJVYbny38xd02+3hNTfXrfVPENzDhwWaTEkvcXUUp3jy/IgEgzQJdfTmVe55PM
sYY5CiFgDSsSYkHZ125k7En3GiIH94pGhL6CojXIvW7Z8oGL0L9WIoPC6QQSjcUc
VYBfcYTY+lCli8lkU6OXbnfAZ8aOJoyuG7SQCffor/5ZHS09tLTCry52J+hTf+ro
K5Fop10Wpk3r7dOUF5hBVC9xk4kJZpiMLxeKdXDfjp10QHF8AeJ5r0B0halTfl4G
GEzboxsAgF/cavktnmUsVrJvarG8mlHl2anvjHegnKPqrU+i0zMRRt5ul/kqZGxI
sEfKZow8jw6n/Bc1KinfeK+C65wQ24rKSEi28hUyFDh6Rve1DvRZn5MsyK2//xpG
6u2mZIQMjW0jbsazRqDbA0YVBiKkUHlI3bHpRBKklC4wQ477KeMiB1AX70l0hocr
3mzjimG6hb4U+Am8lI6MSGjU4djU9Vl8HtlCSDiovldV7GhQInceRRCZL04BHDaG
qLy+G6QqwJyc51d8jDjakP9DqvFFf0x14Z63+Dwog/kmNp33b3sRAMXr0uF8aUIK
4/ZyKULqv1oRk5ZBIRDa++da3ZHDI6YHmrPVIxfH+XHcfG3AqXlPGoOCEQ9txvG6
QKgbLnzjQwOrV/WkAJae
=Y0v/
-----END PGP SIGNATURE-----

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


RE: Webapp killing entire Tomcat process

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Jerry Malcolm [mailto:techstuff@malcolms.com] 
> Subject: Webapp killing entire Tomcat process

> But in my opinion, no matter what happens in the code, TC shouldn't 
> completely die, correct?

Nope, it's all one process, and any thread can take it out.  Running with a security manager reduces the chance, but doesn't preclude it.  Simple silliness such as calling System.exit() will also stop everything.

> I guess my question is, do you have any suggestions for anything my code
> might do that could kill the process?  At least it might give me a start 
> at what to look for.

The first step is to stop running Tomcat as a service, and instead start it from a command prompt using the startup.bat script.  You can also attach a debugger this way and watch what's going on, set breakpoints, etc.

 - 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