You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alejandro Calbazana <ac...@rcn.com> on 2001/09/01 21:56:04 UTC

Segmentation Fault when modifying classpath?!

Ok...

All this surrounds modifying tomcat.sh per install instructions found in
apache-soap.

Per Apache-Soap's "Getting Tomcat Ready", I have changed my classpath to put
xerces.jar at the beginning of my classpath as follows:
....
unset CLASSPATH

CLASSPATH=/usr/local/java/lib/xerces.jar

for i in ${TOMCAT_HOME}/lib/* ; do
  if [ "$CLASSPATH" != "" ]; then
    CLASSPATH=${CLASSPATH}:$i
  else
    CLASSPATH=$i
  fi
done
...

When starting tomcat I get the following:

Using classpath:
/usr/local/java/lib/xerces.jar:
/opt/jakarta-tomcat-3.2.3/lib/activation.jar:
/opt/jakarta-tomcat-3.2.3/lib/ant.jar:
/opt/jakarta-tomcat-3.2.3/lib/jasper.jar:
/opt/jakarta-tomcat-3.2.3/lib/LICENSE:
/opt/jakarta-tomcat-3.2.3/lib/mail.jar:
/opt/jakarta-tomcat-3.2.3/lib/servlet.jar:
/opt/jakarta-tomcat-3.2.3/lib/soap.jar:
/opt/jakarta-tomcat-3.2.3/lib/test:
/opt/jakarta-tomcat-3.2.3/lib/webserver.jar:
/opt/jakarta-tomcat-3.2.3/lib/xerces.jar:
/usr/local/java/jdk1.3.1/lib/tools.jar

/opt/jakarta-tomcat-3.2.3/bin/tomcat.sh: line 181: 12681 Segmentation fault
$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME}
org.apache.tomcat.startup.Tomcat "$@"

I can not figure out for the life of me why this is happening.  I've also
tried setting the classpath from the shell with the exact same results.  Any
hints appreciated.

Thanks,

Al Calbazana


RE: Segmentation Fault when modifying classpath?!

Posted by Robert Finneran <ro...@digitalskyscrapers.com>.
I concur. It is a JVM problem.
I've seen this problem with several java applications (Tomcat, Xerces,
JBoss, Jetty, etc.)
It is a problem that occurs when running Sun's JDK 1.3.1 under the new
Linux 2.4 kernel. (i.e. Redhat 7.1)
I noticed that this bug was documented as fixed in Sun's JDK SE 1.4.0 Beta
2.
The good news is that the segmentation problem was fixed.
That bad news was that my JSP pages would no longer run.

Here is a copy of my original post of this problem.
Unfortunatly, nobody has replied to my original posting :-(

+++++++

Hi,

I recently switched to jdkse1.4.0 Beta 2 because I was having seg faults
with Sun JDK 1.3.1
using RH 7.1 Linux 2.4.3-12.

Now that I've switched, my servlets run fine,
but Jasper barfs when I try run .JSP pages:

"org.apache.jasper.JasperException: JASPER: Unable to compile class for
JSPerror: Invalid class file format in
/usr/java/j2sdk1.4.0/jre/lib/rt.jar(java/io/PrintWriter.class).
The major.minor version '48.0' is too recent for this tool to understand."

I'm wondering if this is easy to fix
(I'll go snooping around in apache land)
or should I use blackdown JDK 1.3.1 some flavor if IBM jdk?

Any advice would be appreciated!


-----Original Message-----
From: simon [mailto:simon@lexues.co.jp]
Sent: Sunday, September 02, 2001 5:23 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Segmentation Fault when modifying classpath?!


Hello Al,

If you set the environment variable TOMCAT_OPTS to -classic you are not
actually setting a tomcat option but a JVM option.  This
means that you will no longer be using the 'hotspot' feature of the JVM,
which will obviously have an impact on performance.

I had all sorts of segfault problems using the Sun JVM 1.3.1 on Linux 7.1
and 6.2.  I trawled through the Bug Parade on the javasoft
site.  Some of it got really technical and there were as many solutions as
there were opinions.  I tried most of them but the most
successful was switching to the IBM JVM.  The segfaults stopped and I am
still getting the performance benefit of a JIT compiler.
(I therefore concluded that it is a problem with the JVM - same as Pete
below)

I'm sorry that this is just another 'it worked for me' but I hope it
helps.

simon

----- Original Message -----
From: "Alejandro Calbazana" <ac...@rcn.com>
To: <to...@jakarta.apache.org>
Sent: Monday, September 03, 2001 12:06 AM
Subject: Re: Segmentation Fault when modifying classpath?!


> Thanks Pete!  I will give that a shot.  I am using Sun's JDK1.3.1 under
> Redhat 7.1 (sorry, forget to mention my setup!).
>
> I did, however, run across a post detailing a problem similar to mine.
The
> suggested solution was to set the TOMCAT_OPTS environment variable
> to -classic.  After setting this environment variable, everything ran
> nicely.  If anyone can give me any more detail on either solution, that
> would be great.  I hate to implement a fix but not know the root cause.
>
> Pete, your explanation seems plausable.  I'd be interested in knowing if
> this is a known JVM bug or a Xerces bug?
>
> Al
>
> ----- Original Message -----
> From: "pete" <pe...@claudia.dyn.dhs.org>
> To: <to...@jakarta.apache.org>
> Sent: Sunday, September 02, 2001 3:25 AM
> Subject: Re: Segmentation Fault when modifying classpath?!
>
>
> > You're not by any chance using Suns JDK 1.3.1 and Linux are you?
> >
> >
> > If you are, add 'ulimit -s 2048' to tomcat.sh (or just type it in the
> > shell you launch tomcat from).
> >
> > This limits the maximum stack size, but i can't give you more detail
> > than that, all i know is it works for me.
> >
> > This problem only seems to show up with xerces, but since it works
fine
> > on other JVMs, and on Sun JDK1.3.1 on Windows, i'd say Sun have a
buggy
> > JVM here.
> >
> > IBM's JDK does not have this problem, so that may be another option
for
> you.
> >
> > Hope that helps
> >
> > -Pete
> >
> > >Ok...
> > >
> > >All this surrounds modifying tomcat.sh per install instructions found
in
> > >apache-soap.
> > >
> > >Per Apache-Soap's "Getting Tomcat Ready", I have changed my classpath
to
> put
> > >xerces.jar at the beginning of my classpath as follows:
> > >....
> > >unset CLASSPATH
> > >
> > >CLASSPATH=/usr/local/java/lib/xerces.jar
> > >
> > >for i in ${TOMCAT_HOME}/lib/* ; do
> > >  if [ "$CLASSPATH" != "" ]; then
> > >    CLASSPATH=${CLASSPATH}:$i
> > >  else
> > >    CLASSPATH=$i
> > >  fi
> > >done
> > >...
> > >
> > >When starting tomcat I get the following:
> > >
> > >Using classpath:
> > >/usr/local/java/lib/xerces.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/activation.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/ant.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/jasper.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/LICENSE:
> > >/opt/jakarta-tomcat-3.2.3/lib/mail.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/servlet.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/soap.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/test:
> > >/opt/jakarta-tomcat-3.2.3/lib/webserver.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/xerces.jar:
> > >/usr/local/java/jdk1.3.1/lib/tools.jar
> > >
> > >/opt/jakarta-tomcat-3.2.3/bin/tomcat.sh: line 181: 12681 Segmentation
> fault
> > >$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME}
> > >org.apache.tomcat.startup.Tomcat "$@"
> > >
> > >I can not figure out for the life of me why this is happening.  I've
also
> > >tried setting the classpath from the shell with the exact same
results.
> Any
> > >hints appreciated.
> > >
> > >Thanks,
> > >
> > >Al Calbazana
> > >
> >
> >
> >
> >
>
>

Re: Segmentation Fault when modifying classpath?!

Posted by simon <si...@lexues.co.jp>.
Hello Al,

If you set the environment variable TOMCAT_OPTS to -classic you are not actually setting a tomcat option but a JVM option.  This
means that you will no longer be using the 'hotspot' feature of the JVM, which will obviously have an impact on performance.

I had all sorts of segfault problems using the Sun JVM 1.3.1 on Linux 7.1 and 6.2.  I trawled through the Bug Parade on the javasoft
site.  Some of it got really technical and there were as many solutions as there were opinions.  I tried most of them but the most
successful was switching to the IBM JVM.  The segfaults stopped and I am still getting the performance benefit of a JIT compiler.
(I therefore concluded that it is a problem with the JVM - same as Pete below)

I'm sorry that this is just another 'it worked for me' but I hope it helps.

simon

----- Original Message -----
From: "Alejandro Calbazana" <ac...@rcn.com>
To: <to...@jakarta.apache.org>
Sent: Monday, September 03, 2001 12:06 AM
Subject: Re: Segmentation Fault when modifying classpath?!


> Thanks Pete!  I will give that a shot.  I am using Sun's JDK1.3.1 under
> Redhat 7.1 (sorry, forget to mention my setup!).
>
> I did, however, run across a post detailing a problem similar to mine.  The
> suggested solution was to set the TOMCAT_OPTS environment variable
> to -classic.  After setting this environment variable, everything ran
> nicely.  If anyone can give me any more detail on either solution, that
> would be great.  I hate to implement a fix but not know the root cause.
>
> Pete, your explanation seems plausable.  I'd be interested in knowing if
> this is a known JVM bug or a Xerces bug?
>
> Al
>
> ----- Original Message -----
> From: "pete" <pe...@claudia.dyn.dhs.org>
> To: <to...@jakarta.apache.org>
> Sent: Sunday, September 02, 2001 3:25 AM
> Subject: Re: Segmentation Fault when modifying classpath?!
>
>
> > You're not by any chance using Suns JDK 1.3.1 and Linux are you?
> >
> >
> > If you are, add 'ulimit -s 2048' to tomcat.sh (or just type it in the
> > shell you launch tomcat from).
> >
> > This limits the maximum stack size, but i can't give you more detail
> > than that, all i know is it works for me.
> >
> > This problem only seems to show up with xerces, but since it works fine
> > on other JVMs, and on Sun JDK1.3.1 on Windows, i'd say Sun have a buggy
> > JVM here.
> >
> > IBM's JDK does not have this problem, so that may be another option for
> you.
> >
> > Hope that helps
> >
> > -Pete
> >
> > >Ok...
> > >
> > >All this surrounds modifying tomcat.sh per install instructions found in
> > >apache-soap.
> > >
> > >Per Apache-Soap's "Getting Tomcat Ready", I have changed my classpath to
> put
> > >xerces.jar at the beginning of my classpath as follows:
> > >....
> > >unset CLASSPATH
> > >
> > >CLASSPATH=/usr/local/java/lib/xerces.jar
> > >
> > >for i in ${TOMCAT_HOME}/lib/* ; do
> > >  if [ "$CLASSPATH" != "" ]; then
> > >    CLASSPATH=${CLASSPATH}:$i
> > >  else
> > >    CLASSPATH=$i
> > >  fi
> > >done
> > >...
> > >
> > >When starting tomcat I get the following:
> > >
> > >Using classpath:
> > >/usr/local/java/lib/xerces.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/activation.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/ant.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/jasper.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/LICENSE:
> > >/opt/jakarta-tomcat-3.2.3/lib/mail.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/servlet.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/soap.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/test:
> > >/opt/jakarta-tomcat-3.2.3/lib/webserver.jar:
> > >/opt/jakarta-tomcat-3.2.3/lib/xerces.jar:
> > >/usr/local/java/jdk1.3.1/lib/tools.jar
> > >
> > >/opt/jakarta-tomcat-3.2.3/bin/tomcat.sh: line 181: 12681 Segmentation
> fault
> > >$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME}
> > >org.apache.tomcat.startup.Tomcat "$@"
> > >
> > >I can not figure out for the life of me why this is happening.  I've also
> > >tried setting the classpath from the shell with the exact same results.
> Any
> > >hints appreciated.
> > >
> > >Thanks,
> > >
> > >Al Calbazana
> > >
> >
> >
> >
> >
>
>


Re: Segmentation Fault when modifying classpath?!

Posted by pete <pe...@claudia.dyn.dhs.org>.
Yeah using -classic works too, but you're much better off using IBM's 
JVM in that case.

I believe the root cause is the fact that Sun make some assumptions 
(perhaps true for Solaris) with regard to the minimum available stack 
size for a process, which are not necessarily true under other unices.

This is definitely a JVM bug, and the 'ulimit s 2048' fix is suggested 
somewhere on the Sun site. Finding it again would be a pain in the ass, 
but you might get results searching for 'ulimit' or something.

-Pete


>
>
>I did, however, run across a post detailing a problem similar to mine.  The
>suggested solution was to set the TOMCAT_OPTS environment variable
>to -classic.  After setting this environment variable, everything ran
>nicely.  If anyone can give me any more detail on either solution, that
>would be great.  I hate to implement a fix but not know the root cause.
>
>Pete, your explanation seems plausable.  I'd be interested in knowing if
>this is a known JVM bug or a Xerces bug?
>
>Al
>
>----- Original Message -----
>From: "pete" <pe...@claudia.dyn.dhs.org>
>To: <to...@jakarta.apache.org>
>Sent: Sunday, September 02, 2001 3:25 AM
>Subject: Re: Segmentation Fault when modifying classpath?!
>
>
>>You're not by any chance using Suns JDK 1.3.1 and Linux are you?
>>
>>
>>If you are, add 'ulimit -s 2048' to tomcat.sh (or just type it in the
>>shell you launch tomcat from).
>>
>>This limits the maximum stack size, but i can't give you more detail
>>than that, all i know is it works for me.
>>
>>This problem only seems to show up with xerces, but since it works fine
>>on other JVMs, and on Sun JDK1.3.1 on Windows, i'd say Sun have a buggy
>>JVM here.
>>
>>IBM's JDK does not have this problem, so that may be another option for
>>
>you.
>
>>Hope that helps
>>
>>-Pete
>>
>>>Ok...
>>>
>>>All this surrounds modifying tomcat.sh per install instructions found in
>>>apache-soap.
>>>
>>>Per Apache-Soap's "Getting Tomcat Ready", I have changed my classpath to
>>>
>put
>
>>>xerces.jar at the beginning of my classpath as follows:
>>>....
>>>unset CLASSPATH
>>>
>>>CLASSPATH=/usr/local/java/lib/xerces.jar
>>>
>>>for i in ${TOMCAT_HOME}/lib/* ; do
>>> if [ "$CLASSPATH" != "" ]; then
>>>   CLASSPATH=${CLASSPATH}:$i
>>> else
>>>   CLASSPATH=$i
>>> fi
>>>done
>>>...
>>>
>>>When starting tomcat I get the following:
>>>
>>>Using classpath:
>>>/usr/local/java/lib/xerces.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/activation.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/ant.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/jasper.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/LICENSE:
>>>/opt/jakarta-tomcat-3.2.3/lib/mail.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/servlet.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/soap.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/test:
>>>/opt/jakarta-tomcat-3.2.3/lib/webserver.jar:
>>>/opt/jakarta-tomcat-3.2.3/lib/xerces.jar:
>>>/usr/local/java/jdk1.3.1/lib/tools.jar
>>>
>>>/opt/jakarta-tomcat-3.2.3/bin/tomcat.sh: line 181: 12681 Segmentation
>>>
>fault
>
>>>$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME}
>>>org.apache.tomcat.startup.Tomcat "$@"
>>>
>>>I can not figure out for the life of me why this is happening.  I've also
>>>tried setting the classpath from the shell with the exact same results.
>>>
>Any
>
>>>hints appreciated.
>>>
>>>Thanks,
>>>
>>>Al Calbazana
>>>
>>
>>
>>




Re: Segmentation Fault when modifying classpath?!

Posted by Alejandro Calbazana <ac...@rcn.com>.
Thanks Pete!  I will give that a shot.  I am using Sun's JDK1.3.1 under
Redhat 7.1 (sorry, forget to mention my setup!).

I did, however, run across a post detailing a problem similar to mine.  The
suggested solution was to set the TOMCAT_OPTS environment variable
to -classic.  After setting this environment variable, everything ran
nicely.  If anyone can give me any more detail on either solution, that
would be great.  I hate to implement a fix but not know the root cause.

Pete, your explanation seems plausable.  I'd be interested in knowing if
this is a known JVM bug or a Xerces bug?

Al

----- Original Message -----
From: "pete" <pe...@claudia.dyn.dhs.org>
To: <to...@jakarta.apache.org>
Sent: Sunday, September 02, 2001 3:25 AM
Subject: Re: Segmentation Fault when modifying classpath?!


> You're not by any chance using Suns JDK 1.3.1 and Linux are you?
>
>
> If you are, add 'ulimit -s 2048' to tomcat.sh (or just type it in the
> shell you launch tomcat from).
>
> This limits the maximum stack size, but i can't give you more detail
> than that, all i know is it works for me.
>
> This problem only seems to show up with xerces, but since it works fine
> on other JVMs, and on Sun JDK1.3.1 on Windows, i'd say Sun have a buggy
> JVM here.
>
> IBM's JDK does not have this problem, so that may be another option for
you.
>
> Hope that helps
>
> -Pete
>
> >Ok...
> >
> >All this surrounds modifying tomcat.sh per install instructions found in
> >apache-soap.
> >
> >Per Apache-Soap's "Getting Tomcat Ready", I have changed my classpath to
put
> >xerces.jar at the beginning of my classpath as follows:
> >....
> >unset CLASSPATH
> >
> >CLASSPATH=/usr/local/java/lib/xerces.jar
> >
> >for i in ${TOMCAT_HOME}/lib/* ; do
> >  if [ "$CLASSPATH" != "" ]; then
> >    CLASSPATH=${CLASSPATH}:$i
> >  else
> >    CLASSPATH=$i
> >  fi
> >done
> >...
> >
> >When starting tomcat I get the following:
> >
> >Using classpath:
> >/usr/local/java/lib/xerces.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/activation.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/ant.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/jasper.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/LICENSE:
> >/opt/jakarta-tomcat-3.2.3/lib/mail.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/servlet.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/soap.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/test:
> >/opt/jakarta-tomcat-3.2.3/lib/webserver.jar:
> >/opt/jakarta-tomcat-3.2.3/lib/xerces.jar:
> >/usr/local/java/jdk1.3.1/lib/tools.jar
> >
> >/opt/jakarta-tomcat-3.2.3/bin/tomcat.sh: line 181: 12681 Segmentation
fault
> >$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME}
> >org.apache.tomcat.startup.Tomcat "$@"
> >
> >I can not figure out for the life of me why this is happening.  I've also
> >tried setting the classpath from the shell with the exact same results.
Any
> >hints appreciated.
> >
> >Thanks,
> >
> >Al Calbazana
> >
>
>
>
>


Re: Segmentation Fault when modifying classpath?!

Posted by pete <pe...@claudia.dyn.dhs.org>.
You're not by any chance using Suns JDK 1.3.1 and Linux are you?


If you are, add 'ulimit -s 2048' to tomcat.sh (or just type it in the 
shell you launch tomcat from).

This limits the maximum stack size, but i can't give you more detail 
than that, all i know is it works for me.

This problem only seems to show up with xerces, but since it works fine 
on other JVMs, and on Sun JDK1.3.1 on Windows, i'd say Sun have a buggy 
JVM here.

IBM's JDK does not have this problem, so that may be another option for you.

Hope that helps

-Pete

>Ok...
>
>All this surrounds modifying tomcat.sh per install instructions found in
>apache-soap.
>
>Per Apache-Soap's "Getting Tomcat Ready", I have changed my classpath to put
>xerces.jar at the beginning of my classpath as follows:
>....
>unset CLASSPATH
>
>CLASSPATH=/usr/local/java/lib/xerces.jar
>
>for i in ${TOMCAT_HOME}/lib/* ; do
>  if [ "$CLASSPATH" != "" ]; then
>    CLASSPATH=${CLASSPATH}:$i
>  else
>    CLASSPATH=$i
>  fi
>done
>...
>
>When starting tomcat I get the following:
>
>Using classpath:
>/usr/local/java/lib/xerces.jar:
>/opt/jakarta-tomcat-3.2.3/lib/activation.jar:
>/opt/jakarta-tomcat-3.2.3/lib/ant.jar:
>/opt/jakarta-tomcat-3.2.3/lib/jasper.jar:
>/opt/jakarta-tomcat-3.2.3/lib/LICENSE:
>/opt/jakarta-tomcat-3.2.3/lib/mail.jar:
>/opt/jakarta-tomcat-3.2.3/lib/servlet.jar:
>/opt/jakarta-tomcat-3.2.3/lib/soap.jar:
>/opt/jakarta-tomcat-3.2.3/lib/test:
>/opt/jakarta-tomcat-3.2.3/lib/webserver.jar:
>/opt/jakarta-tomcat-3.2.3/lib/xerces.jar:
>/usr/local/java/jdk1.3.1/lib/tools.jar
>
>/opt/jakarta-tomcat-3.2.3/bin/tomcat.sh: line 181: 12681 Segmentation fault
>$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME}
>org.apache.tomcat.startup.Tomcat "$@"
>
>I can not figure out for the life of me why this is happening.  I've also
>tried setting the classpath from the shell with the exact same results.  Any
>hints appreciated.
>
>Thanks,
>
>Al Calbazana
>