GNU bug report logs - #36405
26.2.90; O_PATH problem on some versions of Cygwin

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Thu, 27 Jun 2019 19:29:01 UTC

Severity: normal

Found in version 26.2.90

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36405 in the body.
You can then email your comments to 36405 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Thu, 27 Jun 2019 19:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ken Brown <kbrown <at> cornell.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 27 Jun 2019 19:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Thu, 27 Jun 2019 19:28:48 +0000
[Message part 1 (text/plain, inline)]
Cygwin supports the O_PATH flag starting with release 3.0.0, but it is buggy 
until release 3.0.8.  (Opening a FIFO with O_PATH causes a hang.)  The attached 
patches work around this problem.  The first patch (which still has a bug number 
that needs to be filled in) uses incorrect indentation for legibility.  The 
second patch fixes the indentation.

Ken
[0001-Avoid-O_PATH-on-versions-of-Cygwin-where-it-is-buggy.patch (text/plain, attachment)]
[0002-src-dired.c-file_attributes-Fix-indentation.patch (text/plain, attachment)]

Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Thu, 27 Jun 2019 20:48:03 GMT) Full text and rfc822 format available.

Notification sent to Ken Brown <kbrown <at> cornell.edu>:
bug acknowledged by developer. (Thu, 27 Jun 2019 20:48:03 GMT) Full text and rfc822 format available.

Message #10 received at 36405-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: 36405-done <at> debbugs.gnu.org
Subject: Re: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Thu, 27 Jun 2019 13:47:27 -0700
[Message part 1 (text/plain, inline)]
Thanks, but that patch intrudes on the mainline code a bit. It's simpler 
to just disable O_PATH on Cygwin until the old Cygwin versions die out. 
Also, there's a similar issue in fileio.c. I installed the attached, 
which should work around the problem in both source files.
[0001-Work-around-Cygwin-bug-with-O_PATH.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Fri, 28 Jun 2019 06:26:02 GMT) Full text and rfc822 format available.

Message #13 received at 36405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 36405 <at> debbugs.gnu.org, kbrown <at> cornell.edu, eggert <at> cs.ucla.edu
Subject: Re: bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Fri, 28 Jun 2019 09:25:02 +0300
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Thu, 27 Jun 2019 13:47:27 -0700
> Cc: 36405-done <at> debbugs.gnu.org
> 
> Thanks, but that patch intrudes on the mainline code a bit. It's simpler 
> to just disable O_PATH on Cygwin until the old Cygwin versions die out. 

IMO, that's too drastic.  Cygwin 3 is quite new, AFAIK, so it will be
years and years before the old versions die out; no one will remember
this bit by then.

What problems did you see/envision on other platforms with the
original patch?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Fri, 28 Jun 2019 17:58:01 GMT) Full text and rfc822 format available.

Message #16 received at 36405 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 "36405 <at> debbugs.gnu.org" <36405 <at> debbugs.gnu.org>
Subject: Re: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Fri, 28 Jun 2019 17:57:04 +0000
On 6/27/2019 4:47 PM, Paul Eggert wrote:
> --- a/src/fileio.c
> +++ b/src/fileio.c
> @@ -61,6 +61,10 @@ Copyright (C) 1985-1988, 1993-2019 Free Software Foundation, Inc.
>   # include <linux/fs.h>
>   #endif
>   
> +#ifdef __CYGWIN__
> +# undef O_PATH /* Buggy in Cygwin 3.0.0 through 3.0.7.  */
> +#endif

This hunk is not necessary.  The only use of O_PATH in fileio.c is coupled with 
O_DIRECTORY, and this is not affected by the bug.

But, in any case, I agree with Eli's point that your patch is too drastic.  I 
don't see how my patch is intrusive.

Ken

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Sat, 29 Jun 2019 06:22:02 GMT) Full text and rfc822 format available.

Message #19 received at 36405 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 "36405 <at> debbugs.gnu.org" <36405 <at> debbugs.gnu.org>
Subject: Re: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Fri, 28 Jun 2019 23:20:54 -0700
Ken Brown wrote:
> This hunk is not necessary.  The only use of O_PATH in fileio.c is coupled with
> O_DIRECTORY, and this is not affected by the bug.

Thanks, I reverted that part of the change. I'll also follow up to Eli's note.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Sat, 29 Jun 2019 06:27:02 GMT) Full text and rfc822 format available.

