DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 51JDu8V23966580
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 51JDu8V23966580
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=WeppA7jL
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D8DC63858C78
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1739973366;
	bh=NKEfg/l2sikcil3u+kxPVuI8/pVWgi1u9WL0HMushMc=;
	h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=WeppA7jLRAbEND7hw6UUpF20YFs7VIYAiMZZxw8FSAMRxhHOVHcHGjE85BRsaoy/5
	 MgR6CYwndJHsgfAd3BSPQwOQQ/DPJnlNvW+1/CRztIiU/1iDMMgfJ6507o8ccueU0L
	 /j53Q/cMyP3wGe4OlHn/SUpIkyNWjavKxQbPPLaE=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B19CB3858401
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B19CB3858401
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739973281; cv=none;
 b=feI3TQ7hj5gZGC6XPKvt3inWAD557umdNYK7TjAg0lFxshvpvZj2vMU/Id2pK29RZ0PLznTT6qQrVS7t6hYU1b1lA7vXwHilnLnID1oGxbpPKntZIkhxiHk9MPpKDyPGrDHJspFKlskBkuBV+pK1l/cv+DIf73GpG5DEbqwii5k=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1739973281; c=relaxed/simple;
 bh=tKamCY7WazjvOCzoLeUY4lEhnSS73Kvo3ldcfIh4eD0=;
 h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
 b=iMHfpdWd1OVIxIdbp5v4kt6gGwqtMPf/7r993T65cebDFYowVyPDSE1sa77QPRZsgYXI8TCP6J1ivSZ3ROnEu7eoAMUVf/OXsMyWbm86/PdL+E3uZGig/rfU4DyjvlppdW2jAbJX9x2qJEliiry21UXUn9UfUM9pjk/8wkuKd4c=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B19CB3858401
Date: Wed, 19 Feb 2025 22:54:37 +0900
To: cygwin@cygwin.com
Subject: [Bug] libtool (was Re: lost output after pipe redirection)
Message-Id: <20250219225437.a2d307e940c92916ef1fb89f@nifty.ne.jp>
In-Reply-To: <20250219215849.81bc27632686b1ed9f44b7d5@nifty.ne.jp>
References: <6bc117eb-ece2-43a7-91ae-6ab17d62f6ca@gmail.com>
 <20250218205647.41b64c0fded65dc9bc681589@nifty.ne.jp>
 <32abf18d-488e-4658-b006-96c62cfd1f00@gmail.com>
 <20250219073813.7b26b8db73e055b9f1d2c75b@nifty.ne.jp>
 <20250219204205.ba1dfa7265ba68cf0deee14e@nifty.ne.jp>
 <20250219215849.81bc27632686b1ed9f44b7d5@nifty.ne.jp>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="Multipart=_Wed__19_Feb_2025_22_54_37_+0900_FS+jHSBrg1CA4_v."
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin@cygwin.com>
Reply-To: Takashi Yano <takashi.yano@nifty.ne.jp>
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

This is a multi-part message in MIME format.

--Multipart=_Wed__19_Feb_2025_22_54_37_+0900_FS+jHSBrg1CA4_v.
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi Achim,

On Wed, 19 Feb 2025 21:58:49 +0900
Takashi Yano wrote:
> On Wed, 19 Feb 2025 20:42:05 +0900
> Takashi Yano wrote:
> > On Wed, 19 Feb 2025 07:38:13 +0900
> > Takashi Yano wrote:
> > > On Tue, 18 Feb 2025 21:59:36 +0100
> > > Marco Atzeriwrote:
> > > > On 18/02/2025 12:56, Takashi Yano via Cygwin wrote:
> > > > > Hi Marco,
> > > > > 
> > > > > On Mon, 17 Feb 2025 09:28:11 +0100
> > > > > Marco Atzeri wrote:
> > > > >> Hi Takashi,
> > > > >>
> > > > >> I think there is still issue on pipe redirection output lost.
> > > > >> I have two cases where during package tests the test are reported as
> > > > >> failures as the output is missing, while running the test stand alone
> > > > >> the output is produced as expected.
> > > > >>
> > > > 
> > > > >> --------------------------------------------------------------
> > > > > 
> > > > > This is not a pipe problem, but just a path problem for gdbmtool.
> > > > > Please try the patch attached.
> > > > 
> > > > Thanks Takashi,
> > > > 
> > > > it works.
> > > > I reported the solution upstream.
> > > 
> > > I forgot to mention, but this problem does not occur in Linux.
> > > I don't know why.
> > 
> > I digged this deeper.
> > 
> > I noticed that this is not a simple path problem. Even if gdbmtool.exe
> > is in the path, running it fails if the directory named gdbmtool exists
> > in the path prior to gdmtool.exe.
> > 
> > Simple test case which reproduce this problem is attached. This problem
> > occurs if the executable is linked with libtool.
> > 
> > The expected output of the test case is:
> > Hello 1
> > Hello 2
> > Hello 3
> > 
> > However, the output in cygwin is:
> > Hello 1
> > 127
> > Hello 3
> > 
> > The culprit would be libtool or cygwin1.dll. libtool is the large
> > scale shell script, so I do not find the cause so far.
> 
> This seems to be a problem of libtool. With the test case I attached
> previous mail, the stub executable should call execv() with:
> <path to the test case>/b/.libs/hello.exe
> because hello.exe is in the directory "b".
> However, it calls execv() with:
> <path to he test case>/a/.libs/hello.exe
> 
> Achim, any idea?

I think I have found the cause. It is an upstream bug of libtool.
The function check_executable() generated by ltmain.sh returns 1
for directory, but this is not correct behaviour, I think.

I confirmed that the patch attached solves the issue.

What do you think?

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

--Multipart=_Wed__19_Feb_2025_22_54_37_+0900_FS+jHSBrg1CA4_v.
Content-Type: text/plain;
 name="check-executable.patch"
Content-Disposition: attachment;
 filename="check-executable.patch"
Content-Transfer-Encoding: base64

LS0tIG9yaWdzcmMvbGlidG9vbC0yLjUuMy9idWlsZC1hdXgvbHRtYWluLmluCTIwMjUtMDItMTkg
MjE6MDc6NDMuMTU0MDI0NzAwICswOTAwDQorKysgc3JjL2xpYnRvb2wtMi41LjMvYnVpbGQtYXV4
L2x0bWFpbi5pbgkyMDI1LTAyLTE5IDIyOjM4OjI1Ljc2NTYxOTMwMCArMDkwMA0KQEAgLTQwODUs
NyArNDA4NSw3IEBAIGNoZWNrX2V4ZWN1dGFibGUgKGNvbnN0IGNoYXIgKnBhdGgpDQogICBpZiAo
KCFwYXRoKSB8fCAoISpwYXRoKSkNCiAgICAgcmV0dXJuIDA7DQogDQotICBpZiAoKHN0YXQgKHBh
dGgsICZzdCkgPj0gMCkNCisgIGlmICgoc3RhdCAocGF0aCwgJnN0KSA+PSAwKSAmJiAhU19JU0RJ
UiAoc3Quc3RfbW9kZSkNCiAgICAgICAmJiAoc3Quc3RfbW9kZSAmIChTX0lYVVNSIHwgU19JWEdS
UCB8IFNfSVhPVEgpKSkNCiAgICAgcmV0dXJuIDE7DQogICBlbHNlDQo=

--Multipart=_Wed__19_Feb_2025_22_54_37_+0900_FS+jHSBrg1CA4_v.
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

--Multipart=_Wed__19_Feb_2025_22_54_37_+0900_FS+jHSBrg1CA4_v.--
