delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/01/18/14:51:10

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; q=dns; s=default; b=UZAKvmaj2soIrV9OxrZsuKWPXuld
I0AwKhXy0eo6DIuYqUnVbCZKiKzISHFMe4WdEarP1hgQizAufj+T6r8QMT0Kpvao
Aud6BkM2TYs6cyDT7RSVGmZHFbDo18LfXTJvyT1ZiiZRvCdQekemKGWCSbyKoPt1
orhR/FnwAXHpiys=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; s=default; bh=eb9eEMo1ppZhQVgd0vdBH71WQv4=; b=U1
3UvI+j2SdI2j6jkDP0hKKP6TQwrzXlodcGLLquPTIeUkfMLrAdg3r2mvSu2GlLH9
ZR/35y6x+uwjInZCygY2rNiwAQhqCiaN0XX1KImIEXssj4MK2Vi58/1xTGRnHjE3
rGQ+0D9crfM904EKM8+jHizqEWPwd2nBZ4uKm/hK8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.3 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=*all*, H*r:qmail-ldap-1.03, sicilia, Sicilia
X-HELO: etr-usa.com
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\))
Subject: Re: Running native exe from Cygwin in random instances reports incorrect error code 127
From: Warren Young <wyml AT etr-usa DOT com>
In-Reply-To: <CAGW0ud2ELnAAkx57A3LutxiAoBtv1Mm7ssfaut__JDJu5GUSkg@mail.gmail.com>
Date: Mon, 18 Jan 2016 12:50:39 -0700
Message-Id: <C12B9B32-5A3A-4F9B-A8FD-BC8F3EE91F0F@etr-usa.com>
References: <CAGW0ud2ELnAAkx57A3LutxiAoBtv1Mm7ssfaut__JDJu5GUSkg AT mail DOT gmail DOT com>
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u0IJp4LK018970

On Jan 18, 2016, at 8:27 AM, David Sicilia <dpsicilia AT gmail DOT 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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019