This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: program restarts itself automatically when run from Cygwin shell


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
concluded successfully.

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
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      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]