You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Leo Li <li...@gmail.com> on 2006/10/16 10:17:09 UTC

[classlib][luni]Runtime.exec fails on Linux

Hi, all:
     The harmony Runtime.exec fails on Linux with ENOMEM.
     Here is the testcase:

public class Exec {
    public static void main(String[] args) throws Exception {

       Runtime.getRuntime().exec("ls");    }
}

    I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM in
native code.

    After digging into it, I found it fails in procimpl.c, line 135:

        grdpid = fork ();

    If the call to fork is changed to vfork, the testcase will pass but
still get exitcode = 1 which indicates that some error has happened. The
difference between fork and vfork is just whether page tables is copied to
child process or not. But I do not think it is the main cause. Besides,
vfork has become outdated since it main usage is supplied by fork with
copy-on-write function implemented in modern linux kernel. Furthermore,
vfork is also not so safe as fork. So I do not think it is the accepted way
to solve the problem.

   I will try whether it can be reproduced on drlvm of linux since I am not
sure whether it is relevent to VM or classlib. If any drlvm man can tell me
the result, it can avoid my trouble to build it on linux. :)







-- 
Leo Li
China Software Development Lab, IBM

Re: [classlib][luni]Runtime.exec fails on Linux

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
What?  That error is related to not being able to find a built classlib.

One easy way, if you are using /enhanced/trunk as per the directions in 
the getting started section of the website, is to rename the example 
"drlvm.properties.example" in working_vm/build and use that.

geir

Leo Li wrote:
> Hi, Alexey:
>      Thank you.
>      I have started to build the system.
>      Besides, I think the problem is not related to classlib. Since I have
> let fork called in a native function, but it fails on J9.
> 
> On 10/17/06, Alexey Varlamov <al...@gmail.com> wrote:
>>
>> This is due to incorrect classlib location specified. Please ensure
>> you provide correct (better absolute) path in build\drlvm.properties
>> (if you use it) or "external.dep.CLASSLIB.loc" property value in
>> cmdline:
>> sh build.sh -Dexternal.dep.CLASSLIB.loc=$classlib
>> This should point to the root of (pre-)built classlib WS.
>>
>> 2006/10/17, Leo Li <li...@gmail.com>:
>> > Hi, all:
>> >     I tried to build drlvm on linux, but when build update, it reports
>> such
>> > error:
>> >
>> >     [echo] downloading XALAN from no_settings_in_config_or_environment
>> >     [echo] no_settings_in_config_or_environment
>> >
>> > BUILD FAILED
>> > /root/workspaces/workspace/drlvm/build/make/build.xml:240: The 
>> following
>> > error occurred while executing this line:
>> > /root/workspaces/workspace/drlvm/build/make/setup.xml:273: The 
>> following
>> > error occurred while executing this line:
>> > /root/workspaces/workspace/drlvm/build/make/setup.xml:275: The 
>> following
>> > error occurred while executing this line:
>> > /root/workspaces/workspace/drlvm/build/make/setup.xml:442: Warning:
>> Could
>> > not find file
>> >
>> /root/workspaces/workspace/drlvm/build/make/no_settings_in_config_or_environment 
>>
>> > to copy.
>> >
>> > How can I do with it?
>> > Thanks.
>> >
>> >
>> >
>> > On 10/17/06, Alexey Varlamov <al...@gmail.com> wrote:
>> > >
>> > > 2006/10/16, Leo Li <li...@gmail.com>:
>> > > > It seems not quite related to actual memory stress although the
>> reported
>> > > > error is ENOMEM.
>> > > > I have run it both in eclipse and console. And there are enough
>> memory
>> > > > available.
>> > > >
>> > > > Furthermore, the case can be repeated even though in the same 
>> time a
>> C
>> > > > program runs well when using fork().
>> > > >
>> > > > I suspect that it is related with VM since it can be only 
>> reproduced
>> by
>> > > VM
>> > > > calling it. I am not sure whether vm does something behind me, 
>> but I
>> > > have
>> > > > not thought out of a way that a user-space program have such
>> effect.:)
>> > > >
>> > > Actually drlvm provides own impl of j.l.Process. Interesting, 
>> would it
>> > > work if switched to classlib's impl - then this should be process 
>> impl
>> > > issue. Could you please try the following patch with DRLVM and see if
>> > > it works?
>> > >
>> > > Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
>> > > ===================================================================
>> > > --- vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
>> > > (revision 464817)
>> > > +++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
>> (working
>> > > copy)
>> > > @@ -743,14 +743,15 @@
>> > >          //#IN004# Should we check: envp != null ?
>> > >          //#IN004# Should we check envp's direction values: 
>> envp[i] !=
>> > > null ?
>> > >
>> > > -        String dirPathName = (dir != null ? dir.getPath() : null);
>> > > +        //String dirPathName = (dir != null ? dir.getPath() : null);
>> > >
>> > > -        SubProcess sp = new SubProcess();
>> > > +        //SubProcess sp = new SubProcess();
>> > >
>> > > -        sp.execVM(cmdarray, envp, dirPathName);
>> > > +        //sp.execVM(cmdarray, envp, dirPathName);
>> > >
>> > > -        return sp;
>> > > -
>> > > +        //return sp;
>> > > +        return 
>> org.apache.harmony.luni.internal.process.SystemProcess
>> .
>> > > +             create(cmdarray, envp == null ? new String[0] : envp,
>> dir);
>> > >      }
>> > >
>> > >
>> > > --
>> > > Alexey
>> > >
>> > > >
>> > > > On 10/16/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
>> > > > >
>> > > > > I'm confused.  Didn't you just report this on Ubuntu?
>> > > > >
>> > > > > I have had similar forking problems on Ubuntu 6 (I once found a
>> bug in
>> > > > > classlib related to forking...).
>> > > > >
>> > > > > I never figured out why Unbuntu does this, but it seemed that
>> under
>> > > > > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse
>> and
>> > > run
>> > > > > the test again...
>> > > > >
>> > > > > geir
>> > > > >
>> > > > >
>> > > > > Leo Li wrote:
>> > > > > > Thank you.
>> > > > > > I have just run it on drlvm of unbuntu, it works.
>> > > > > > What a qurious problem!
>> > > > > >
>> > > > > >
>> > > > > > On 10/16/06, Alexey Varlamov <al...@gmail.com>
>> wrote:
>> > > > > >>
>> > > > > >> Both DRLVM and J9 works for me (SUSE9).
>> > > > > >>
>> > > > > >> --
>> > > > > >> Alexey
>> > > > > >>
>> > > > > >> 2006/10/16, Leo Li <li...@gmail.com>:
>> > > > > >> > Hi, all:
>> > > > > >> >     The harmony Runtime.exec fails on Linux with ENOMEM.
>> > > > > >> >     Here is the testcase:
>> > > > > >> >
>> > > > > >> > public class Exec {
>> > > > > >> >    public static void main(String[] args) throws Exception {
>> > > > > >> >
>> > > > > >> >       Runtime.getRuntime().exec("ls");    }
>> > > > > >> > }
>> > > > > >> >
>> > > > > >> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both
>> get
>> > > > > ENOMEM
>> > > > > >> in
>> > > > > >> > native code.
>> > > > > >> >
>> > > > > >> >    After digging into it, I found it fails in procimpl.c,
>> line
>> > > 135:
>> > > > > >> >
>> > > > > >> >        grdpid = fork ();
>> > > > > >> >
>> > > > > >> >    If the call to fork is changed to vfork, the testcase 
>> will
>> > > pass
>> > > > > but
>> > > > > >> > still get exitcode = 1 which indicates that some error has
>> > > happened.
>> > > > > >> The
>> > > > > >> > difference between fork and vfork is just whether page 
>> tables
>> is
>> > > > > copied
>> > > > > >> to
>> > > > > >> > child process or not. But I do not think it is the main
>> cause.
>> > > > > Besides,
>> > > > > >> > vfork has become outdated since it main usage is supplied by
>> fork
>> > > > > with
>> > > > > >> > copy-on-write function implemented in modern linux kernel.
>> > > > > Furthermore,
>> > > > > >> > vfork is also not so safe as fork. So I do not think it is
>> the
>> > > > > accepted
>> > > > > >> way
>> > > > > >> > to solve the problem.
>> > > > > >> >
>> > > > > >> >   I will try whether it can be reproduced on drlvm of linux
>> since
>> > > I
>> > > > > am
>> > > > > >> not
>> > > > > >> > sure whether it is relevent to VM or classlib. If any drlvm
>> man
>> > > can
>> > > > > >> tell
>> > > > > >> me
>> > > > > >> > the result, it can avoid my trouble to build it on linux. :)
>> > > > > >> >
>> > > > > >> >
>> > > > > >> >
>> > > > > >> >
>> > > > > >> >
>> > > > > >> >
>> > > > > >> >
>> > > > > >> > --
>> > > > > >> > Leo Li
>> > > > > >> > China Software Development Lab, IBM
>> > > > > >> >
>> > > > > >> >
>> > > > > >>
>> > > > > >>
>> > > ---------------------------------------------------------------------
>> > > > > >> Terms of use : 
>> http://incubator.apache.org/harmony/mailing.html
>> > > > > >> To unsubscribe, e-mail:
>> > > harmony-dev-unsubscribe@incubator.apache.org
>> > > > > >> For additional commands, e-mail:
>> > > harmony-dev-help@incubator.apache.org
>> > > > > >>
>> > > > > >>
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> ---------------------------------------------------------------------
>> > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
>> > > > > To unsubscribe, e-mail:
>> harmony-dev-unsubscribe@incubator.apache.org
>> > > > > For additional commands, e-mail:
>> harmony-dev-help@incubator.apache.org
>> > > > >
>> > > > >
>> > > >
>> > > >
>> > > > --
>> > > > Leo Li
>> > > > China Software Development Lab, IBM
>> > > >
>> > > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
>> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> > > For additional commands, e-mail: 
>> harmony-dev-help@incubator.apache.org
>> > >
>> > >
>> >
>> >
>> > --
>> > Leo Li
>> > China Software Development Lab, IBM
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Leo Li <li...@gmail.com>.
Hi, Alexey:
      Thank you.
      I have started to build the system.
      Besides, I think the problem is not related to classlib. Since I have
