• Cannot launch an external program in g++ 4.7.3

    From James Moe@21:1/5 to All on Wed Jul 6 12:29:19 2016
    Hello,
    To start an external program independently in PMMail, it uses DosStartSession(). This works as expected in g++ v3.3.5-5. It fails in
    g++ v4.7.3. The window output is:

    SYS1034: The system cannot find the command processor in the path
    specified.
    OS/2 Command Interpreter version 4.5

    implying the environment is not ready when it attempts to start the
    external program. Which does not start.

    startData.Length = sizeof(STARTDATA);
    startData.Related = SSF_RELATED_CHILD;
    startData.InheritOpt = SSF_INHERTOPT_SHELL;
    startData.FgBg = SSF_FGBG_BACK;
    startData.PgmControl = SSF_CONTROL_INVISIBLE;
    startData.TraceOpt = SSF_TRACEOPT_NONE;
    startData.SessionType = SSF_TYPE_WINDOWABLEVIO;

    Can anyone suggest what other values may be appropriate here?

    --
    James Moe
    jmm-list at sohnen-moe dot com
    Think.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven Levine@21:1/5 to jimoeDESPAM@sohnen-moe.com on Thu Jul 7 20:40:24 2016
    On Wed, 6 Jul 2016 19:29:19 UTC, James Moe
    <jimoeDESPAM@sohnen-moe.com> wrote:

    Hi James,

    To start an external program independently in PMMail, it uses DosStartSession(). This works as expected in g++ v3.3.5-5. It fails in
    g++ v4.7.3. The window output is:

    SYS1034: The system cannot find the command processor in the path
    specified.
    OS/2 Command Interpreter version 4.5

    What is the API return code from DosStartSession?

    Can anyone suggest what other values may be appropriate here?

    The values you provided look fine and probably are fine.

    Since 3.3.5 works, I have to suspect that the compiler change moved
    things around in memory and exposed a latent defect in the existing
    code.

    Have you tried a simple testcase to test whether the problem is your DosStartSession usage or something else.

    BTW, DosStartSession is not high memory safe. If you are building
    with -Zhigh-mem you need to #include os2safe.h in code that invokes DosStartSession.

    Steven

    --
    ---------------------------------------------------------------------
    Steven Levine <steve53@earthlink.bogus.net>
    DIY/Warp/BlueLion etc. www.scoug.com www.arcanoae.com www.warpcave.com ---------------------------------------------------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Moe@21:1/5 to Steven Levine on Mon Jul 11 15:15:36 2016
    On 07/07/2016 06:40 PM, Steven Levine wrote:
    Have you tried a simple testcase to test whether the problem is your DosStartSession usage or something else.

    g++ -Zomf -Zhigh-mem test-dosstartsession.cpp

    It works in a simple test case. I even set it up to launch the
    external program from a thread. Worked fine.
    Which raises the question: What is different?
    The only part I haven't duplicated is the use of a termination queue.
    I do not know how that would make difference, though.

    BTW, DosStartSession is not high memory safe. If you are building
    with -Zhigh-mem you need to #include os2safe.h in code that invokes DosStartSession.

    I have included <os2safe.h> for quite a long time.

    --
    James Moe
    jmm-list at sohnen-moe dot com
    Think.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Moe@21:1/5 to James Moe on Mon Jul 11 15:51:02 2016
    On 07/11/2016 03:15 PM, James Moe wrote:
    The only part I haven't duplicated is the use of a termination queue.
    I do not know how that would make difference, though.

    Nevertheless, it does! After adding the termination queue, I get the
    same failure. Removing the queue name from PMMail's code makes no
    difference, though.

    --
    James Moe
    jmm-list at sohnen-moe dot com
    Think.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steven Levine@21:1/5 to jimoeDESPAM@sohnen-moe.com on Tue Jul 12 01:11:25 2016
    On Mon, 11 Jul 2016 22:51:02 UTC, James Moe
    <jimoeDESPAM@sohnen-moe.com> wrote:

    Hi James,

    Nevertheless, it does! After adding the termination queue, I get the
    same failure. Removing the queue name from PMMail's code makes no
    difference, though.

    If you send me a copy of the testcase, I will take a look at it and
    let you know what I find.

    If you want to open a pmmail ticket to track this issue, I can pick up
    the testcase from there.

    Steven

    --
    ---------------------------------------------------------------------
    Steven Levine <steve53@earthlink.bogus.net>
    DIY/Warp/BlueLion etc. www.scoug.com www.arcanoae.com www.warpcave.com ---------------------------------------------------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)