|
From: | Martin Dorey |
Subject: | Re: ---Please check it is a bug or not? |
Date: | Sun, 31 Mar 2024 19:00:31 +0000 |
The script sets things up so that the cscope at the head of PATH will be a directory. I see the same behavior with the latest git version of Gnu Make running on glibc 2.31-13+deb11u8. Bash would report this as:
mad@shuttle:~/tmp/zhao-2024-03-31/makebug$ PATH=bin:$PATH cscope
bash: cscope: command not found
mad@shuttle:~/tmp/zhao-2024-03-31/makebug$
Dash would report this like Make:
$ PATH=bin:$PATH cscope
dash: 2: cscope: Permission denied
$
ltrace suggested to me that the observed behavior is consistent with the active code being that at:
... where I believe EACCES to be 13 and to decode to "Permission denied". That clearly says that the handling of directories is deliberately thus. That code arrived in September of 2019 with:
I'm not entirely convinced that this particular error code is as helpful as it could easily be, but there's clearly some precedent for it. Unhelpful behavior in this area was the subject of several recent-ish bugs:
https://savannah.gnu.org/bugs/?63070: posix_spawn fails to run a child process.
https://savannah.gnu.org/bugs/?57022: Error 127 executing a script with no #!
The behavior in those cases was more unhelpful. If I search with:
... then I find there is already a bug on record, with a more helpful Summary than this email thread's Subject, that speaks directly to this:
https://savannah.gnu.org/bugs/?62200: Make tries to execute directories name as commands instead of using shell PATH resulting failure with permission
denied
Over there, I see I found some evidence to suggest that this particular error code could be argued to be mandated by POSIX, though that clearly doesn't stop Bash trying to be more helpful. I'm inclined to say that's not a bug, but reasonable people could differ.
Now, all the above assumes that, like me, you don't have cscope installed. I think that's unlikely. If I install cscope, so it's lower down the PATH than the directory t.sh adds, then I get a difference in behavior between my system's /usr/bin/make, which
is 4.3, and my shiny latest Make from git, which does this:
mad@shuttle:~/tmp/zhao-2024-03-31/makebug$ PATH=$HOME/Downloads/make:$PATH ./t.sh
cscope: version 15.9
mad@shuttle:~/tmp/zhao-2024-03-31/makebug$
I suggest that's the bug to which, if I understood it correctly, bug 62200 was duped:
https://savannah.gnu.org/bugs/?57962: make attempts to execute a directory found on PATH
... so perhaps the most useful answer is that it likely is a bug, one that you could, I think, get a fix for by upgrading to the since-released Gnu Make 4.4. I see that Debian, for example, hasn't packaged 4.4 even in "unstable", per
https://packages.debian.org/sid/make, so it would perhaps be easier to get a backdoored xz 🙂. Well, I just downloaded the Gnu release tarball of Make 4.4.1, which built out of the box for me with nothing
more than ./configure && make on Debian Buster and Bullseye. That worked, as did 4.4 vanilla. Perhaps it's already documented in one of the above bugs but I accidentally found that this behavior was a regression between 4.2.1 and 4.3, so between Buster and
Bullseye.
Sorry that this reply is somewhat rambling, but, although you did submit a nice small example, for which thanks, you didn't indicate which version you're running. Perhaps it should have been obvious to me that you would have had cscope installed, but I didn't
think to try that until I'd had another coffee.
From: bug-make-bounces+martin.dorey=hds.com@gnu.org <bug-make-bounces+martin.dorey=hds.com@gnu.org> on behalf of Bill Zhao <szbzhao@gmail.com>
Sent: Sunday, March 31, 2024 03:24 To: bug-make@gnu.org <bug-make@gnu.org> Subject: ---Please check it is a bug or not? ***** EXTERNAL EMAIL *****
Please run the t.sh script in the tarball in the attachement as ./t.sh
it will give the error info like:
make: cscope: Permission denied make: *** [Makefile:4: all] Error 127
is it a bug or not?
I know how to bypass this issue, which has cause me my Linux sdk compiling to go to error
Cheers! to all
|
[Prev in Thread] | Current Thread | [Next in Thread] |