program restarts itself automatically when run from Cygwin shell
Thu Jun 7 00:38:00 GMT 2012
Actually, I think Greg Chicares-2 may have provided the answer earlier.
When I set CYGWIN to procs_retry:1 the old fashioned Windows way (using the
Control Panel, etc.) and then open a new Cygwin shell to run my application
in, I do not see the repeated restart behavior.
Furthermore, when I follow my command line with '; echo $?' to see its exit
status, I'm finding it is usually 0 but sometimes 127 and I think it is on
these occasions that the program would previously repeat itself. The odd
thing is that this can happen even after the program has apparently
This is useful information in two respects.
First, I now know how to avoid random restarts.
Second, this is a clue that somewhere in the code there is a problem with
how multiple threads are behaving (probably in terms of memory access) which
ends up causing something (a destructor?) to exit with status 127 (is that
equivalent to -1 in this case??) before the program as a whole can return 0
upon exit. All the other operating systems don't really care about this, but
Cygwin does so I might as well track it down and fix it. You never know if
it may be corrupting more important data somewhere else.
My thanks to all.
View this message in context: http://old.nabble.com/program-restarts-itself-automatically-when-run-from-Cygwin-shell-tp33972885p33973296.html
Sent from the Cygwin list mailing list archive at Nabble.com.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin