[Mono-dev] execv fails with error status 126

C S Vadiraj csvadiraj at novell.com
Wed Oct 17 23:56:50 EDT 2007

>>> On Wed, Oct 17, 2007 at  9:11 PM, in message
<20071017154159.GF27285 at debian.org>, Paolo Molaro <lupus at ximian.com> wrote: 
> On 10/17/07 Miguel de Icaza wrote:
>> > > 1. execv() is a Dllimport from libc.
>> > 
>> > You should use the Process class.
>> > 
>> > > 2. This behavior is not consistently seen. 
>> > > 3. Application is a daemon process.
>> > > 4. mono version used 1.1.13
>> > 
>> > You should use mono 1.2.5 and up.
>> > 
>> > That said, you should post the signature of the method you're using to
>> > dllimport execv and the way you're calling it: it's most likely that
>> > is incorrect (for example, do you null terminate the array?).
>> He should not be using execv anyways because execv will not properly
>> prepare the runtime for another process (file descriptors used by the
>> parent need to be explicitly closed after fork, and there are a few
>> other cleanup tasks that must be done after fork).
> I assumed he didn't use fork or he'd likely have also other issues.
> He also didn't mention using fork and we always advised against using it.
> execv() by itself to execute another process in place of the current
> should work, but as I said in the first line of my reply, the Process
> class should likely be used.

Yes I've not used fork() but do have lot of threads running at this point of time. If that makes a difference too?
And also its used to exec himself with a different arguments. 

However will monitor it again with process class and updated mono version.


More information about the Mono-devel-list mailing list