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: Running native exe from Cygwin in random instances reports incorrect error code 127


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


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