On 5/18/2020 1:36 AM, Takashi Yano via Cygwin-patches wrote:
On Mon, 18 May 2020 14:25:19 +0900
Takashi Yano via Cygwin-patches wrote:
However, mc hangs by several operations.
To reproduce this:
1. Start mc with 'env SHELL=tcsh mc -a'
I mean 'env SHELL=/bin/tcsh mc -a'
2. Select a file
Hi Takashi,
On 5/18/2020 12:03 PM, Ken Brown via Cygwin-patches wrote:
On 5/18/2020 1:36 AM, Takashi Yano via Cygwin-patches wrote:
On Mon, 18 May 2020 14:25:19 +0900
Takashi Yano via Cygwin-patches wrote:
However, mc hangs by several operations.
To reproduce this:
1. Start mc with 'env
On 5/19/2020 2:15 AM, Takashi Yano via Cygwin-patches wrote:
On Tue, 19 May 2020 10:26:09 +0900
Takashi Yano via Cygwin-patches wrote:
Hi Ken,
On Mon, 18 May 2020 13:42:19 -0400
Ken Brown via Cygwin-patches wrote:
Hi Takashi,
On 5/18/2020 12:03 PM, Ken Brown via Cygwin-patches wrote:
On 5
There's no reason to check for errors when we set read_ready or
write_ready. We don't do that for other events.
---
winsup/cygwin/fhandler.h | 1 -
winsup/cygwin/fhandler_fifo.cc | 34 +++---
2 files changed, 3 insertions(+), 32 deletions(-)
diff --git
This is in a new shared memory section. We will use it for temporary
storage of the owner's fc_handler list when we need to change owner.
The new owner can then duplicate the pipe handles from that list
before taking ownership.
Add several shared data members and methods that are needed for the
Add data and methods to the shared memory that keep track of the
number of open readers.
Increment this number in open, dup, fork, and exec. Decrement it in
close. Reset read_ready if there are no readers left.
---
winsup/cygwin/fhandler.h | 8
winsup/cygwin/fhandler_fifo.cc |
- Make read_ready a manual-reset event.
- Signal read_ready in open instead of in the listen_client_thread.
- Don't reset read_ready when the listen_client thread terminates;
instead do it in close().
- Rearrange open and change its error handling.
- Add a wait_open_pipe method that waits
Always return 0; no one is doing anything with the return value
anyway.
Remove the return value from stop_listen_client.
Make the connection event auto-reset, so that we don't have to reset
it later.
Simplify the process of connecting a bogus client when thread
termination is signaled.
Make
Replace CloseHandle by NtClose since all handles are created by NT
functions.
---
winsup/cygwin/fhandler_fifo.cc | 32
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index
Although we can have multiple readers open because of dup/fork/exec,
the current code does not support multiple readers opening a FIFO by
explicitly calling 'open'.
The main complication in supporting this is that when a blocking
reader tries to open and there's already one open, it has to check
According to Posix, a FIFO open for reading is at EOF if it is empty
and there are no writers open.
The only way to test this is to poll the fifo_client_handlers as in
raw_read and select.cc:peek_fifo. The current hit_eof instead relies
on the value of nconnected, which can be out of date. On
If fixup_after_exec is called on a non-close-on-exec reader whose
parent is the owner, transfer ownership to the child. Otherwise the
parent's pipe handles will be closed before any other reader can
duplicate them.
To help with this, make the cancel_evt and thr_sync_evt handles
inheritable, so
If the owning reader is closing, wait for another reader (if there is
one) to take ownership before closing the owner's pipe handles.
To synchronize the ownership transfer, add events owner_needed_evt and
owner_found_evt, and add methods owner_needed and owner_found to
set/reset them.
Modify the
This will simplify future work.
Rename the thread from "listen_client_thread" to "fifo_reader_thread"
because it will be used for more than just listening.
Remove the fixup_before stuff, which won't be needed after future
changes to fixup_after_fork and fixup_after_exec.
---
Also improve the error handling.
---
winsup/cygwin/fhandler_fifo.cc | 60 +++---
1 file changed, 33 insertions(+), 27 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 44919c19e..f61e2fe72 100644
---
There can be deadlocks if the child starts with its fifo_client_lock
in the locked state.
---
winsup/cygwin/fhandler_fifo.cc | 31 +++
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index
Make the values correspond to the possible return values of
fifo_client_handler::pipe_state().
When cleaning up the fc_handler list in listen_client_thread(), don't
delete handlers in the fc_closing state. I think the pipe might still
have input to be read in that case.
Set the state to
Replace the 'fhandler_base *' member by a HANDLE to the server side of
the Windows named pipe instance. Make the corresponding
simplifications throughout.
---
winsup/cygwin/fhandler.h | 19 +++---
winsup/cygwin/fhandler_fifo.cc | 65 --
2 files changed,
Make fc_handler a pointer to malloc'd memory instead of a fixed-size
array. The size is now a new data member 'shandlers'. Call realloc
in add_client_handler if we need to grow the array.
free fc_handler in close. As long as we're touching that code, also
remove an unneeded lock.
---
This project began as a an attempt to allow a FIFO to be opened
multiple times for reading. The initial motivation was that Midnight
Commander running under tcsh does this (unsuccessfully on Cygwin).
See
https://sourceware.org/pipermail/cygwin/2019-December/243317.html
It quickly became
Even though we currently allow a FIFO to be opened for reading only
once, we can still have more than one reader open because of dup and
fork. Add a named shared memory section accessible to all readers of
a given FIFO. In future commits we will add information needed by all
readers to this
Add a take_ownership method, used by raw_read and select.cc:peek_fifo.
It wakes up all fifo_reader_threads and allows the caller to become
owner. The work is done by the fifo_reader_threads.
For synchronization we introduce several new fhandler_fifo data
members and methods:
- update_needed_evt
This uniquely identifies an fhandler_fifo open for reading in any
process.
Add a new data member 'me' of this type, which is set in open, dup,
fork, and exec.
---
winsup/cygwin/fhandler.h | 23 +++
winsup/cygwin/fhandler_fifo.cc | 9 -
2 files changed, 31
Among all the open readers of a FIFO, one is declared to be the owner.
This is the only reader that listens for client connections, and it is
the only one that has an accurate fc_handler list.
Add shared data and methods for getting and setting the owner, as well
as a lock to prevent more than
The beginning of fhandler_fifo.cc contains a long comment giving an
overview of the FIFO implementation. This is now updated to describe
the support for multiple readers.
---
winsup/cygwin/fhandler_fifo.cc | 58 --
1 file changed, 35 insertions(+), 23 deletions(-)
On 5/19/2020 8:51 AM, Ken Brown via Cygwin-patches wrote:
On 5/19/2020 2:15 AM, Takashi Yano via Cygwin-patches wrote:
On Tue, 19 May 2020 10:26:09 +0900
Takashi Yano via Cygwin-patches wrote:
Hi Ken,
On Mon, 18 May 2020 13:42:19 -0400
Ken Brown via Cygwin-patches wrote:
Hi Takashi,
On 5
Hi Takashi,
On 5/19/2020 7:35 AM, Takashi Yano via Cygwin-patches wrote:
- Current pty cannot show system_printf() output after closing pty
slave. This patch fixes the issue.
Sorry to be returning the favor so soon, but this patch causes 'make check' in
the texinfo source tree to hang. I
On 5/19/2020 10:07 AM, Takashi Yano wrote:
On Tue, 19 May 2020 09:37:17 -0400
Ken Brown via Cygwin-patches wrote:
On 5/19/2020 8:51 AM, Ken Brown via Cygwin-patches wrote:
On 5/19/2020 2:15 AM, Takashi Yano via Cygwin-patches wrote:
On Tue, 19 May 2020 10:26:09 +0900
Takashi Yano via Cygwin
On 5/21/2020 4:25 AM, Takashi Yano via Cygwin-patches wrote:
- After commit 0365031ce1347600d854a23f30f1355745a1765c, the issue
https://cygwin.com/pipermail/cygwin-patches/2020q2/010259.html
occurs. This patch fixes the issue.
Thanks. I can confirm that it's fixed.
Ken
This fixes the assertion failure reported here:
https://sourceware.org/pipermail/cygwin/2020-September/246160.html
with a simple test case here:
https://sourceware.org/pipermail/cygwin/2020-September/246188.html
That test case now fails as follows, as on Linux:
$ ./proc_bug.exe
open: Not
The incoming path is allowed to have the form "$PID/fd/[0-9]*/.*"
provided the descriptor symlink points to a directory. Check that
this is indeed the case.
---
winsup/cygwin/fhandler_process.cc | 15 +++
1 file changed, 15 insertions(+)
diff --git
fhandler_process::exists is called when we are checking a path
starting with "/proc//fd". If it returns virt_none and sets an
errno, there is no need for further checking. Just set 'error' and
return.
---
winsup/cygwin/path.cc | 6 ++
1 file changed, 6 insertions(+)
diff --git
On 9/8/2020 12:50 PM, Ken Brown via Cygwin-patches wrote:
fhandler_process::exists is called when we are checking a path
starting with "/proc//fd". If it returns virt_none and sets an
errno, there is no need for further checking. Just set 'error' and
return.
---
winsup/cygwin/p
On 9/8/2020 3:02 PM, Ken Brown via Cygwin-patches wrote:
fhandler_process::exists is called when we are checking a path
starting with "/proc//fd". If it returns virt_none and sets an
errno, there is no need for further checking. Just set 'error' and
return.
---
winsup/cygwin/p
fhandler_process::exists is called when we are checking a path
starting with "/proc//fd". If it returns virt_none and sets an
errno, there is no need for further checking. Just set 'error' and
return.
---
winsup/cygwin/path.cc | 9 +
1 file changed, 9 insertions(+)
diff --git
On 10/4/2020 12:49 PM, Ken Brown via Cygwin-patches wrote:
I'm about to push these. Corinna, please check them when you return.
The only difference between v2 and v1 is that there are a few more
fixes.
I'm trying to help get the AF_UNIX development going again. I'm
mostly working on the topic
I'm about to push these. Corinna, please check them when you return.
The only difference between v2 and v1 is that there are a few more
fixes.
I'm trying to help get the AF_UNIX development going again. I'm
mostly working on the topic/af_unix branch. But when I find bugs that
exist on master,
If __WITH_AF_UNIX is defined when Cygwin is built, then a named
AF_UNIX socket is represented by a reparse point with a
Cygwin-specific tag and GUID. Make such files recognizable as reparse
points (but not as sockets) even if __WITH_AF_UNIX is not defined.
That way utilities such as 'ls' and 'rm'
Commit aa467e6e, "Cygwin: add AF_UNIX reparse points to path
handling", changed check_reparse_point_target so that it could return
a positive value on a known reparse point that is not a symlink. But
some of the code in check_reparse_point that handles this positive
return value was executed
The following Windows system calls currently fail with
STATUS_IO_REPARSE_TAG_NOT_HANDLED when called on an AF_UNIX socket:
- NtOpenFile in get_file_sd
- NtOpenFile in set_file_sd
- NtCreateFile in fhandler_base::open
Fix this by adding the FILE_OPEN_REPARSE_POINT flag to those calls
when the
A successful connection can be indicated by STATUS_SUCCESS or
STATUS_PIPE_CONNECTED. Previously we were checking only for the
latter.
---
winsup/cygwin/fhandler_socket_unix.cc | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler_socket_unix.cc
---
winsup/cygwin/fhandler_socket_unix.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/winsup/cygwin/fhandler_socket_unix.cc
b/winsup/cygwin/fhandler_socket_unix.cc
index 429aa8a90..0ae7fe125 100644
--- a/winsup/cygwin/fhandler_socket_unix.cc
+++ b/winsup/cygwin/fhandler_socket_unix.cc
@@
If open_pipe is called with xchg_sock_info true, call recv_peer_info
in addition to send_sock_info.
---
winsup/cygwin/fhandler_socket_unix.cc | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_socket_unix.cc
b/winsup/cygwin/fhandler_socket_unix.cc
If MSG_WAITALL is set, recv_internal calls WSARecv or WSARecvFrom in a
loop, in an effort to fill all the scatter-gather buffers. The test
for whether all the buffers are full was previously incorrect.
---
winsup/cygwin/fhandler_socket_inet.cc | 2 +-
winsup/cygwin/fhandler_socket_local.cc | 2
It looks to me like there's been a bug in the MSG_WAITALL support for
AF_INET and AF_LOCAL sockets ever since that support was first
introduced 13 years ago in commit 023a2fa7. If I'm right, MSG_WAITALL
has never worked.
This patch fixes it. I'll push it in a few days if no one sees
anything
On 10/12/2020 2:02 PM, Ken Brown via Cygwin-patches wrote:
It looks to me like there's been a bug in the MSG_WAITALL support for
AF_INET and AF_LOCAL sockets ever since that support was first
introduced 13 years ago in commit 023a2fa7. If I'm right, MSG_WAITALL
has never worked.
This patch
On 10/13/2020 7:28 AM, Corinna Vinschen wrote:
> On Oct 4 12:49, Ken Brown via Cygwin-patches wrote:
>> A successful connection can be indicated by STATUS_SUCCESS or
>> STATUS_PIPE_CONNECTED.
>
> THanks for catching but... huh? How does Windows generate two different
> s
On 10/13/2020 7:49 AM, Corinna Vinschen wrote:
On Oct 8 17:36, Ken Brown via Cygwin-patches wrote:
On 10/4/2020 12:49 PM, Ken Brown via Cygwin-patches wrote:
I'm about to push these. Corinna, please check them when you return.
The only difference between v2 and v1 is that there are a few
This is necessary in order to be consistent with the following comment
in the definition of _Unwind_RaiseException() in the GCC source file
libgcc/unwind-seh.c:
The exception handler installed in crt0 will continue any GCC
exception that reaches there (and isn't marked non-continuable).
---
winsup/cygwin/sigproc.cc | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 2a9734f00..47352c213 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -44,7 +44,11 @@ char NO_COPY
On 8/20/2020 10:06 AM, Corinna Vinschen wrote:
Wouldn't it make sense to create a header defining the GCC status values
as in libgcc/unwind-seh.c and share this between exceptions.cc and
strace.cc?
Yes, thanks for the suggestion. New patch(es) on the way. I called the header
"gcc_seh.h".
Any C++ app that calls 'throw' on 64-bit Cygwin results in an
exception of type STATUS_GCC_THROW (0x20474343) generated by the C++
runtime. Don't pollute the strace output by printing information
about this and other GCC exceptions.
---
winsup/utils/strace.cc | 7 +++
1 file changed, 7
Include it in exceptions.cc instead of defining the exception codes
there.
---
winsup/cygwin/exceptions.cc | 10 +-
winsup/cygwin/gcc_seh.h | 19 +++
2 files changed, 20 insertions(+), 9 deletions(-)
create mode 100644 winsup/cygwin/gcc_seh.h
diff --git
Ken Brown (2):
Cygwin: add header defining GCC exception codes
Cygwin: strace: ignore GCC exceptions
winsup/cygwin/exceptions.cc | 10 +-
winsup/cygwin/gcc_seh.h | 19 +++
winsup/utils/strace.cc | 8
3 files changed, 28 insertions(+), 9 deletions(-)
Any C++ app that calls 'throw' on 64-bit Cygwin results in an
exception of type STATUS_GCC_THROW (0x20474343) generated by the C++
runtime. Don't pollute the strace output by printing information
about this and other GCC exceptions.
---
winsup/utils/strace.cc | 8
1 file changed, 8
Delete a client handler by swapping it with the last one in the list
instead of calling memmove.
---
winsup/cygwin/fhandler_fifo.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index b3c4c4a25..75c8406fe
nprocs is the number of children, not the number of deceased children.
The incorrect comment used to apply to a variable nzombies. The
latter was removed in commit 8cb359d9 in 2004, but the comment was
never updated.
---
winsup/cygwin/sigproc.cc | 2 +-
1 file changed, 1 insertion(+), 1
Set errno = 0 at the beginning so that the debug_printf call at the
end doesn't report a nonzero errno left over from some other function
call.
---
winsup/cygwin/path.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index f3b9913bd..95faf8ca7
If __WITH_AF_UNIX is defined when Cygwin is built, then a named
AF_UNIX socket is represented by a reparse point with a
Cygwin-specific tag and GUID. Make such files recognizable as reparse
points (but not as sockets) even if __WITH_AF_UNIX is not defined.
That way utilities such as 'ls' and 'rm'
Commit aa467e6e, "Cygwin: add AF_UNIX reparse points to path
handling", changed check_reparse_point_target so that it could return
a positive value on a known reparse point that is not a symlink. But
some of the code in check_reparse_point that handles this positive
return value was executed
There are two Windows system calls that currently fail with
STATUS_IO_REPARSE_TAG_NOT_HANDLED when called on an AF_UNIX socket: a
call to NtOpenFile in get_file_sd and a call to NtCreateFile in
fhandler_base::open.
Fix this by adding the FILE_OPEN_REPARSE_POINT flag to those calls
when the file
I'll push these in a few days if no one sees anything wrong. Corinna,
please check them when you return.
Ken Brown (3):
Cygwin: AF_UNIX: use FILE_OPEN_REPARSE_POINT when needed
Cygwin: fix handling of known reparse points that are not symlinks
Cygwin: always recognize AF_UNIX sockets as
On 9/21/2020 3:25 PM, Jon Turney wrote:
Jon Turney (3):
Cygwin: avoid GCC 10 error with -Werror=parentheses
Cygwin: avoid GCC 10 error with -Werror=narrowing
Cygwin: avoid GCC 10 error with -Werror=narrowing
winsup/cygwin/fhandler_console.cc | 4 ++--
This was added as a temporary measure in commit e18f7f99 because it
wasn't yet in the mingw-w64 headers. With one exception, it is now in
the current release of the headers (version 8.0.0), so we don't need
it in winlean.h. The exception is that VirtualAlloc2 is only declared
conditionally in ,
On 9/24/2020 10:04 AM, Jon Turney wrote:
On 24/09/2020 00:52, Ken Brown via Cygwin-patches wrote:
This was added as a temporary measure in commit e18f7f99 because it
wasn't yet in the mingw-w64 headers. With one exception, it is now in
the current release of the headers (version 8.0.0), so we
On 9/21/2020 3:22 PM, Jon Turney wrote:
On 18/09/2020 22:17, Ken Brown via Cygwin-patches wrote:
Do you have to run something to regen the docs, FAQ.html, and push to the web
site, or does it run periodically, so I can follow up to the OP and get feed
back from the responder?
No, sorry. I
On 9/18/2020 11:29 AM, Brian Inglis wrote:
On 2020-09-18 05:59, Ken Brown via Cygwin-patches wrote:
On 9/17/2020 10:53 PM, Brian Inglis wrote:
enumerate Vista, 7, 8, 10 progression to be clear, and earliest server 2008;
add 8.1, exclude S mode, add Cygwin32 on ARM, specify 64 bit only AMD
On 9/17/2020 2:51 PM, Brian Inglis wrote:
Add linux-next cpuinfo flags for Intel TSX suspend load address tracking
instructions and AMD Secure Encrypted Virtualization with Encrypted State
---
winsup/cygwin/fhandler_proc.cc | 8
1 file changed, 8 insertions(+)
diff --git
On 9/17/2020 2:29 PM, Brian Inglis wrote:
Based on thread https://cygwin.com/pipermail/cygwin/2020-September/246318.html
enumerate Vista, 7, 8, 10 progression to be clear, and earliest server 2008
---
winsup/doc/faq-what.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff
On 9/17/2020 10:53 PM, Brian Inglis wrote:
enumerate Vista, 7, 8, 10 progression to be clear, and earliest server 2008;
add 8.1, exclude S mode, add Cygwin32 on ARM, specify 64 bit only AMD/Intel
---
winsup/doc/faq-what.xml | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
The return value is now -NaN.
This fixes a bug in the mingw-w64 code that was imported into Cygwin.
The fix is consistent with Posix and Linux. It is also consistent
with the current mingw-w64 code, with one exception: The mingw-w64
code sets errno to EDOM if the input is -NaN, but this appears
Hi Corinna,
On 7/20/2020 2:55 PM, Corinna Vinschen wrote:
From: Corinna Vinschen
It's working on 32 bit OSes only anyway. It even fails on WOW64.
Signed-off-by: Corinna Vinschen
---
Notes:
Hi Ken,
can you please review this patch and check if it doesn't break
your
On 7/20/2020 4:29 PM, Brian Inglis wrote:
On 2020-07-20 09:41, Corinna Vinschen wrote:
Ultimately, I wonder if we really should keep all the 32 bit OS stuff
in. The number of real 32 bit systems (not WOW64) is dwindling fast.
Keeping all the AT_ROUND_TO_PAGE stuff in just for what? 2%? of the
Define the pseudo keyword 'fallthrough' in woutsup.h to support this.
---
winsup/cygserver/Makefile.in | 2 +-
winsup/cygserver/bsd_helper.cc | 2 +-
winsup/cygserver/bsd_mutex.cc | 2 +-
winsup/cygserver/woutsup.h | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)
diff --git
Add some missing locks and remove one extra unlock. Clarify for some
functions whether caller or callee acquires lock, and add appropriate
comments.
---
winsup/cygwin/fhandler_fifo.cc | 23 +--
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git
fhandler_fifo::take_ownership() tacitly assumes that the current
owner's fifo_reader_thread will be woken up from WFMO when
update_needed_evt is signaled. But it's possible that the the current
owner's fifo_reader_thread is at the beginning of its main loop rather
than in its WFMO call when that
The second patch in this series fixes a serious bug that has resulted
in observable hangs. The other patches are minor bug fixes or minor
performance improvements.
Ken Brown (8):
Cygwin: FIFO: lock fixes
Cygwin: FIFO: fix timing issue with owner change
Cygwin: FIFO: add a timeout to
Don't try to read from fifo_client_handlers that are in the fc_closing
state. Experiments have shown that this always yields
STATUS_PIPE_BROKEN, so it just wastes a Windows system call.
Re-order the values in enum fifo_client_connect_state to reflect the
new status of fc_closing.
---
Rename the existing set_state() to query_and_set_state() to reflect
what it really does. (It queries the O/S for the pipe state.) Add a
new set_state() method, which is a standard setter, and a
corresponding getter get_state().
---
winsup/cygwin/fhandler.h | 9 --
fhandler_fifo::take_ownership() is called from select.cc::peek_fifo
and fhandler_fifo::raw_read and could potentially block indefinitely
if something goes wrong. This is always undesirable in peek_fifo, and
it is undesirable in a nonblocking read. Fix this by adding a timeout
parameter to
The fifo_reader thread function and the function select.cc:peek_fifo()
can both change the state of a fifo_client_handler. These changes are
made under fifo_client_lock, so there is no race, but the changes can
still be incompatible.
Add code to make sure that only one of these functions can
Currently raw_read makes two passes through the list of clients. On
the first pass it tries to read from the client from which it last
read successfully. On the second pass it tries to read from all
connected clients.
Add a new pass in between these two, in which raw_read tries to read
from all
---
winsup/cygwin/fhandler_fifo.cc | 96 +-
1 file changed, 48 insertions(+), 48 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 2b829eb6c..017d44e54 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++
On 7/6/2020 3:50 PM, Corinna Vinschen wrote:
Hi guys,
Do you have anything in the loop which should go into 3.1.6?
Given https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=bb96bd0,
I'd like to release 3.1.6 this week.
I'm working on some FIFO fixes, but it could be another week
On 6/3/2020 9:43 PM, Takashi Yano via Cygwin-patches wrote:
- Commit c4b060e3fe3bed05b3a69ccbcc20993ad85e163d seems to be not
enough. Moreover, it does not work as expected at all in Win10
1809. This patch essentially reverts that commit and add another
fix. After all, the cause of the
Use cygwait in take_ownership to allow interruption while waiting to
become owner. Return the cygwait return value or a suitable value to
indicate an error.
raw_read now checks the return value and acts accordingly.
---
winsup/cygwin/fhandler.h | 2 +-
winsup/cygwin/fhandler_fifo.cc | 54
---
winsup/cygwin/fhandler_fifo.cc | 21 +
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 30486304f..e9d0187d4 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
When a reader takes ownership in fifo_reader_thread, it now goes
directly to the part of the main loop that listens for a connection.
Previously it went back to the beginning of the loop.
Also, if the reader has to delay taking ownership because the previous
owner has not finished updating the
Add a bool member 'last_read' to the fifo_client_handler structure,
which is set to true on a successful read. This is used by raw_read
as follows.
When raw_read is called, it first locates the writer (if any) for
which last_read is true. raw_read tries to read from that writer and
returns if
If update_my_handlers fails to duplicate one or more handles, just
mark the corresponding handlers as being in an error state.
But if update_my_handlers is unable to open the process of the
previous owner, it's likely that something serious has gone wrong, so
we continue to make that a fatal
When the owning reader closes and there are still readers open, the
owner needs to wait for a new owner to be found before closing its
fifo_client handlers. This involves a loop in which dec_nreaders is
called at the beginning and inc_nreaders is called at the end. Any
other reader that tries to
Use the writer count introduced in the previous commit to help detect
EOF. Drop the maybe_eof method, which is no longer needed.
---
winsup/cygwin/fhandler.h | 7 +++
winsup/cygwin/fhandler_fifo.cc | 26 ++
winsup/cygwin/select.cc| 3 +--
3 files
---
winsup/cygwin/fhandler_fifo.cc | 168 -
1 file changed, 84 insertions(+), 84 deletions(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 1fb319fcf..69dda0811 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++
There were several flaws in my previous attempt to add support for
explicitly opening a FIFO multiple times for reading. (By
"explicitly" I mean by calling open rather than by calling
fork/exec/dup.) See
https://sourceware.org/pipermail/cygwin/2020-July/245456.html
for one indication of
---
winsup/cygwin/fhandler_fifo.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 91a276ee9..b6e172ddc 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -422,7 +422,9 @@
When a reader opens, it needs to block if there are no writers open
(unless is is opened with O_NONBLOCK). This is easy for the first
reader to test, since it can just wait for a writer to signal that it
is open (via the write_ready event). But when a second reader wants
to open, all writers
Don't set update_needed_evt if there's currently no owner. This will
cause unnecessary churn once I'm the owner and am listening for
connections.
---
winsup/cygwin/fhandler_fifo.cc | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/fhandler_fifo.cc
Remove the fhandler_fifo::get_me method, which is no longer used.
Make the methods get_owner, set_owner, owner_lock, and owner_unlock
private.
---
winsup/cygwin/fhandler.h | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/winsup/cygwin/fhandler.h
Commit 605bdcd410384dda6db66b9b8cd19e863702e1bb enabled mapping beyond
EOF in 64 bit environments. But the variable 'orig_len' did not get
rounded up to a multiple of 64K. This rounding was done on 32 bit
only. Fix this by rounding up orig_len on 64 bit, in the same place
where 'len' is rounded
On 7/20/2020 10:23 AM, Corinna Vinschen wrote:
On Jul 20 09:34, Ken Brown via Cygwin-patches wrote:
Commit 605bdcd410384dda6db66b9b8cd19e863702e1bb enabled mapping beyond
EOF in 64 bit environments. But the variable 'orig_len' did not get
rounded up to a multiple of 64K. This rounding
1 - 100 of 157 matches
Mail list logo