Running native exe from Cygwin in random instances reports incorrect error code 127
Warren Young
wyml@etr-usa.com
Mon Jan 18 22:45:00 GMT 2016
On Jan 18, 2016, at 8:27 AM, David Sicilia <dpsicilia@gmail.com> wrote:
>
> 3) The native windows program successfully completes and exits with
> code 0 internally
> 4) But -- the error code returned to the bash script is 127 --
> despite no indication of an error anywhere
We’ll want a simple test case showing the problem. I can’t replicate it here.
That is to say, given hello.c:
#include <stdio.h>
int main(void)
{
printf("Hello, world!\n");
return 0;
}
…compiled via Visual Studio 2015’s cl, I can run it thousands of times successfully via runhello.sh:
#!/bin/bash
typeset -i i=0
echo -n "0: "
while ./hello
do
i=i+1
echo -n "$i: "
done
echo “Error: $?"
If the same pair of programs work on your system, then the problem is not with *all* native .exes, as you claim, so you’d need to narrow down what your program is doing that actually causes the problem.
If this pair of programs *fails* on your system, then you’ve probably got a BLODA problem:
https://cygwin.com/faq/faq.html#faq.using.bloda
--
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
More information about the Cygwin
mailing list