From bug-request at octave dot org Tue Apr 4 16:22:40 2006 Subject: Re: system() fails in high memory situation From: "John W. Eaton" To: Tom Holroyd Cc: Paul Koufalas , bug@octave.org Date: Tue, 4 Apr 2006 17:22:16 -0400 On 29-Mar-2006, Tom Holroyd wrote: | A better solution would be to change the implementation of | system() to use vfork() instead of fork(). I haven't tested | that, but vfork() is I think supposed to create a context which | is more efficient for doing an exec(), so it won't create the | page tables and it won't need all that virtual memory to be | available. Or clone() with some combination of flags that are | documented on the man page... There are several different paths through Octave's Fsystem function (the one that is callable from the scripting langauge). One does use fork followed by exec, but that's the "async" case. For the case that you originally reported: This is from the hog: octave:2> system('date') ans = -1 Octave just calls the system() function from the C library. So if this is a bug, then I think the place to fix it is in the C library. I would expect that you should be able to duplicate the problem with a simple C program that allocates a lot of memory (you may have to actually store some values in it in addition to allocating it) and then calls system ("date"). Then you'd have something to report to the maintainers of the C library on your system. If you can't duplicate the problem outside of Octave, then I think we would need a precise recipe for how to reproduce the bug using Octave. How much memory are you using? How is it allocated? How much memory does your system have? etc. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------