let fork called in a native function, but it fails on J9.

On 10/17/06, Alexey Varlamov <al...@gmail.com> wrote:
>
> This is due to incorrect classlib location specified. Please ensure
> you provide correct (better absolute) path in build\drlvm.properties
> (if you use it) or "external.dep.CLASSLIB.loc" property value in
> cmdline:
> sh build.sh -Dexternal.dep.CLASSLIB.loc=$classlib
> This should point to the root of (pre-)built classlib WS.
>
> 2006/10/17, Leo Li <li...@gmail.com>:
> > Hi, all:
> >     I tried to build drlvm on linux, but when build update, it reports
> such
> > error:
> >
> >     [echo] downloading XALAN from no_settings_in_config_or_environment
> >     [echo] no_settings_in_config_or_environment
> >
> > BUILD FAILED
> > /root/workspaces/workspace/drlvm/build/make/build.xml:240: The following
> > error occurred while executing this line:
> > /root/workspaces/workspace/drlvm/build/make/setup.xml:273: The following
> > error occurred while executing this line:
> > /root/workspaces/workspace/drlvm/build/make/setup.xml:275: The following
> > error occurred while executing this line:
> > /root/workspaces/workspace/drlvm/build/make/setup.xml:442: Warning:
> Could
> > not find file
> >
> /root/workspaces/workspace/drlvm/build/make/no_settings_in_config_or_environment
> > to copy.
> >
> > How can I do with it?
> > Thanks.
> >
> >
> >
> > On 10/17/06, Alexey Varlamov <al...@gmail.com> wrote:
> > >
> > > 2006/10/16, Leo Li <li...@gmail.com>:
> > > > It seems not quite related to actual memory stress although the
> reported
> > > > error is ENOMEM.
> > > > I have run it both in eclipse and console. And there are enough
> memory
> > > > available.
> > > >
> > > > Furthermore, the case can be repeated even though in the same time a
> C
> > > > program runs well when using fork().
> > > >
> > > > I suspect that it is related with VM since it can be only reproduced
> by
> > > VM
> > > > calling it. I am not sure whether vm does something behind me, but I
> > > have
> > > > not thought out of a way that a user-space program have such
> effect.:)
> > > >
> > > Actually drlvm provides own impl of j.l.Process. Interesting, would it
> > > work if switched to classlib's impl - then this should be process impl
> > > issue. Could you please try the following patch with DRLVM and see if
> > > it works?
> > >
> > > Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> > > ===================================================================
> > > --- vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> > > (revision 464817)
> > > +++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> (working
> > > copy)
> > > @@ -743,14 +743,15 @@
> > >          //#IN004# Should we check: envp != null ?
> > >          //#IN004# Should we check envp's direction values: envp[i] !=
> > > null ?
> > >
> > > -        String dirPathName = (dir != null ? dir.getPath() : null);
> > > +        //String dirPathName = (dir != null ? dir.getPath() : null);
> > >
> > > -        SubProcess sp = new SubProcess();
> > > +        //SubProcess sp = new SubProcess();
> > >
> > > -        sp.execVM(cmdarray, envp, dirPathName);
> > > +        //sp.execVM(cmdarray, envp, dirPathName);
> > >
> > > -        return sp;
> > > -
> > > +        //return sp;
> > > +        return org.apache.harmony.luni.internal.process.SystemProcess
> .
> > > +             create(cmdarray, envp == null ? new String[0] : envp,
> dir);
> > >      }
> > >
> > >
> > > --
> > > Alexey
> > >
> > > >
> > > > On 10/16/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
> > > > >
> > > > > I'm confused.  Didn't you just report this on Ubuntu?
> > > > >
> > > > > I have had similar forking problems on Ubuntu 6 (I once found a
> bug in
> > > > > classlib related to forking...).
> > > > >
> > > > > I never figured out why Unbuntu does this, but it seemed that
> under
> > > > > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse
> and
> > > run
> > > > > the test again...
> > > > >
> > > > > geir
> > > > >
> > > > >
> > > > > Leo Li wrote:
> > > > > > Thank you.
> > > > > > I have just run it on drlvm of unbuntu, it works.
> > > > > > What a qurious problem!
> > > > > >
> > > > > >
> > > > > > On 10/16/06, Alexey Varlamov <al...@gmail.com>
> wrote:
> > > > > >>
> > > > > >> Both DRLVM and J9 works for me (SUSE9).
> > > > > >>
> > > > > >> --
> > > > > >> Alexey
> > > > > >>
> > > > > >> 2006/10/16, Leo Li <li...@gmail.com>:
> > > > > >> > Hi, all:
> > > > > >> >     The harmony Runtime.exec fails on Linux with ENOMEM.
> > > > > >> >     Here is the testcase:
> > > > > >> >
> > > > > >> > public class Exec {
> > > > > >> >    public static void main(String[] args) throws Exception {
> > > > > >> >
> > > > > >> >       Runtime.getRuntime().exec("ls");    }
> > > > > >> > }
> > > > > >> >
> > > > > >> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both
> get
> > > > > ENOMEM
> > > > > >> in
> > > > > >> > native code.
> > > > > >> >
> > > > > >> >    After digging into it, I found it fails in procimpl.c,
> line
> > > 135:
> > > > > >> >
> > > > > >> >        grdpid = fork ();
> > > > > >> >
> > > > > >> >    If the call to fork is changed to vfork, the testcase will
> > > pass
> > > > > but
> > > > > >> > still get exitcode = 1 which indicates that some error has
> > > happened.
> > > > > >> The
> > > > > >> > difference between fork and vfork is just whether page tables
> is
> > > > > copied
> > > > > >> to
> > > > > >> > child process or not. But I do not think it is the main
> cause.
> > > > > Besides,
> > > > > >> > vfork has become outdated since it main usage is supplied by
> fork
> > > > > with
> > > > > >> > copy-on-write function implemented in modern linux kernel.
> > > > > Furthermore,
> > > > > >> > vfork is also not so safe as fork. So I do not think it is
> the
> > > > > accepted
> > > > > >> way
> > > > > >> > to solve the problem.
> > > > > >> >
> > > > > >> >   I will try whether it can be reproduced on drlvm of linux
> since
> > > I
> > > > > am
> > > > > >> not
> > > > > >> > sure whether it is relevent to VM or classlib. If any drlvm
> man
> > > can
> > > > > >> tell
> > > > > >> me
> > > > > >> > the result, it can avoid my trouble to build it on linux. :)
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> >
> > > > > >> > --
> > > > > >> > Leo Li
> > > > > >> > China Software Development Lab, IBM
> > > > > >> >
> > > > > >> >
> > > > > >>
> > > > > >>
> > > ---------------------------------------------------------------------
> > > > > >> Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > >> To unsubscribe, e-mail:
> > > harmony-dev-unsubscribe@incubator.apache.org
> > > > > >> For additional commands, e-mail:
> > > harmony-dev-help@incubator.apache.org
> > > > > >>
> > > > > >>
> > > > > >
> > > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > > To unsubscribe, e-mail:
> harmony-dev-unsubscribe@incubator.apache.org
> > > > > For additional commands, e-mail:
> harmony-dev-help@incubator.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Leo Li
> > > > China Software Development Lab, IBM
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > >
> > >
> >
> >
> > --
> > Leo Li
> > China Software Development Lab, IBM
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Leo Li
China Software Development Lab, IBM

Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Alexey Varlamov <al...@gmail.com>.
This is due to incorrect classlib location specified. Please ensure
you provide correct (better absolute) path in build\drlvm.properties
(if you use it) or "external.dep.CLASSLIB.loc" property value in
cmdline:
sh build.sh -Dexternal.dep.CLASSLIB.loc=$classlib
This should point to the root of (pre-)built classlib WS.

