You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mark Hindess <ma...@googlemail.com> on 2006/11/01 14:39:48 UTC

Re: [security][testing] 2 tests failed today

Fixed in r469902.  Turns out the exec was putting double quotes around
the classpath argument (which might make sense if it was going to a
shell) but it doesn't for an exec syscall.  This resulted in classes
being search for in the non-existent directory:

  "/path/to/modules/luni/bin/test

rather than:

  /path/to/modules/luni/bin/test

Regards,
 Mark - confused as to why it didn't also fail on windows

On 1 November 2006 at 10:37, Tim Ellison <t....@gmail.com> wrote:
> Boris Kuznetsov wrote:
> > The tests use tests.support.Support_Exec.execJava2() to perform
> > testing on other JVM. This method uses Runtime.getRuntime().exec() to
> > run command. You can see command (it looks like java -cp ....
> > <classname>) in the test's System.out. It woks OK on Win, but produces
> > NoClassDefFoundError on linux.
> > Note, the command woks OK in linux sh also.
> 
> Yes, I don't think it is the tests for HARMONY-1674 per se that are
> failing, but they are exposing a problem in the exec -- which is why I
> haven't rolled back that commit.
> 
> I'll keep looking at it, let me know if you see the problem.
> 
> Regards,
> Tim
> 
> -- 
> 
> Tim Ellison (t.p.ellison@gmail.com)
> 



Re: [security][testing] 2 tests failed today

Posted by Tim Ellison <t....@gmail.com>.
Mark Hindess wrote:
> Fixed in r469902.  Turns out the exec was putting double quotes around
> the classpath argument (which might make sense if it was going to a
> shell) but it doesn't for an exec syscall.  This resulted in classes
> being search for in the non-existent directory:
> 
>   "/path/to/modules/luni/bin/test
> 
> rather than:
> 
>   /path/to/modules/luni/bin/test
> 
> Regards,
>  Mark - confused as to why it didn't also fail on windows

Looks like we *do* need the quotes on Windows, I get a local failure now.

K0319java.lang.NoClassDefFoundError:
Files\QuickTime\QTSystem\QTJava.zip;C:\Program
FAILED to invoke JVM.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)


Re: [security][testing] 2 tests failed today

Posted by Alexey Varlamov <al...@gmail.com>.
2006/11/1, Tim Ellison <t....@gmail.com>:
> Mark Hindess wrote:
> > Fixed in r469902.  Turns out the exec was putting double quotes around
> > the classpath argument (which might make sense if it was going to a
> > shell) but it doesn't for an exec syscall.  This resulted in classes
> > being search for in the non-existent directory:
> >
> >   "/path/to/modules/luni/bin/test
> >
> > rather than:
> >
> >   /path/to/modules/luni/bin/test
> >
> > Regards,
> >  Mark - confused as to why it didn't also fail on windows
>
> ...but, AIUI the code worked ok on Linux with DRLVM.
> Can somebody confirm that?

This is true - DRLVM has it's own impl of Process. I'll raise this
issue in a separate thread.

>
> Tim - even more confused
>
> --
>
> Tim Ellison (t.p.ellison@gmail.com)
>
>

Re: [security][testing] 2 tests failed today

Posted by Tim Ellison <t....@gmail.com>.
Mark Hindess wrote:
> Fixed in r469902.  Turns out the exec was putting double quotes around
> the classpath argument (which might make sense if it was going to a
> shell) but it doesn't for an exec syscall.  This resulted in classes
> being search for in the non-existent directory:
> 
>   "/path/to/modules/luni/bin/test
> 
> rather than:
> 
>   /path/to/modules/luni/bin/test
> 
> Regards,
>  Mark - confused as to why it didn't also fail on windows

...but, AIUI the code worked ok on Linux with DRLVM.
Can somebody confirm that?

Tim - even more confused

-- 

Tim Ellison (t.p.ellison@gmail.com)


Re: [security][testing] 2 tests failed today

Posted by Mark Hindess <ma...@googlemail.com>.
On 1 November 2006 at 13:39, Mark Hindess <ma...@googlemail.com> wrote:
> 
> Fixed in r469902.  Turns out the exec was putting double quotes around
> the classpath argument (which might make sense if it was going to a
> shell) but it doesn't for an exec syscall.  This resulted in classes
> being search for in the non-existent directory:
> 
>   "/path/to/modules/luni/bin/test
> 
> rather than:
> 
>   /path/to/modules/luni/bin/test
> 
> Regards,
>  Mark - confused as to why it didn't also fail on windows

Oops.  Tim mentioned that my fixed breaks things on windows.  I've
checked in a better fix that I hope should be more well-defined on all
platforms.  That is, pass the arguments to Runtime.exec as an array not
a string.

Aside: My tests show that the behaviour we saw with the quotes in the
string being passed directly through to the execve syscall is consistent
with the RI.

Regards,
 Mark.

> On 1 November 2006 at 10:37, Tim Ellison <t....@gmail.com> wrote:
> > Boris Kuznetsov wrote:
> > > The tests use tests.support.Support_Exec.execJava2() to perform
> > > testing on other JVM. This method uses Runtime.getRuntime().exec() to
> > > run command. You can see command (it looks like java -cp ....
> > > <classname>) in the test's System.out. It woks OK on Win, but produces
> > > NoClassDefFoundError on linux.
> > > Note, the command woks OK in linux sh also.
> > 
> > Yes, I don't think it is the tests for HARMONY-1674 per se that are
> > failing, but they are exposing a problem in the exec -- which is why I
> > haven't rolled back that commit.
> > 
> > I'll keep looking at it, let me know if you see the problem.
> > 
> > Regards,
> > Tim
> > 
> > -- 
> > 
> > Tim Ellison (t.p.ellison@gmail.com)
> > 
>