f



Cannot launch an external program in g++ 4.7.3

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.
0
James
7/6/2016 7:29:19 PM
comp.os.os2.programmer.misc 1326 articles. 0 followers. Post Follow

4 Replies
203 Views

Similar Articles

[PageSpeed] 51

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
---------------------------------------------------------------------
0
Steven
7/8/2016 1:40:24 AM
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.
0
James
7/11/2016 10:15:36 PM
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.
0
James
7/11/2016 10:51:02 PM
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
---------------------------------------------------------------------
0
Steven
7/12/2016 6:11:25 AM
Reply: