public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* open /dev/null O_NOFOLLOW fails with ELOOP
@ 2022-12-21 11:15 gs-cygwin.com
  2022-12-21 11:31 ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: gs-cygwin.com @ 2022-12-21 11:15 UTC (permalink / raw)
  To: cygwin

open /dev/null O_NOFOLLOW fails with ELOOP

Windows 10, 64-bit cygwin

Failed with my existing install, then I ran setup.exe, updated to
latest, and my tests still failed.

a.c
---

#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>

int main (void)
{
    int fd = open("/dev/null", O_RDWR | O_NOFOLLOW, 0);
    if (fd < 0)
        perror("open(/dev/null)");
    return fd;
}


$ gcc a.c ; ./a.exe
open(/dev/null): Too many levels of symbolic links

While troubleshooting this, there were times where it succeeded and then
times where it failed, though it failed most of the time.  It did not
fail (or succeed) randomly, but seemingly in streaks.

Trying to start lighttpd seems to run into this bug reliably,
  $ /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
In the next release of lighttpd, I may end up omitting O_NOFOLLOW
if __CYGWIN__ is defined.

Cheers, Glenn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: open /dev/null O_NOFOLLOW fails with ELOOP
  2022-12-21 11:15 open /dev/null O_NOFOLLOW fails with ELOOP gs-cygwin.com
@ 2022-12-21 11:31 ` Corinna Vinschen
  2022-12-21 14:29   ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2022-12-21 11:31 UTC (permalink / raw)
  To: cygwin

Hi Glenn,

On Dec 21 06:15, gs-cygwin.com--- via Cygwin wrote:
> open /dev/null O_NOFOLLOW fails with ELOOP
> 
> Windows 10, 64-bit cygwin
> 
> Failed with my existing install, then I ran setup.exe, updated to
> latest, and my tests still failed.
> 
> a.c
> ---
> 
> #include <sys/types.h>
> #include <fcntl.h>
> #include <stdio.h>
> 
> int main (void)
> {
>     int fd = open("/dev/null", O_RDWR | O_NOFOLLOW, 0);
>     if (fd < 0)
>         perror("open(/dev/null)");
>     return fd;
> }
> 
> 
> $ gcc a.c ; ./a.exe
> open(/dev/null): Too many levels of symbolic links
> 
> While troubleshooting this, there were times where it succeeded and then
> times where it failed, though it failed most of the time.  It did not
> fail (or succeed) randomly, but seemingly in streaks.
> 
> Trying to start lighttpd seems to run into this bug reliably,
>   $ /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
> In the next release of lighttpd, I may end up omitting O_NOFOLLOW
> if __CYGWIN__ is defined.

Thanks for the report.  I think I see what's going on, stay tuned.


Thanks,
Corinna

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: open /dev/null O_NOFOLLOW fails with ELOOP
  2022-12-21 11:31 ` Corinna Vinschen
@ 2022-12-21 14:29   ` Corinna Vinschen
  2022-12-21 19:32     ` gs-cygwin.com
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2022-12-21 14:29 UTC (permalink / raw)
  To: cygwin

Hi Glenn,

On Dec 21 12:31, Corinna Vinschen via Cygwin wrote:
> On Dec 21 06:15, gs-cygwin.com--- via Cygwin wrote:
> > open /dev/null O_NOFOLLOW fails with ELOOP
> > 
> > Windows 10, 64-bit cygwin
> > 
> > Failed with my existing install, then I ran setup.exe, updated to
> > latest, and my tests still failed.
> > 
> > a.c
> > ---
> > 
> > #include <sys/types.h>
> > #include <fcntl.h>
> > #include <stdio.h>
> > 
> > int main (void)
> > {
> >     int fd = open("/dev/null", O_RDWR | O_NOFOLLOW, 0);
> >     if (fd < 0)
> >         perror("open(/dev/null)");
> >     return fd;
> > }
> > 
> > 
> > $ gcc a.c ; ./a.exe
> > open(/dev/null): Too many levels of symbolic links
> > 
> > While troubleshooting this, there were times where it succeeded and then
> > times where it failed, though it failed most of the time.  It did not
> > fail (or succeed) randomly, but seemingly in streaks.
> > 
> > Trying to start lighttpd seems to run into this bug reliably,
> >   $ /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
> > In the next release of lighttpd, I may end up omitting O_NOFOLLOW
> > if __CYGWIN__ is defined.
> 
> Thanks for the report.  I think I see what's going on, stay tuned.

I pushed a patch:
https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=09cb4cd2940f