2006/10/17, Leo Li <li...@gmail.com>:
> Hi, all:
>     I tried to build drlvm on linux, but when build update, it reports such
> error:
>
>     [echo] downloading XALAN from no_settings_in_config_or_environment
>     [echo] no_settings_in_config_or_environment
>
> BUILD FAILED
> /root/workspaces/workspace/drlvm/build/make/build.xml:240: The following
> error occurred while executing this line:
> /root/workspaces/workspace/drlvm/build/make/setup.xml:273: The following
> error occurred while executing this line:
> /root/workspaces/workspace/drlvm/build/make/setup.xml:275: The following
> error occurred while executing this line:
> /root/workspaces/workspace/drlvm/build/make/setup.xml:442: Warning: Could
> not find file
> /root/workspaces/workspace/drlvm/build/make/no_settings_in_config_or_environment
> to copy.
>
> How can I do with it?
> Thanks.
>
>
>
> On 10/17/06, Alexey Varlamov <al...@gmail.com> wrote:
> >
> > 2006/10/16, Leo Li <li...@gmail.com>:
> > > It seems not quite related to actual memory stress although the reported
> > > error is ENOMEM.
> > > I have run it both in eclipse and console. And there are enough memory
> > > available.
> > >
> > > Furthermore, the case can be repeated even though in the same time a C
> > > program runs well when using fork().
> > >
> > > I suspect that it is related with VM since it can be only reproduced by
> > VM
> > > calling it. I am not sure whether vm does something behind me, but I
> > have
> > > not thought out of a way that a user-space program have such effect.:)
> > >
> > Actually drlvm provides own impl of j.l.Process. Interesting, would it
> > work if switched to classlib's impl - then this should be process impl
> > issue. Could you please try the following patch with DRLVM and see if
> > it works?
> >
> > Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> > ===================================================================
> > --- vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> > (revision 464817)
> > +++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java (working
> > copy)
> > @@ -743,14 +743,15 @@
> >          //#IN004# Should we check: envp != null ?
> >          //#IN004# Should we check envp's direction values: envp[i] !=
> > null ?
> >
> > -        String dirPathName = (dir != null ? dir.getPath() : null);
> > +        //String dirPathName = (dir != null ? dir.getPath() : null);
> >
> > -        SubProcess sp = new SubProcess();
> > +        //SubProcess sp = new SubProcess();
> >
> > -        sp.execVM(cmdarray, envp, dirPathName);
> > +        //sp.execVM(cmdarray, envp, dirPathName);
> >
> > -        return sp;
> > -
> > +        //return sp;
> > +        return org.apache.harmony.luni.internal.process.SystemProcess.
> > +             create(cmdarray, envp == null ? new String[0] : envp, dir);
> >      }
> >
> >
> > --
> > Alexey
> >
> > >
> > > On 10/16/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
> > > >
> > > > I'm confused.  Didn't you just report this on Ubuntu?
> > > >
> > > > I have had similar forking problems on Ubuntu 6 (I once found a bug in
> > > > classlib related to forking...).
> > > >
> > > > I never figured out why Unbuntu does this, but it seemed that under
> > > > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and
> > run
> > > > the test again...
> > > >
> > > > geir
> > > >
> > > >
> > > > Leo Li wrote:
> > > > > Thank you.
> > > > > I have just run it on drlvm of unbuntu, it works.
> > > > > What a qurious problem!
> > > > >
> > > > >
> > > > > On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
> > > > >>
> > > > >> Both DRLVM and J9 works for me (SUSE9).
> > > > >>
> > > > >> --
> > > > >> Alexey
> > > > >>
> > > > >> 2006/10/16, Leo Li <li...@gmail.com>:
> > > > >> > Hi, all:
> > > > >> >     The harmony Runtime.exec fails on Linux with ENOMEM.
> > > > >> >     Here is the testcase:
> > > > >> >
> > > > >> > public class Exec {
> > > > >> >    public static void main(String[] args) throws Exception {
> > > > >> >
> > > > >> >       Runtime.getRuntime().exec("ls");    }
> > > > >> > }
> > > > >> >
> > > > >> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get
> > > > ENOMEM
> > > > >> in
> > > > >> > native code.
> > > > >> >
> > > > >> >    After digging into it, I found it fails in procimpl.c, line
> > 135:
> > > > >> >
> > > > >> >        grdpid = fork ();
> > > > >> >
> > > > >> >    If the call to fork is changed to vfork, the testcase will
> > pass
> > > > but
> > > > >> > still get exitcode = 1 which indicates that some error has
> > happened.
> > > > >> The
> > > > >> > difference between fork and vfork is just whether page tables is
> > > > copied
> > > > >> to
> > > > >> > child process or not. But I do not think it is the main cause.
> > > > Besides,
> > > > >> > vfork has become outdated since it main usage is supplied by fork
> > > > with
> > > > >> > copy-on-write function implemented in modern linux kernel.
> > > > Furthermore,
> > > > >> > vfork is also not so safe as fork. So I do not think it is the
> > > > accepted
> > > > >> way
> > > > >> > to solve the problem.
> > > > >> >
> > > > >> >   I will try whether it can be reproduced on drlvm of linux since
> > I
> > > > am
> > > > >> not
> > > > >> > sure whether it is relevent to VM or classlib. If any drlvm man
> > can
> > > > >> tell
> > > > >> me
> > > > >> > the result, it can avoid my trouble to build it on linux. :)
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> >
> > > > >> > --
> > > > >> > Leo Li
> > > > >> > China Software Development Lab, IBM
> > > > >> >
> > > > >> >
> > > > >>
> > > > >>
> > ---------------------------------------------------------------------
> > > > >> Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > >> To unsubscribe, e-mail:
> > harmony-dev-unsubscribe@incubator.apache.org
> > > > >> For additional commands, e-mail:
> > harmony-dev-help@incubator.apache.org
> > > > >>
> > > > >>
> > > > >
> > > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Leo Li
> > > China Software Development Lab, IBM
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Leo Li <li...@gmail.com>.
Hi, all:
     I tried to build drlvm on linux, but when build update, it reports such