Message #22 received at 36405 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 36405 <at> debbugs.gnu.org, kbrown <at> cornell.edu
Subject: Re: bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Fri, 28 Jun 2019 23:26:09 -0700
[Message part 1 (text/plain, inline)]
Eli Zaretskii wrote:
> What problems did you see/envision on other platforms with the
> original patch?

Mainly the hassle of maintaining code with a lot of hard-to-read ifdefs in it. 
It's better if system-specific stuff is kept to a minimum in mainline code. 
Also, this O_PATH stuff is not that high of a priority, as the code works quite 
well in practice without O_PATH. (Also, if Cygwin botched O_PATH on FIFOs 
there's a reasonable chance it botched O_PATH elsewhere too. :-)

How about something like the attached patch instead? It's simpler and should be 
a bit faster on Cygwin than the original patch. I haven't tested it.
[cygwin.diff (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Sat, 29 Jun 2019 07:08:01 GMT) Full text and rfc822 format available.

Message #25 received at 36405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 36405 <at> debbugs.gnu.org, kbrown <at> cornell.edu
Subject: Re: bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Sat, 29 Jun 2019 10:06:49 +0300
> Cc: 36405 <at> debbugs.gnu.org, kbrown <at> cornell.edu
> From: Paul Eggert <eggert <at> cs.ucla.edu>
> Date: Fri, 28 Jun 2019 23:26:09 -0700
> 
> Eli Zaretskii wrote:
> > What problems did you see/envision on other platforms with the
> > original patch?
> 
> Mainly the hassle of maintaining code with a lot of hard-to-read ifdefs in it. 
> It's better if system-specific stuff is kept to a minimum in mainline code. 

I agree, of course.  But in this case we are talking about adding 2
#ifdef's, so the situation is not much worse than it was before.

> Also, this O_PATH stuff is not that high of a priority, as the code works quite 
> well in practice without O_PATH.

It was evidently important enough for us to use it on platforms that
support it.

> How about something like the attached patch instead? It's simpler and should be 
> a bit faster on Cygwin than the original patch. I haven't tested it.

Thanks, this is fine with me if it does the job.  Ken?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Sat, 29 Jun 2019 18:04:01 GMT) Full text and rfc822 format available.

Message #28 received at 36405 <at> debbugs.gnu.org (full text, mbox):

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>, Paul Eggert <eggert <at> cs.ucla.edu>
Cc: "36405 <at> debbugs.gnu.org" <36405 <at> debbugs.gnu.org>
Subject: Re: bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Sat, 29 Jun 2019 18:03:02 +0000
[Message part 1 (text/plain, inline)]
On 6/29/2019 3:06 AM, Eli Zaretskii wrote:
>> Cc: 36405 <at> debbugs.gnu.org, kbrown <at> cornell.edu
>> From: Paul Eggert <eggert <at> cs.ucla.edu>
>> Date: Fri, 28 Jun 2019 23:26:09 -0700
>>
>> Eli Zaretskii wrote:
>>> What problems did you see/envision on other platforms with the
>>> original patch?
>>
>> Mainly the hassle of maintaining code with a lot of hard-to-read ifdefs in it.
>> It's better if system-specific stuff is kept to a minimum in mainline code.
> 
> I agree, of course.  But in this case we are talking about adding 2
> #ifdef's, so the situation is not much worse than it was before.
> 
>> Also, this O_PATH stuff is not that high of a priority, as the code works quite
>> well in practice without O_PATH.
> 
> It was evidently important enough for us to use it on platforms that
> support it.
> 
>> How about something like the attached patch instead? It's simpler and should be
>> a bit faster on Cygwin than the original patch. I haven't tested it.
> 
> Thanks, this is fine with me if it does the job.  Ken?

Fine with me too, after a small tweak.  Revised patch attached.

Thanks, Paul.

Ken
[cygwin1.diff (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36405; Package emacs. (Sat, 29 Jun 2019 18:20:01 GMT) Full text and rfc822 format available.

Message #31 received at 36405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ken Brown <kbrown <at> cornell.edu>
Cc: eggert <at> cs.ucla.edu, 36405 <at> debbugs.gnu.org
Subject: Re: bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Sat, 29 Jun 2019 21:19:11 +0300
> From: Ken Brown <kbrown <at> cornell.edu>
> CC: "36405 <at> debbugs.gnu.org" <36405 <at> debbugs.gnu.org>
> Date: Sat, 29 Jun 2019 18:03:02 +0000
> 
> > Thanks, this is fine with me if it does the job.  Ken?
> 
> Fine with me too, after a small tweak.  Revised patch attached.

Go ahead and push, then.

Thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 28 Jul 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.