This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: spawn,exec,siganl strangeness?


On Wed, May 23, 2001 at 01:37:43AM +0100, Jason Moxham wrote:
>Thanks Christopher Faylor for your Ctrl-C explanation
>(I don't really want Crtl-C , but SIGTERM is not generated by dos
>windows on exit )

I'm sorry.  I respond to hundreds of email messages a day.  I don't know
what you are thanking me for.

dig, dig, dig.

Oh.  That email from Saturday.

Ok.  I don't understand what you're asking for.  Your original email mentioned
SIGINT.  SIGINT isn't generated on windows exit either.

>I wont include any source as its a distributed client/server app and you
>need a lot of tools to compile it
>
>prog1.exe is "like"
>
>trap ctrl-C signals
>do{printf("in prog1\n");fflush(0);
>    spawnl(_P_WAIT,".\\prog2.exe",".\\prog2.exe",0);
>  }while(1);
>
>
>prog2.exe is "like"
>
>trap ctrl-C signals
>printf("in prog2\n");fflush(0);
>do{
>  }while(1);
>
>when Ctrl-C {printf("exit prog2\n");fflush(0);exit(0);}
>
>What happens under linux and B20.1 is that we get the output
>
>in prog1
>in prog2
>exit prog2
>in prog1
>etc
>
>
>which is what is expected
>
>under latest cygwin 1.3.1 1.3.2 1.3.2-1 we sometimes get (about 1/2
>time)
>
>in prog1
>in prog2
>in prog1
>exit prog2
>in prog2
>
>etc
> or some of the output is missing
>
>the rest of the calculations that are done (that are not included here)
>appear to be correct
>
>What I'm asking is what sort of programming errors etc can produce this
>sort of thing , and why it only seems to affect the latest cygwin
>
>I realize that there is not much detail here ...

Unfortunately, there is not enough detail to even hazard a guess as to
what you're asking.  Are you saying that extra prog1's are being started
when they shouldn't be?  If so, perhaps this is just at tty flushing
issue.  Don't use CYGWIN=tty and see if that helps.

Also, In your original email you were mentioning P_NOWAIT, now you're
mentioning P_WAIT.  If you are actually using P_NOWAIT that could certainly
result in out-of-order execution.

You've also mentioned linux, which doesn't have a spawnl function.

I'm sorry that I can't help you more than this.  If you have a linux
implementation then you should also have something that uses fork/exec.
Maybe that will work better for you.

Or if you can provide a simple failing test case, I'd be happy to look into
it.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]