error:

     [echo] downloading XALAN from no_settings_in_config_or_environment
     [echo] no_settings_in_config_or_environment

BUILD FAILED
/root/workspaces/workspace/drlvm/build/make/build.xml:240: The following
error occurred while executing this line:
/root/workspaces/workspace/drlvm/build/make/setup.xml:273: The following
error occurred while executing this line:
/root/workspaces/workspace/drlvm/build/make/setup.xml:275: The following
error occurred while executing this line:
/root/workspaces/workspace/drlvm/build/make/setup.xml:442: Warning: Could
not find file
/root/workspaces/workspace/drlvm/build/make/no_settings_in_config_or_environment
to copy.

How can I do with it?
Thanks.



On 10/17/06, Alexey Varlamov <al...@gmail.com> wrote:
>
> 2006/10/16, Leo Li <li...@gmail.com>:
> > It seems not quite related to actual memory stress although the reported
> > error is ENOMEM.
> > I have run it both in eclipse and console. And there are enough memory
> > available.
> >
> > Furthermore, the case can be repeated even though in the same time a C
> > program runs well when using fork().
> >
> > I suspect that it is related with VM since it can be only reproduced by
> VM
> > calling it. I am not sure whether vm does something behind me, but I
> have
> > not thought out of a way that a user-space program have such effect.:)
> >
> Actually drlvm provides own impl of j.l.Process. Interesting, would it
> work if switched to classlib's impl - then this should be process impl
> issue. Could you please try the following patch with DRLVM and see if
> it works?
>
> Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> ===================================================================
> --- vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
> (revision 464817)
> +++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java (working
> copy)
> @@ -743,14 +743,15 @@
>          //#IN004# Should we check: envp != null ?
>          //#IN004# Should we check envp's direction values: envp[i] !=
> null ?
>
> -        String dirPathName = (dir != null ? dir.getPath() : null);
> +        //String dirPathName = (dir != null ? dir.getPath() : null);
>
> -        SubProcess sp = new SubProcess();
> +        //SubProcess sp = new SubProcess();
>
> -        sp.execVM(cmdarray, envp, dirPathName);
> +        //sp.execVM(cmdarray, envp, dirPathName);
>
> -        return sp;
> -
> +        //return sp;
> +        return org.apache.harmony.luni.internal.process.SystemProcess.
> +             create(cmdarray, envp == null ? new String[0] : envp, dir);
>      }
>
>
> --
> Alexey
>
> >
> > On 10/16/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
> > >
> > > I'm confused.  Didn't you just report this on Ubuntu?
> > >
> > > I have had similar forking problems on Ubuntu 6 (I once found a bug in
> > > classlib related to forking...).
> > >
> > > I never figured out why Unbuntu does this, but it seemed that under
> > > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and
> run
> > > the test again...
> > >
> > > geir
> > >
> > >
> > > Leo Li wrote:
> > > > Thank you.
> > > > I have just run it on drlvm of unbuntu, it works.
> > > > What a qurious problem!
> > > >
> > > >
> > > > On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
> > > >>
> > > >> Both DRLVM and J9 works for me (SUSE9).
> > > >>
> > > >> --
> > > >> Alexey
> > > >>
> > > >> 2006/10/16, Leo Li <li...@gmail.com>:
> > > >> > Hi, all:
> > > >> >     The harmony Runtime.exec fails on Linux with ENOMEM.
> > > >> >     Here is the testcase:
> > > >> >
> > > >> > public class Exec {
> > > >> >    public static void main(String[] args) throws Exception {
> > > >> >
> > > >> >       Runtime.getRuntime().exec("ls");    }
> > > >> > }
> > > >> >
> > > >> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get
> > > ENOMEM
> > > >> in
> > > >> > native code.
> > > >> >
> > > >> >    After digging into it, I found it fails in procimpl.c, line
> 135:
> > > >> >
> > > >> >        grdpid = fork ();
> > > >> >
> > > >> >    If the call to fork is changed to vfork, the testcase will
> pass
> > > but
> > > >> > still get exitcode = 1 which indicates that some error has
> happened.
> > > >> The
> > > >> > difference between fork and vfork is just whether page tables is
> > > copied
> > > >> to
> > > >> > child process or not. But I do not think it is the main cause.
> > > Besides,
> > > >> > vfork has become outdated since it main usage is supplied by fork
> > > with
> > > >> > copy-on-write function implemented in modern linux kernel.
> > > Furthermore,
> > > >> > vfork is also not so safe as fork. So I do not think it is the
> > > accepted
> > > >> way
> > > >> > to solve the problem.
> > > >> >
> > > >> >   I will try whether it can be reproduced on drlvm of linux since
> I
> > > am
> > > >> not
> > > >> > sure whether it is relevent to VM or classlib. If any drlvm man
> can
> > > >> tell
> > > >> me
> > > >> > the result, it can avoid my trouble to build it on linux. :)
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> > --
> > > >> > Leo Li
> > > >> > China Software Development Lab, IBM
> > > >> >
> > > >> >
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > >> To unsubscribe, e-mail:
> harmony-dev-unsubscribe@incubator.apache.org
> > > >> For additional commands, e-mail:
> harmony-dev-help@incubator.apache.org
> > > >>
> > > >>
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > >
> > >
> >
> >
> > --
> > Leo Li
> > China Software Development Lab, IBM
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Leo Li
China Software Development Lab, IBM

Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Alexey Varlamov <al...@gmail.com>.
2006/10/16, Leo Li <li...@gmail.com>:
> It seems not quite related to actual memory stress although the reported
> error is ENOMEM.
> I have run it both in eclipse and console. And there are enough memory
> available.
>
> Furthermore, the case can be repeated even though in the same time a C
> program runs well when using fork().
>
> I suspect that it is related with VM since it can be only reproduced by VM
> calling it. I am not sure whether vm does something behind me, but I have
> not thought out of a way that a user-space program have such effect.:)
>
Actually drlvm provides own impl of j.l.Process. Interesting, would it
work if switched to classlib's impl - then this should be process impl
issue. Could you please try the following patch with DRLVM and see if
it works?

Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
===================================================================
--- vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java
(revision 464817)
+++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Runtime.java (working copy)
@@ -743,14 +743,15 @@
         //#IN004# Should we check: envp != null ?
         //#IN004# Should we check envp's direction values: envp[i] != null ?

