cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cp-tools-discuss] gjdoc works again!


From: Julian Scheid
Subject: Re: [Cp-tools-discuss] gjdoc works again!
Date: Thu, 21 Feb 2002 13:19:36 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.8) Gecko/20020204

Alex,

Alex Lancaster wrote:

AL> alex$:~/src/gnu.org/classpath-tools/gjdoc$ make -f
AL> Makefile.working run echo Compiling...  Compiling...
AL> /usr/lib/jdk1.3.1/bin/javac -d tmp -classpath
AL> "tmp:../tmp:/usr/lib/jdk1.3.1/lib/tools.jar"
AL> gnu/classpath/tools/gjdoc/*.java /usr/lib/jdk1.3.1/bin/java
AL> -classpath "tmp:../tmp:/usr/lib/jdk1.3.1/lib/tools.jar"
AL> gnu.classpath.tools.gjdoc.Main -doclet
AL> com.sun.tools.doclets.standard.Standard com.sun.javadoc
AL> -sourcepath ../../classpath:. -d docs Loading classes for package
AL> com.sun.javadoc ...  make: *** [run] Segmentation fault

AL> Is this a known problem (i.e. something that won't work as yet?)
AL> or should I break out gdb/jdb and fix it?

Well, I'm answering my own question, which is hopefully a good sign...

I decided to give jdb a shot (after all this is what free software and
distributed development is all about...), and yes, it was a pretty
simple bug.  The file reference for retrieving "package.html" wasn't
tested for null as well as exists(), so it's now fixed in CVS and
package parsing works quite dandily...

That's great, and yes this was a bug. However the fix would have been
to test only for null, as findSourceFile already checks for exists().
I'll fix that later on.

But what still bothers me is that Sun's VM isn't supposed to segfault!
Normally it should throw a nicely formatted NullPointerException giving
the stack trace including all relevant source location information.
I'm quite sure you already saw one of these in your Java carreer ;)

This is why I never ever had to use Jdb, as stack traces and debug
output provide me with everything I need to pinpoint a bug. And this
is also one of the reasons why I prefer Java over C.

While I saw kaffe crash and other free VMs as well, I can use one hand
to count all incidents where the Sun VM segfaulted, both on Win32 and
on Linux, after running it tens or hundreds of thousands of times.
And I think I remember all those crashes occured when using optional
APIs like Java3D, whose .so/.dll JNI extensions were a little buggy,
or when using Beta/Release Candidate JREs.

So what's going on here? What happens if you run code like the following,
does it crash or throw an exception? If it crashes, you should
check and possibly reinstall your Sun Java environment. Also you should
make sure that when using the Sun VM, no Classpath and Kaffe classes are
on your CLASSPATH.

If it doesn't crash again, then perhaps you encountered a rare unusual
situation?!

// Verify how VM handles a NullPointerException
class A {
  public static void main(String[] args) {
    Object o=null;
    o.toString();
  }
}

Have fun,

Julian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]