Cannot launch an external program in g++ 4.7.3

19 views
Skip to first unread message

James Moe

unread,
Jul 6, 2016, 3:29:26 PM7/6/16
to
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.

Steven Levine

unread,
Jul 7, 2016, 9:40:29 PM7/7/16
to
On Wed, 6 Jul 2016 19:29:19 UTC, James Moe
<jimoe...@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 <ste...@earthlink.bogus.net>
DIY/Warp/BlueLion etc. www.scoug.com www.arcanoae.com www.warpcave.com
---------------------------------------------------------------------

James Moe

unread,
Jul 11, 2016, 6:15:44 PM7/11/16
to
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

unread,
Jul 11, 2016, 6:51:10 PM7/11/16
to
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.

Steven Levine

unread,
Jul 12, 2016, 2:11:30 AM7/12/16
to
On Mon, 11 Jul 2016 22:51:02 UTC, James Moe
<jimoe...@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.
Reply all
Reply to author
Forward
0 new messages