-        String dirPathName = (dir != null ? dir.getPath() : null);
+        //String dirPathName = (dir != null ? dir.getPath() : null);

-        SubProcess sp = new SubProcess();
+        //SubProcess sp = new SubProcess();

-        sp.execVM(cmdarray, envp, dirPathName);
+        //sp.execVM(cmdarray, envp, dirPathName);

-        return sp;
-
+        //return sp;
+        return org.apache.harmony.luni.internal.process.SystemProcess.
+             create(cmdarray, envp == null ? new String[0] : envp, dir);
     }


--
Alexey

>
> On 10/16/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
> >
> > I'm confused.  Didn't you just report this on Ubuntu?
> >
> > I have had similar forking problems on Ubuntu 6 (I once found a bug in
> > classlib related to forking...).
> >
> > I never figured out why Unbuntu does this, but it seemed that under
> > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and run
> > the test again...
> >
> > geir
> >
> >
> > Leo Li wrote:
> > > Thank you.
> > > I have just run it on drlvm of unbuntu, it works.
> > > What a qurious problem!
> > >
> > >
> > > On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
> > >>
> > >> Both DRLVM and J9 works for me (SUSE9).
> > >>
> > >> --
> > >> Alexey
> > >>
> > >> 2006/10/16, Leo Li <li...@gmail.com>:
> > >> > Hi, all:
> > >> >     The harmony Runtime.exec fails on Linux with ENOMEM.
> > >> >     Here is the testcase:
> > >> >
> > >> > public class Exec {
> > >> >    public static void main(String[] args) throws Exception {
> > >> >
> > >> >       Runtime.getRuntime().exec("ls");    }
> > >> > }
> > >> >
> > >> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get
> > ENOMEM
> > >> in
> > >> > native code.
> > >> >
> > >> >    After digging into it, I found it fails in procimpl.c, line 135:
> > >> >
> > >> >        grdpid = fork ();
> > >> >
> > >> >    If the call to fork is changed to vfork, the testcase will pass
> > but
> > >> > still get exitcode = 1 which indicates that some error has happened.
> > >> The
> > >> > difference between fork and vfork is just whether page tables is
> > copied
> > >> to
> > >> > child process or not. But I do not think it is the main cause.
> > Besides,
> > >> > vfork has become outdated since it main usage is supplied by fork
> > with
> > >> > copy-on-write function implemented in modern linux kernel.
> > Furthermore,
> > >> > vfork is also not so safe as fork. So I do not think it is the
> > accepted
> > >> way
> > >> > to solve the problem.
> > >> >
> > >> >   I will try whether it can be reproduced on drlvm of linux since I
> > am
> > >> not
> > >> > sure whether it is relevent to VM or classlib. If any drlvm man can
> > >> tell
> > >> me
> > >> > the result, it can avoid my trouble to build it on linux. :)
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > Leo Li
> > >> > China Software Development Lab, IBM
> > >> >
> > >> >
> > >>
> > >> ---------------------------------------------------------------------
> > >> Terms of use : http://incubator.apache.org/harmony/mailing.html
> > >> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > >> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> > >>
> > >>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Leo Li wrote:
> It seems not quite related to actual memory stress although the reported
> error is ENOMEM.
> I have run it both in eclipse and console. And there are enough memory
> available.
> 
> Furthermore, the case can be repeated even though in the same time a C
> program runs well when using fork().
> 
> I suspect that it is related with VM since it can be only reproduced by VM
> calling it. I am not sure whether vm does something behind me, but I have
> not thought out of a way that a user-space program have such effect.:)

I used to be able to consistently reproduce a similar bug (fork() 
failing...) by just having eclipse running at the same time.

IOW, with no other programs running, the fork() worked.  With Eclipse 
running, it failed.

The only thing I could think of was that there was some problem with 
ulimit that I never could figure out...

geir

> 
> 
> On 10/16/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
>>
>> I'm confused.  Didn't you just report this on Ubuntu?
>>
>> I have had similar forking problems on Ubuntu 6 (I once found a bug in
>> classlib related to forking...).
>>
>> I never figured out why Unbuntu does this, but it seemed that under
>> memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and run
>> the test again...
>>
>> geir
>>
>>
>> Leo Li wrote:
>> > Thank you.
>> > I have just run it on drlvm of unbuntu, it works.
>> > What a qurious problem!
>> >
>> >
>> > On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
>> >>
>> >> Both DRLVM and J9 works for me (SUSE9).
>> >>
>> >> --
>> >> Alexey
>> >>
>> >> 2006/10/16, Leo Li <li...@gmail.com>:
>> >> > Hi, all:
>> >> >     The harmony Runtime.exec fails on Linux with ENOMEM.
>> >> >     Here is the testcase:
>> >> >
>> >> > public class Exec {
>> >> >    public static void main(String[] args) throws Exception {
>> >> >
>> >> >       Runtime.getRuntime().exec("ls");    }
>> >> > }
>> >> >
>> >> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get
>> ENOMEM
>> >> in
>> >> > native code.
>> >> >
>> >> >    After digging into it, I found it fails in procimpl.c, line 135:
>> >> >
>> >> >        grdpid = fork ();
>> >> >
>> >> >    If the call to fork is changed to vfork, the testcase will pass
>> but
>> >> > still get exitcode = 1 which indicates that some error has happened.
>> >> The
>> >> > difference between fork and vfork is just whether page tables is
>> copied
>> >> to
>> >> > child process or not. But I do not think it is the main cause.
>> Besides,
>> >> > vfork has become outdated since it main usage is supplied by fork
>> with
>> >> > copy-on-write function implemented in modern linux kernel.
>> Furthermore,
>> >> > vfork is also not so safe as fork. So I do not think it is the
>> accepted
>> >> way
>> >> > to solve the problem.
>> >> >
>> >> >   I will try whether it can be reproduced on drlvm of linux since I
>> am
>> >> not
>> >> > sure whether it is relevent to VM or classlib. If any drlvm man can
>> >> tell
>> >> me
>> >> > the result, it can avoid my trouble to build it on linux. :)
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Leo Li
>> >> > China Software Development Lab, IBM
>> >> >
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> >> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> >> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>> >>
>> >>
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Leo Li <li...@gmail.com>.
It seems not quite related to actual memory stress although the reported
error is ENOMEM.
I have run it both in eclipse and console. And there are enough memory
available.

Furthermore, the case can be repeated even though in the same time a C
program runs well when using fork().

I suspect that it is related with VM since it can be only reproduced by VM
calling it. I am not sure whether vm does something behind me, but I have
not thought out of a way that a user-space program have such effect.:)


