X-Recipient: archive-cygwin@delorie.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:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; q=dns; s=default; b=tk5cDbc
	VKCQNwDrwSlboGh3s2KAE7qflT9/aX170K3wVPo0nymz15J5Sy0Au1zEO77+tYet
	Q7fcCwDpwe7bA6IEYbXLyFC+APhFP5mkrQDxXFeZe6o+0a4Xf/6Mmor/RN30wr+z
	t8KvbEVzmHPv4XzMeZxE4KepOf9Qez6bThGs=
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:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:content-type; s=default; bh=YpQSs2JYAij5K
	rw+k8tOptZ06Po=; b=t55R//N00crV4QNfhPoKooZ9EYYHPCT7vQXU4O0oAZ48z
	sfQYnmNwQ8NxYohcrlZrTpEkdP1YZA9bAppX923+nKFDmvhKhvTQu/eeAhq9owjY
	PwJ2oWWF7frVOdoI6J3+hqGI2WEknNK1Hvk0+1yzHFB1MCAQ1i6PHwnE+ysuXk=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=relief, NEVER, Hx-languages-length:3113
X-HELO: mail-it0-f52.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:mime-version:sender:in-reply-to:references:from         :date:message-id:subject:to;        bh=dDWt7awD+ozlATrAkBqyIAvQ9uwh/KxDmrcAkj3XJtE=;        b=NfQfjfEvf0xkmyFeaYBKlmGEBO2r2TrzNLvpn5r+Q7lN4oL34fdOwhruGVdJe096NW         zkS1Q4B2cCB15rEa3O5zbreO8BlFOwMcUUVKbx8xU2d4qdGlDVBVh4M+Q46ROaGnpQ38         E9nycSAXYD90jed0zr4meUx6puu/R9jWz3YdrT7UuGnfaYi06ZCM6wsh6uKndAH/W7Sd         MFpgWXy411pYPtxkDimy1YNZI+INchjS2g0qblm8qnRXZ7v2aPIzuAZoYZIxcj1QSy40         ZPgoLoBxyGeoj+bUPptAu/JrNmSEm+yxIGph2R7wWTuN+1RDOzcajuxct0kAXC8nUFp8         CwbA==
X-Gm-Message-State: AKS2vOyn37/nT3vSAHPsDU5us7cq7+CkZruRRIVizB5HRm0mgU4nZS07	IJIeqdE72ZklD+jif6Djy5Ox8B4/4A==
X-Received: by 10.36.4.4 with SMTP id 4mr1578690itb.73.1498503692351; Mon, 26 Jun 2017 12:01:32 -0700 (PDT)
MIME-Version: 1.0
In-Reply-To: <CANZ2p_ckjzWEp0uPoJ8MAXh=0B6ZhWQVt9v_NmsFP-fpoX-sEg@mail.gmail.com>
References: <CANZ2p_ckjzWEp0uPoJ8MAXh=0B6ZhWQVt9v_NmsFP-fpoX-sEg@mail.gmail.com>
From: Wouter van Doorn <wouter@vandoorn.tv>
Date: Mon, 26 Jun 2017 20:01:11 +0100
Message-ID: <CANZ2p_ecq4LXNtWtShednD3n8efLkKOPujeiR9VtvboOsLOimA@mail.gmail.com>
Subject: Re: Compiled programs fail to run from Cygwin Terminal, but work from windows cmd
To: cygwin@cygwin.com
Content-Type: text/plain; charset="UTF-8"
X-IsSubscribed: yes

Hello Cygwin-helpers,

Many thanks to all who have responded. It was good not to sit here
alone behind my keyboard tearing my hair out.

I'll outline what has heppened next especially for the benefit of
those readers who find themselves with this same problem. It would be
nasty to leave them in the lurch if I now only said 'thanks - it's
fine now'.

But things have now taken a strange/miraculous turn for the better. It
started with a suggestion from Achim about the general crappiness of
my PATH (fair), with a very specific request concerning the path by
Houder soon after. That was to recompile/link and re-run after setting
the PATH to just /usr/bin and nothing more.

To my relief, the resulting executable worked. Not just under the
command prompt, but also under mintty this time.

From there, it seemed an easy task to find what the path component was
that caused the whole mess, but... it wasn't. Because now that it once
worked as expected, I was NEVER able to get it to go wrong again. I
re-instated the troublesome path, removed and rebuilt the executable,
and it is now still fine. Did the same after a shutdown/restart. No
change - everything is now as it should have been from the start.

So the message to those with the same problem is: try recompiling with
the PATH set to /usr/bin. After that, you may, just like me,
experience some sort of magic that means the fault disappears.

I'd rather know what was wrong, and what really happened to make the
error go away, but I can live with how it is. If developers want me to
run specific tests, I'll be very happy to do so. Otherwise, I'd say we
should consider this closed (but not forgotten).

Thanks again to all who chipped in - it was really apreciated.
Wouter

On 21 June 2017 at 22:10, Wouter van Doorn <wouter@vandoorn.tv> wrote:
> Hi,
>
> Having installed Cygwin with no errors I could see, I went on to
> compile and run "hello world" - as you do. I could make it go from a
> windows command prompt after modifying the system path to include
> cygwin\bin, so - so far so good.
>
> From the cygwin terminal, however, the same executable refuses to play
> ball. No text is shown; the command prompt returns instantly.
>
> I have tried looking in the mailing list archive, and the answer may
> well be there (in which case I apologise). But the searches I have
> tried either returned nothing, or an incredible amount of information
> that was not apparently relevant to my problem.
>
> Maybe the attached strace output tells somebody something; to me its
> only helpful thing is that it shows that the cygwin1.dll is found and
> loaded, which eliminates the most likely potential problem that I
> could see. Dependency Walker only mutters about 64-bit and 32-bit
> libraries being mixed, but as the program runs under the Windows
> command prompt, I am discounting that as a reason for the failure.
>
> All the standard pre-compiled utilities I tried run as expected from
> the cygwin terminal.
>
> I'd be very grateful for a pointer!
> Wouter van Doorn

--
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

