www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3158] New: std.process.execv() not return result, but terminate application

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3158

           Summary: std.process.execv() not return result, but terminate
                    application
           Product: D
           Version: 2.031
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: golovanov_alexey mail.ru


Phobos in DMD 2.031, 2.030, 1.045 on Windows XP SP3:

function int std.process.execv(in string pathname, in immutable(char)[][] argv)
not return any value, but terminate application.

Short example - caller.exe should run called.exe, then print returned value:

/*** begin file caller.d */
import std.process;
import std.stdio;

void main()
{
  string[] args = ["a1", "b2", "c3"];
  int res = std.process.execv("called.exe", args);
  writefln("res=%d", res); /*this line never executed*/
}/*** end file caller.d */

In Windiws XP environment caller.exe terminates with code 0 while executing
execv() function, and writefln() never executed - no any output occure;

Under debug we can see calls:

_Dmain -> std process execv -> _execv -> ___spawn -> sub_4263F0 -> _exec ->
_exit

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 09 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3158


BCS <shro8822 vandals.uidaho.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shro8822 vandals.uidaho.edu




--- Comment #1 from BCS <shro8822 vandals.uidaho.edu>  2009-07-09 07:41:41 PDT
---
This is spec is almost certainly wrong because the POSIX exec* calls replace
the current process with whatever it is called with, The function never returns
unless something goes wrong. These functions should be renamed or re speced.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 09 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3158


Witold Baryluk <baryluk smp.if.uj.edu.pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |baryluk smp.if.uj.edu.pl




--- Comment #2 from Witold Baryluk <baryluk smp.if.uj.edu.pl>  2009-07-13
03:07:14 PDT ---
exec* calls bahaves this way. So IMHO documentation should be fixed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 13 2009