On 10/16/06, Geir Magnusson Jr. <ge...@pobox.com> wrote:
>
> I'm confused.  Didn't you just report this on Ubuntu?
>
> I have had similar forking problems on Ubuntu 6 (I once found a bug in
> classlib related to forking...).
>
> I never figured out why Unbuntu does this, but it seemed that under
> memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and run
> the test again...
>
> geir
>
>
> Leo Li wrote:
> > Thank you.
> > I have just run it on drlvm of unbuntu, it works.
> > What a qurious problem!
> >
> >
> > On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
> >>
> >> Both DRLVM and J9 works for me (SUSE9).
> >>
> >> --
> >> Alexey
> >>
> >> 2006/10/16, Leo Li <li...@gmail.com>:
> >> > Hi, all:
> >> >     The harmony Runtime.exec fails on Linux with ENOMEM.
> >> >     Here is the testcase:
> >> >
> >> > public class Exec {
> >> >    public static void main(String[] args) throws Exception {
> >> >
> >> >       Runtime.getRuntime().exec("ls");    }
> >> > }
> >> >
> >> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get
> ENOMEM
> >> in
> >> > native code.
> >> >
> >> >    After digging into it, I found it fails in procimpl.c, line 135:
> >> >
> >> >        grdpid = fork ();
> >> >
> >> >    If the call to fork is changed to vfork, the testcase will pass
> but
> >> > still get exitcode = 1 which indicates that some error has happened.
> >> The
> >> > difference between fork and vfork is just whether page tables is
> copied
> >> to
> >> > child process or not. But I do not think it is the main cause.
> Besides,
> >> > vfork has become outdated since it main usage is supplied by fork
> with
> >> > copy-on-write function implemented in modern linux kernel.
> Furthermore,
> >> > vfork is also not so safe as fork. So I do not think it is the
> accepted
> >> way
> >> > to solve the problem.
> >> >
> >> >   I will try whether it can be reproduced on drlvm of linux since I
> am
> >> not
> >> > sure whether it is relevent to VM or classlib. If any drlvm man can
> >> tell
> >> me
> >> > the result, it can avoid my trouble to build it on linux. :)
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --
> >> > Leo Li
> >> > China Software Development Lab, IBM
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> Terms of use : http://incubator.apache.org/harmony/mailing.html
> >> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> >> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Leo Li
China Software Development Lab, IBM

Re: [classlib][luni]Runtime.exec fails on Linux

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Paulex Yang wrote:
> Geir Magnusson Jr. wrote:
>> I'm confused.  Didn't you just report this on Ubuntu?
> Let Leo speak for himself, but I thought Leo meant IBM VME + Harmony 
> classlib failed on Ubuntu and Redhat, but Alexey just reported that both 
> (VME and DRLVM) works on SUSE, that's why it seems interesting.

I understand that based on my experience with fork() and ubuntu under 
memory load...

geir

>>
>> I have had similar forking problems on Ubuntu 6 (I once found a bug in 
>> classlib related to forking...).
>>
>> I never figured out why Unbuntu does this, but it seemed that under 
>> memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and 
>> run the test again...
>> geir
>>
>>
>> Leo Li wrote:
>>> Thank you.
>>> I have just run it on drlvm of unbuntu, it works.
>>> What a qurious problem!
>>>
>>>
>>> On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
>>>>
>>>> Both DRLVM and J9 works for me (SUSE9).
>>>>
>>>> -- 
>>>> Alexey
>>>>
>>>> 2006/10/16, Leo Li <li...@gmail.com>:
>>>> > Hi, all:
>>>> >     The harmony Runtime.exec fails on Linux with ENOMEM.
>>>> >     Here is the testcase:
>>>> >
>>>> > public class Exec {
>>>> >    public static void main(String[] args) throws Exception {
>>>> >
>>>> >       Runtime.getRuntime().exec("ls");    }
>>>> > }
>>>> >
>>>> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get 
>>>> ENOMEM
>>>> in
>>>> > native code.
>>>> >
>>>> >    After digging into it, I found it fails in procimpl.c, line 135:
>>>> >
>>>> >        grdpid = fork ();
>>>> >
>>>> >    If the call to fork is changed to vfork, the testcase will pass 
>>>> but
>>>> > still get exitcode = 1 which indicates that some error has 
>>>> happened. The
>>>> > difference between fork and vfork is just whether page tables is 
>>>> copied
>>>> to
>>>> > child process or not. But I do not think it is the main cause. 
>>>> Besides,
>>>> > vfork has become outdated since it main usage is supplied by fork 
>>>> with
>>>> > copy-on-write function implemented in modern linux kernel. 
>>>> Furthermore,
>>>> > vfork is also not so safe as fork. So I do not think it is the 
>>>> accepted
>>>> way
>>>> > to solve the problem.
>>>> >
>>>> >   I will try whether it can be reproduced on drlvm of linux since 
>>>> I am
>>>> not
>>>> > sure whether it is relevent to VM or classlib. If any drlvm man 
>>>> can tell
>>>> me
>>>> > the result, it can avoid my trouble to build it on linux. :)
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > --
>>>> > Leo Li
>>>> > China Software Development Lab, IBM
>>>> >
>>>> >
>>>>
>>>> ---------------------------------------------------------------------
>>>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>>>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>>>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Leo Li <li...@gmail.com>.
Ya.
What I found is that harmony and IBM VM fails when running Runtime.exec both
on RedHat and Unbuntu. But drlvm seems passes. I have not tried suse.


