Logging broken ?
Andrew Haley
aph@redhat.com
Wed Apr 6 11:32:00 GMT 2005
Ranjit Mathew writes:
> On Apr 6, 2005 4:34 PM, Andrew Haley <aph@redhat.com> wrote:
> > Andreas Grunewald writes:
> > > Thanks for the information that I had to put this into my path.
> > > But it didn't really help much, this is my output.
> > >
> > > NNow starting to LOG
> > > This is tLog java.util.logging.Logger@d68bb8
> > > Exception in thread "main" java.lang.NullPointerException
> > > at __ZN5Hello2goEv
> > > (E:2004円-development2005円-extraextra\src\Hello.java:23)
> > > at __ZN5Hello4mainEP6JArrayIPN4java4lang6StringEE
> > > (E:2004円-development2005円-extraextra\src\Hello.java:13)
> > > at _main (C:\DOKUME~1\GRUNEW~1\LOKALE~1\Temp\ccmocaaa.i:11)
> >
> > But this is *tremendously* useful information! It tells us exactly
> > where the NullPointerException happens.
>
> Doesn't the old stack trace infrastructure prune out addresses for
> which it cannot get proper information from addr2line? If so, the
> stack trace could actually be misleading.
Yeah, thanks. I didn't want that change to go in, as you can see from
my comments at the time. I lost. :-(
> The unadorned stack trace had many more entries if you notice. You
> had to set the "gnu.gcj.runtime.NameFinder.remove_unknown" system
> property to "false" to get a complete trace.
>
> Andreas, to do this, you need to use
> something like:
>
> gcj -Dgnu.gcj.runtime.NameFinder.remove_unknown=true \
> --main=Hello Hello.java
>
> BTW, for some reason c++filt is not displaying demangled names
> properly here. This stack trace can be filtered through "c++filt
> -s java --format java --strip-underscores" to get a better trace.
>
> > There are only two things in there that might raise a
> > NullPointerException: Level.SEVERE, and the call to tLog.log.
>
> Since tLog was (successfully) referred to a couple of lines before
> line #23 and SEVERE is a final constant, this makes me suspect this
> stack trace.
Could be. The only real way to find this is with gdb.
Andrew.
More information about the Java
mailing list