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.y...@nifty.ne.jp>
--- origsrc/libtool-2.5.3/build-aux/ltmain.in   2025-02-19 21:07:43.154024700 
+0900
+++ src/libtool-2.5.3/build-aux/ltmain.in       2025-02-19 22:38:25.765619300 
+0900
@@ -4085,7 +4085,7 @@ check_executable (const char *path)
   if ((!path) || (!*path))
     return 0;
 
-  if ((stat (path, &st) >= 0)
+  if ((stat (path, &st) >= 0) && !S_ISDIR (st.st_mode)
       && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
     return 1;
   else
-- 
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

Reply via email to