On 10/16/06, Paulex Yang <pa...@gmail.com> wrote:
>
> Geir Magnusson Jr. wrote:
> > I'm confused.  Didn't you just report this on Ubuntu?
> Let Leo speak for himself, but I thought Leo meant IBM VME + Harmony
> classlib failed on Ubuntu and Redhat, but Alexey just reported that both
> (VME and DRLVM) works on SUSE, that's why it seems interesting.
> >
> > I have had similar forking problems on Ubuntu 6 (I once found a bug in
> > classlib related to forking...).
> >
> > I never figured out why Unbuntu does this, but it seemed that under
> > memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and
> > run the test again...
> > geir
> >
> >
> > Leo Li wrote:
> >> Thank you.
> >> I have just run it on drlvm of unbuntu, it works.
> >> What a qurious problem!
> >>
> >>
> >> On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
> >>>
> >>> Both DRLVM and J9 works for me (SUSE9).
> >>>
> >>> --
> >>> Alexey
> >>>
> >>> 2006/10/16, Leo Li <li...@gmail.com>:
> >>> > Hi, all:
> >>> >     The harmony Runtime.exec fails on Linux with ENOMEM.
> >>> >     Here is the testcase:
> >>> >
> >>> > public class Exec {
> >>> >    public static void main(String[] args) throws Exception {
> >>> >
> >>> >       Runtime.getRuntime().exec("ls");    }
> >>> > }
> >>> >
> >>> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get
> >>> ENOMEM
> >>> in
> >>> > native code.
> >>> >
> >>> >    After digging into it, I found it fails in procimpl.c, line 135:
> >>> >
> >>> >        grdpid = fork ();
> >>> >
> >>> >    If the call to fork is changed to vfork, the testcase will pass
> >>> but
> >>> > still get exitcode = 1 which indicates that some error has
> >>> happened. The
> >>> > difference between fork and vfork is just whether page tables is
> >>> copied
> >>> to
> >>> > child process or not. But I do not think it is the main cause.
> >>> Besides,
> >>> > vfork has become outdated since it main usage is supplied by fork
> >>> with
> >>> > copy-on-write function implemented in modern linux kernel.
> >>> Furthermore,
> >>> > vfork is also not so safe as fork. So I do not think it is the
> >>> accepted
> >>> way
> >>> > to solve the problem.
> >>> >
> >>> >   I will try whether it can be reproduced on drlvm of linux since
> >>> I am
> >>> not
> >>> > sure whether it is relevent to VM or classlib. If any drlvm man
> >>> can tell
> >>> me
> >>> > the result, it can avoid my trouble to build it on linux. :)
> >>> >
> >>> >
> >>> >
> >>> >
> >>> >
> >>> >
> >>> >
> >>> > --
> >>> > Leo Li
> >>> > China Software Development Lab, IBM
> >>> >
> >>> >
> >>>
> >>> ---------------------------------------------------------------------
> >>> Terms of use : http://incubator.apache.org/harmony/mailing.html
> >>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> >>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >>>
> >>>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Leo Li
China Software Development Lab, IBM

Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Paulex Yang <pa...@gmail.com>.
Geir Magnusson Jr. wrote:
> I'm confused.  Didn't you just report this on Ubuntu?
Let Leo speak for himself, but I thought Leo meant IBM VME + Harmony 
classlib failed on Ubuntu and Redhat, but Alexey just reported that both 
(VME and DRLVM) works on SUSE, that's why it seems interesting.
>
> I have had similar forking problems on Ubuntu 6 (I once found a bug in 
> classlib related to forking...).
>
> I never figured out why Unbuntu does this, but it seemed that under 
> memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and 
> run the test again...
> geir
>
>
> Leo Li wrote:
>> Thank you.
>> I have just run it on drlvm of unbuntu, it works.
>> What a qurious problem!
>>
>>
>> On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
>>>
>>> Both DRLVM and J9 works for me (SUSE9).
>>>
>>> -- 
>>> Alexey
>>>
>>> 2006/10/16, Leo Li <li...@gmail.com>:
>>> > Hi, all:
>>> >     The harmony Runtime.exec fails on Linux with ENOMEM.
>>> >     Here is the testcase:
>>> >
>>> > public class Exec {
>>> >    public static void main(String[] args) throws Exception {
>>> >
>>> >       Runtime.getRuntime().exec("ls");    }
>>> > }
>>> >
>>> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get 
>>> ENOMEM
>>> in
>>> > native code.
>>> >
>>> >    After digging into it, I found it fails in procimpl.c, line 135:
>>> >
>>> >        grdpid = fork ();
>>> >
>>> >    If the call to fork is changed to vfork, the testcase will pass 
>>> but
>>> > still get exitcode = 1 which indicates that some error has 
>>> happened. The
>>> > difference between fork and vfork is just whether page tables is 
>>> copied
>>> to
>>> > child process or not. But I do not think it is the main cause. 
>>> Besides,
>>> > vfork has become outdated since it main usage is supplied by fork 
>>> with
>>> > copy-on-write function implemented in modern linux kernel. 
>>> Furthermore,
>>> > vfork is also not so safe as fork. So I do not think it is the 
>>> accepted
>>> way
>>> > to solve the problem.
>>> >
>>> >   I will try whether it can be reproduced on drlvm of linux since 
>>> I am
>>> not
>>> > sure whether it is relevent to VM or classlib. If any drlvm man 
>>> can tell
>>> me
>>> > the result, it can avoid my trouble to build it on linux. :)
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Leo Li
>>> > China Software Development Lab, IBM
>>> >
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Paulex Yang
China Software Development Lab
IBM


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
I'm confused.  Didn't you just report this on Ubuntu?

I have had similar forking problems on Ubuntu 6 (I once found a bug in 
classlib related to forking...).

I never figured out why Unbuntu does this, but it seemed that under 
memory stress, Ubuntu's fork() fails.  Try this - close Eclipse and run 
the test again...

geir


Leo Li wrote:
> Thank you.
> I have just run it on drlvm of unbuntu, it works.
> What a qurious problem!
> 
> 
> On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
>>
>> Both DRLVM and J9 works for me (SUSE9).
>>
>> -- 
>> Alexey
>>
>> 2006/10/16, Leo Li <li...@gmail.com>:
>> > Hi, all:
>> >     The harmony Runtime.exec fails on Linux with ENOMEM.
>> >     Here is the testcase:
>> >
>> > public class Exec {
>> >    public static void main(String[] args) throws Exception {
>> >
>> >       Runtime.getRuntime().exec("ls");    }
>> > }
>> >
>> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM
>> in
>> > native code.
>> >
>> >    After digging into it, I found it fails in procimpl.c, line 135:
>> >
>> >        grdpid = fork ();
>> >
>> >    If the call to fork is changed to vfork, the testcase will pass but
>> > still get exitcode = 1 which indicates that some error has happened. 
>> The
>> > difference between fork and vfork is just whether page tables is copied
>> to
>> > child process or not. But I do not think it is the main cause. Besides,
>> > vfork has become outdated since it main usage is supplied by fork with
>> > copy-on-write function implemented in modern linux kernel. Furthermore,
>> > vfork is also not so safe as fork. So I do not think it is the accepted
>> way
>> > to solve the problem.
>> >
>> >   I will try whether it can be reproduced on drlvm of linux since I am
>> not
>> > sure whether it is relevent to VM or classlib. If any drlvm man can 
>> tell
>> me
>> > the result, it can avoid my trouble to build it on linux. :)
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > --
>> > Leo Li
>> > China Software Development Lab, IBM
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Leo Li <li...@gmail.com>.
 Thank you.
 I have just run it on drlvm of unbuntu, it works.
 What a qurious problem!


On 10/16/06, Alexey Varlamov <al...@gmail.com> wrote:
>
> Both DRLVM and J9 works for me (SUSE9).
>
> --
> Alexey
>
> 2006/10/16, Leo Li <li...@gmail.com>:
> > Hi, all:
> >     The harmony Runtime.exec fails on Linux with ENOMEM.
> >     Here is the testcase:
> >
> > public class Exec {
> >    public static void main(String[] args) throws Exception {
> >
> >       Runtime.getRuntime().exec("ls");    }
> > }
> >
> >    I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM
> in
> > native code.
> >
> >    After digging into it, I found it fails in procimpl.c, line 135:
> >
> >        grdpid = fork ();
> >
> >    If the call to fork is changed to vfork, the testcase will pass but
> > still get exitcode = 1 which indicates that some error has happened. The
> > difference between fork and vfork is just whether page tables is copied
> to
> > child process or not. But I do not think it is the main cause. Besides,
> > vfork has become outdated since it main usage is supplied by fork with
> > copy-on-write function implemented in modern linux kernel. Furthermore,
> > vfork is also not so safe as fork. So I do not think it is the accepted
> way
> > to solve the problem.
> >
> >   I will try whether it can be reproduced on drlvm of linux since I am
> not
> > sure whether it is relevent to VM or classlib. If any drlvm man can tell
> me
> > the result, it can avoid my trouble to build it on linux. :)
> >
> >
> >
> >
> >
> >
> >
> > --
> > Leo Li
> > China Software Development Lab, IBM
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Leo Li
China Software Development Lab, IBM