Please try the latest test release cygwin-3.5.0-0.60.g09cb4cd2940f.
For installation, see https://cygwin.com/faq.html#faq.setup.testrels


Thanks,
Corinna

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: open /dev/null O_NOFOLLOW fails with ELOOP
  2022-12-21 14:29   ` Corinna Vinschen
@ 2022-12-21 19:32     ` gs-cygwin.com
  2022-12-21 21:09       ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: gs-cygwin.com @ 2022-12-21 19:32 UTC (permalink / raw)
  To: Corinna Vinschen via Cygwin

On Wed, Dec 21, 2022 at 03:29:42PM +0100, Corinna Vinschen via Cygwin wrote:
> Hi Glenn,
> 
> On Dec 21 12:31, Corinna Vinschen via Cygwin wrote:
> > On Dec 21 06:15, gs-cygwin.com--- via Cygwin wrote:
> > > open /dev/null O_NOFOLLOW fails with ELOOP
> > > 
> > > Windows 10, 64-bit cygwin
> > > 
> > > Failed with my existing install, then I ran setup.exe, updated to
> > > latest, and my tests still failed.
> > > 
> > > a.c
> > > ---
> > > 
> > > #include <sys/types.h>
> > > #include <fcntl.h>
> > > #include <stdio.h>
> > > 
> > > int main (void)
> > > {
> > >     int fd = open("/dev/null", O_RDWR | O_NOFOLLOW, 0);
> > >     if (fd < 0)
> > >         perror("open(/dev/null)");
> > >     return fd;
> > > }
> > > 
> > > 
> > > $ gcc a.c ; ./a.exe
> > > open(/dev/null): Too many levels of symbolic links
> > > 
> > > While troubleshooting this, there were times where it succeeded and then
> > > times where it failed, though it failed most of the time.  It did not
> > > fail (or succeed) randomly, but seemingly in streaks.
> > > 
> > > Trying to start lighttpd seems to run into this bug reliably,
> > >   $ /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
> > > In the next release of lighttpd, I may end up omitting O_NOFOLLOW
> > > if __CYGWIN__ is defined.
> > 
> > Thanks for the report.  I think I see what's going on, stay tuned.
> 
> I pushed a patch:
> https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=09cb4cd2940f
> 
> Please try the latest test release cygwin-3.5.0-0.60.g09cb4cd2940f.
> For installation, see https://cygwin.com/faq.html#faq.setup.testrels
> 
> 
> Thanks,
> Corinna

cygwin-3.5.0-0.60.g09cb4cd2940f works for my test case and for lighttpd.
I was unable to reproduce the problem after (somewhat limited) testing
with the test version.

When I reverted back to 3.4.3-1, I was immediately able to reproduce the
issue with 3.4.3-1.

Thank you!  Happy Holidays!
Cheers, Glenn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: open /dev/null O_NOFOLLOW fails with ELOOP
  2022-12-21 19:32     ` gs-cygwin.com
@ 2022-12-21 21:09       ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2022-12-21 21:09 UTC (permalink / raw)
  To: cygwin

On Dec 21 14:32, gs-cygwin.com--- via Cygwin wrote:
> On Wed, Dec 21, 2022 at 03:29:42PM +0100, Corinna Vinschen via Cygwin wrote:
> > Hi Glenn,
> > 
> > On Dec 21 12:31, Corinna Vinschen via Cygwin wrote:
> > > On Dec 21 06:15, gs-cygwin.com--- via Cygwin wrote:
> > > > open /dev/null O_NOFOLLOW fails with ELOOP
> > > > [...]
> > > 
> > > Thanks for the report.  I think I see what's going on, stay tuned.
> > 
> > I pushed a patch:
> > https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=09cb4cd2940f
> > 
> > Please try the latest test release cygwin-3.5.0-0.60.g09cb4cd2940f.
> > For installation, see https://cygwin.com/faq.html#faq.setup.testrels
> > 
> > 
> > Thanks,
> > Corinna
> 
> cygwin-3.5.0-0.60.g09cb4cd2940f works for my test case and for lighttpd.
> I was unable to reproduce the problem after (somewhat limited) testing
> with the test version.
> 
> When I reverted back to 3.4.3-1, I was immediately able to reproduce the
> issue with 3.4.3-1.
> 
> Thank you!  Happy Holidays!

Thanks for testing and same to you!

Corinna

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-21 21:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 11:15 open /dev/null O_NOFOLLOW fails with ELOOP gs-cygwin.com
2022-12-21 11:31 ` Corinna Vinschen
2022-12-21 14:29   ` Corinna Vinschen
2022-12-21 19:32     ` gs-cygwin.com
2022-12-21 21:09       ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).