harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgueni Brevnov" <evgueni.brev...@gmail.com>
Subject Re: [classlib] NLS exception messages arn't displayed correctly
Date Wed, 08 Nov 2006 05:47:10 GMT
On 11/8/06, Tim Ellison <t.p.ellison@gmail.com> wrote:
> Oliver Deakin wrote:
> > Hi all,
> >
> > I was checking out some JIRAs and spotted that when we
> > print exception stack traces at the moment we're not getting
> > the full NLS message. For example, running the following:
> >
> > public class Test {
> >  public static void main(String[] args) throws Throwable {
> >      throw new NullPointerException();
> >  }
> > }
> >
> > prints:
> >
> > K0319java.lang.NullPointerException
> >    at Test.main(Test.java:3)
> > FAILED to invoke JVM.
> >
> > I can spot 2 things wrong with this output (pats on the back
> > if you spot more!):
> > 1) K0319 should actually say something like
> > 'Exception in thread "main" '. It looks like out NLS messages
> > arn't being printed correctly - anyone got any ideas about this
> > one?
>
> The message was missing in the catalog.  I added it in r472226.
>
> > 2) The bogus "FAILED to invoke JVM" message.
> > Looks like this is coming from the launcher (Im running
> > Harmony + IBM VME).
> > It appears that this happens because in main_runJavaMain
> > (in the launcher main.c) after we make the CallStaticVoidMethod()
> > call to run main, we do the following:
> >
> > if ((*env)->ExceptionCheck (env))
> >    {
> >      if (rc == 0)
> >        rc = 100;
> >    }
> >
> > which causes a return code of 100 to be passed back to
> > gpProtectedMain() via the invocation() function, where it is used
> > in the following way:
> >
> > if (invocation(...))
> >    {
> >      hytty_printf (PORTLIB, "FAILED to invoke JVM.\n");
> >      goto bail;
> >    }
> >
> > I imagine this misleading message also appears with DRLVM?
> > I'm not setup at the moment to test it.
> > Is there a reason we set the return code to 100 if there's an
> > unhandled exception?
>
> I'll leave that one for the person who changed the code ;-)

Yes, I also observed such message when running with DRLVM. Actually,
there is  the patch already which fixes the problem with the error
code returned by the launcher to OS. Moreover this patch removes the
misleading message as well. Look at
http://issues.apache.org/jira/browse/HARMONY-2006 ....
classlib_exit_code.patch

Thanks
Evgueni

>
> Regards,
> Tim
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
> IBM Java technology centre, UK.
>

Mime
View raw message