message passing + variable overwrites

Hi…
Here’s a problem that i am facing:
I have a main program (C) called “Img”
“Img” spawns 3 processes “Img_Acq”, “Img_Cent”, “Img_Proc” and attaches a
proxy to each of these programs. In order for all the programs to know each
other pids and proxies I send a message from “Img” that contains this
information.
When the program is executed, all seems to go well for a while…the pids and
proxies printed in the different spawned processes match with those in
“Img”, but then things start going wrong. All the values start growing and
growing till they become really huge and then one by one keeps on reaching
an upper limit…

I have been over the code a million times, and I cannot locate a place where
I might be tampering with the contents of the message(pid+proxy info)
passed…All i ever do in the spawned programs is to Receive(0,&info,…) and
then assign:

pid_Img=info[0];
proxy_Img=info[1]…etc… where info is the message that has been passed
and received… and after this allocation i enter into an infinite loop, so
i never touch these values again…

Any help would be appreciated…
Thanks
Anup



\


ANUP B. KATAKE Office:
Graduate Student, 609-D, HRBB
Aerospace Engineering 3141-TAMU,
Texas A & M University. College Station, TX 77840

Tel: (979) 845-0720 (O) email: anup@tamu.edu
(979) 845-3288 (Visnav)


I am! I can!! I will!!!



\


ANUP B. KATAKE Office:
Graduate Student, 609-D, HRBB
Aerospace Engineering 3141-TAMU,
Texas A & M University. College Station, TX 77840

Tel: (979) 845-0720 (O) email: anup@tamu.edu
(979) 845-3288 (Visnav)


I am! I can!! I will!!!


inn.qnx.com” wrote:

Hi…
Here’s a problem that i am facing:
I have a main program (C) called “Img”
“Img” spawns 3 processes “Img_Acq”, “Img_Cent”, “Img_Proc” and attaches a
proxy to each of these programs. In order for all the programs to know each
other pids and proxies I send a message from “Img” that contains this
information.
When the program is executed, all seems to go well for a while…the pids and
proxies printed in the different spawned processes match with those in
“Img”, but then things start going wrong. All the values start growing and
growing till they become really huge and then one by one keeps on reaching
an upper limit…

By “value” do you mean info[0]?
What does the declaration of info look like?
Have you checked that the values you are sending (in Img) are what you
expect?

Ricahrd

I have been over the code a million times, and I cannot locate a place where
I might be tampering with the contents of the message(pid+proxy info)
passed…All i ever do in the spawned programs is to Receive(0,&info,…) and
then assign:

pid_Img=info[0];
proxy_Img=info[1]…etc… where info is the message that has been passed
and received… and after this allocation i enter into an infinite loop, so
i never touch these values again…

Any help would be appreciated…
Thanks
Anup


ANUP B. KATAKE Office:
Graduate Student, 609-D, HRBB
Aerospace Engineering 3141-TAMU,
Texas A & M University. College Station, TX 77840

Tel: (979) 845-0720 (O) email: > anup@tamu.edu
(979) 845-3288 (Visnav)


I am! I can!! I will!!!



ANUP B. KATAKE Office:
Graduate Student, 609-D, HRBB
Aerospace Engineering 3141-TAMU,
Texas A & M University. College Station, TX 77840

Tel: (979) 845-0720 (O) email: > anup@tamu.edu
(979) 845-3288 (Visnav)


I am! I can!! I will!!!


inn.qnx.com <anup@tamu.edu> wrote:

Hi…
Here’s a problem that i am facing:
I have a main program (C) called “Img”
“Img” spawns 3 processes “Img_Acq”, “Img_Cent”, “Img_Proc” and attaches a
proxy to each of these programs.

First, it is generally bad for a process to attach a proxy to another
process. Each of Img_Acq, Img_Cent, and Img_Proc should attach their
own proxy, and if neccessary, give that to Img in a message.


In order for all the programs to know each
other pids and proxies I send a message from “Img” that contains this
information.
When the program is executed, all seems to go well for a while…the pids and
proxies printed in the different spawned processes match with those in
“Img”, but then things start going wrong. All the values start growing and
growing till they become really huge and then one by one keeps on reaching
an upper limit…

What values start growing?

I have been over the code a million times, and I cannot locate a place where
I might be tampering with the contents of the message(pid+proxy info)
passed…All i ever do in the spawned programs is to Receive(0,&info,…) and
then assign:

pid_Img=info[0];
proxy_Img=info[1]…etc… where info is the message that has been passed
and received… and after this allocation i enter into an infinite loop, so
i never touch these values again…

So, the values of pid_Img and proxy_Img start growing? If this is the case,
they’re just local C variables – the OS wouldn’t be touching them, If
they’re growing, somewhere you’re overwriting them.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.