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][IBMVME]the return value of java.exe
Date Mon, 30 Oct 2006 05:54:27 GMT
It seems we need to fix the launcher... which is common part for both
DRLVM and IBVME. I see the problem in the following code sequence...

<snip>
  (*jvm)->DetachCurrentThread(jvm);
  (*jvm)->DestroyJavaVM (jvm);
</snip>

The current thread has an uncaught exception raised before it calls
DetachCurrentThread. This exception is printed out by default uncaught
exception handler which is called upon thread detaching. So after
DetachCurrentThread completes we have no exception anymore... Moreover
we can not play with DetachCurrentThread and DestroyJavaVM return code
since it should not depend on uncaught exceptions. So I think the fix
should look like the following:

<snip>
   if (env->ExceptionOccured) {
        rc = 1;
   }
  (*jvm)->DetachCurrentThread(jvm);
  (*jvm)->DestroyJavaVM (jvm);
  return rc;
</snip>

If there are no objections I'll come up with the patch soon...

Thanks
Evgueni
On 10/30/06, Evgueni Brevnov <evgueni.brevnov@gmail.com> wrote:
> I'll try to see how to fix it for DRLVM
>
> Evgueni
>
> On 10/30/06, Evgueni Brevnov <evgueni.brevnov@gmail.com> wrote:
> > hmmm.... I got 0 for DRLVM on Win2003
> >
> > Evgueni
> >
> > On 10/30/06, Spark Shen <smallsmallorgan@gmail.com> wrote:
> > > Then we may need to follow RI, since different error code fails application
> > >
> > > Best regards
> > > Tony Wu 写道:
> > > > Consider this class,
> > > > public class TestExeReturn {
> > > > public static void main(String[] args) throws Exception {
> > > > throw new Exception();
> > > > }
> > > > }
> > > >
> > > > when we run "java TestExeReturn" and "echo %errorlevel%", we got 1 of
> > > > RI, -1 of DRLVM and 0 for IBMVM.
> > > >
> > > > a testcase of apache ant failed for this issue.
> > > >
> > >
> > >
> > > --
> > > Spark Shen
> > > China Software Development Lab, IBM
> > >
> > >
> >
>

Mime
View raw message