Re: [classlib][luni]Runtime.exec fails on Linux

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Alexey Varlamov wrote:
> 2006/10/16, Spark Shen <sm...@gmail.com>:
>> Alexey Varlamov 写道:
>> > Both DRLVM and J9 works for me (SUSE9).
>> Not sure whether SUSE9 env. is identical to our RedHat Enterprise 4 and
>> Unbuntu.
>> BTW, is there off-the-peg DRLVM for download on popular platform?
> 
> Other than JRE snapshots, no.

What else would you want?  They will become JDK Real Soon Now, but still
- what else would you want?

geir

> 
>>
>> Best regards
>> >
>> > --
>> > Alexey
>> >
>> > 2006/10/16, Leo Li <li...@gmail.com>:
>> >> Hi, all:
>> >> The harmony Runtime.exec fails on Linux with ENOMEM.
>> >> Here is the testcase:
>> >>
>> >> public class Exec {
>> >> public static void main(String[] args) throws Exception {
>> >>
>> >> Runtime.getRuntime().exec("ls"); }
>> >> }
>> >>
>> >> I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM in
>> >> native code.
>> >>
>> >> After digging into it, I found it fails in procimpl.c, line 135:
>> >>
>> >> grdpid = fork ();
>> >>
>> >> If the call to fork is changed to vfork, the testcase will pass but
>> >> still get exitcode = 1 which indicates that some error has 
>> happened. The
>> >> difference between fork and vfork is just whether page tables is
>> >> copied to
>> >> child process or not. But I do not think it is the main cause. 
>> Besides,
>> >> vfork has become outdated since it main usage is supplied by fork with
>> >> copy-on-write function implemented in modern linux kernel. 
>> Furthermore,
>> >> vfork is also not so safe as fork. So I do not think it is the
>> >> accepted way
>> >> to solve the problem.
>> >>
>> >> I will try whether it can be reproduced on drlvm of linux since I 
>> am not
>> >> sure whether it is relevent to VM or classlib. If any drlvm man can
>> >> tell me
>> >> the result, it can avoid my trouble to build it on linux. :)
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Leo Li
>> >> China Software Development Lab, IBM
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > Terms of use : http://incubator.apache.org/harmony/mailing.html
>> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>> >
>> >
>>
>>
>> -- 
>> Spark Shen
>> China Software Development Lab, IBM
>>
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Alexey Varlamov <al...@gmail.com>.
2006/10/16, Spark Shen <sm...@gmail.com>:
> Alexey Varlamov 写道:
> > Both DRLVM and J9 works for me (SUSE9).
> Not sure whether SUSE9 env. is identical to our RedHat Enterprise 4 and
> Unbuntu.
> BTW, is there off-the-peg DRLVM for download on popular platform?

Other than JRE snapshots, no.

>
> Best regards
> >
> > --
> > Alexey
> >
> > 2006/10/16, Leo Li <li...@gmail.com>:
> >> Hi, all:
> >> The harmony Runtime.exec fails on Linux with ENOMEM.
> >> Here is the testcase:
> >>
> >> public class Exec {
> >> public static void main(String[] args) throws Exception {
> >>
> >> Runtime.getRuntime().exec("ls"); }
> >> }
> >>
> >> I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM in
> >> native code.
> >>
> >> After digging into it, I found it fails in procimpl.c, line 135:
> >>
> >> grdpid = fork ();
> >>
> >> If the call to fork is changed to vfork, the testcase will pass but
> >> still get exitcode = 1 which indicates that some error has happened. The
> >> difference between fork and vfork is just whether page tables is
> >> copied to
> >> child process or not. But I do not think it is the main cause. Besides,
> >> vfork has become outdated since it main usage is supplied by fork with
> >> copy-on-write function implemented in modern linux kernel. Furthermore,
> >> vfork is also not so safe as fork. So I do not think it is the
> >> accepted way
> >> to solve the problem.
> >>
> >> I will try whether it can be reproduced on drlvm of linux since I am not
> >> sure whether it is relevent to VM or classlib. If any drlvm man can
> >> tell me
> >> the result, it can avoid my trouble to build it on linux. :)
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Leo Li
> >> China Software Development Lab, IBM
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
>
> --
> Spark Shen
> China Software Development Lab, IBM
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Spark Shen <sm...@gmail.com>.
Alexey Varlamov 写道:
> Both DRLVM and J9 works for me (SUSE9).
Not sure whether SUSE9 env. is identical to our RedHat Enterprise 4 and 
Unbuntu.
BTW, is there off-the-peg DRLVM for download on popular platform?

Best regards
>
> -- 
> Alexey
>
> 2006/10/16, Leo Li <li...@gmail.com>:
>> Hi, all:
>> The harmony Runtime.exec fails on Linux with ENOMEM.
>> Here is the testcase:
>>
>> public class Exec {
>> public static void main(String[] args) throws Exception {
>>
>> Runtime.getRuntime().exec("ls"); }
>> }
>>
>> I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM in
>> native code.
>>
>> After digging into it, I found it fails in procimpl.c, line 135:
>>
>> grdpid = fork ();
>>
>> If the call to fork is changed to vfork, the testcase will pass but
>> still get exitcode = 1 which indicates that some error has happened. The
>> difference between fork and vfork is just whether page tables is 
>> copied to
>> child process or not. But I do not think it is the main cause. Besides,
>> vfork has become outdated since it main usage is supplied by fork with
>> copy-on-write function implemented in modern linux kernel. Furthermore,
>> vfork is also not so safe as fork. So I do not think it is the 
>> accepted way
>> to solve the problem.
>>
>> I will try whether it can be reproduced on drlvm of linux since I am not
>> sure whether it is relevent to VM or classlib. If any drlvm man can 
>> tell me
>> the result, it can avoid my trouble to build it on linux. :)
>>
>>
>>
>>
>>
>>
>>
>> -- 
>> Leo Li
>> China Software Development Lab, IBM
>>
>>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Spark Shen
China Software Development Lab, IBM


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][luni]Runtime.exec fails on Linux

Posted by Alexey Varlamov <al...@gmail.com>.
Both DRLVM and J9 works for me (SUSE9).

--
Alexey

2006/10/16, Leo Li <li...@gmail.com>:
> Hi, all:
>     The harmony Runtime.exec fails on Linux with ENOMEM.
>     Here is the testcase:
>
> public class Exec {
>    public static void main(String[] args) throws Exception {
>
>       Runtime.getRuntime().exec("ls");    }
> }
>
>    I have tried it on RedHat Enterprise 4 and Unbuntu, both get ENOMEM in
> native code.
>
>    After digging into it, I found it fails in procimpl.c, line 135:
>
>        grdpid = fork ();
>
>    If the call to fork is changed to vfork, the testcase will pass but
> still get exitcode = 1 which indicates that some error has happened. The
> difference between fork and vfork is just whether page tables is copied to
> child process or not. But I do not think it is the main cause. Besides,
> vfork has become outdated since it main usage is supplied by fork with
> copy-on-write function implemented in modern linux kernel. Furthermore,
> vfork is also not so safe as fork. So I do not think it is the accepted way
> to solve the problem.
>
>   I will try whether it can be reproduced on drlvm of linux since I am not
> sure whether it is relevent to VM or classlib. If any drlvm man can tell me
> the result, it can avoid my trouble to build it on linux. :)
>
>
>
>
>
>
>
> --
> Leo Li
> China Software Development Lab, IBM
>
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org