Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-06 Thread Corinna Vinschen
On Mar 6 03:42, Takashi Yano wrote: > On Tue, 5 Mar 2024 17:54:19 +0100 > Corinna Vinschen wrote: > > On Mar 5 23:47, Takashi Yano wrote: > > > On Tue, 5 Mar 2024 11:14:46 +0100 > > > Corinna Vinschen wrote: > > > > This doesn't affect your patch, but while looking into this, what > > > > strikes

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Takashi Yano
On Wed, 6 Mar 2024 03:42:23 +0900 Takashi Yano wrote: > + name.MaximumLength = MAX_PATH * sizeof (WCHAR); This should be: name.MaximumLength = sizeof (pipename_buf); -- Takashi Yano

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Takashi Yano
On Tue, 5 Mar 2024 17:54:19 +0100 Corinna Vinschen wrote: > On Mar 5 23:47, Takashi Yano wrote: > > On Tue, 5 Mar 2024 11:14:46 +0100 > > Corinna Vinschen wrote: > > > This doesn't affect your patch, but while looking into this, what > > > strikes me as weird is that fhandler_pipe::temporary_query

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Corinna Vinschen
On Mar 5 23:47, Takashi Yano wrote: > On Tue, 5 Mar 2024 11:14:46 +0100 > Corinna Vinschen wrote: > > This doesn't affect your patch, but while looking into this, what > > strikes me as weird is that fhandler_pipe::temporary_query_hdl() calls > > NtQueryObject() and assembles the pipe name via sws

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Takashi Yano
On Tue, 5 Mar 2024 11:14:46 +0100 Corinna Vinschen wrote: > On Mar 5 09:06, Takashi Yano wrote: > > On Mon, 4 Mar 2024 18:38:07 +0100 > > Corinna Vinschen wrote: > > > On Mar 4 16:45, ASSI wrote: > > > > Corinna Vinschen writes: > > > > > Right you are. We always said that independent Cygwin ins

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-05 Thread Corinna Vinschen
On Mar 5 09:06, Takashi Yano wrote: > On Mon, 4 Mar 2024 18:38:07 +0100 > Corinna Vinschen wrote: > > On Mar 4 16:45, ASSI wrote: > > > Corinna Vinschen writes: > > > > Right you are. We always said that independent Cygwin installations > > > > are supposed to *stay* independent. > > > > > > > >

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-04 Thread Takashi Yano
On Mon, 4 Mar 2024 18:38:07 +0100 Corinna Vinschen wrote: > On Mar 4 16:45, ASSI wrote: > > Corinna Vinschen writes: > > > Right you are. We always said that independent Cygwin installations > > > are supposed to *stay* independent. > > > > > > Keep in mind that they don't share the same shared o

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-04 Thread Corinna Vinschen
On Mar 4 16:45, ASSI wrote: > Corinna Vinschen writes: > > Right you are. We always said that independent Cygwin installations > > are supposed to *stay* independent. > > > > Keep in mind that they don't share the same shared objects in the native > > NT namespace and they don't know of each othe

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-04 Thread ASSI
Corinna Vinschen writes: > Right you are. We always said that independent Cygwin installations > are supposed to *stay* independent. > > Keep in mind that they don't share the same shared objects in the native > NT namespace and they don't know of each other. It's not only the > process table but

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-04 Thread Corinna Vinschen
On Mar 3 20:36, Takashi Yano wrote: > On Sun, 03 Mar 2024 11:39:40 +0100 > ASSI wrote: > > Takashi Yano writes: > > >> After noticing that we enumerate all the processes (which is an expensive > > >> operation) just to skip all of the non-Cygwin ones anyway, I wonder if it > > >> wouldn't be smart

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
On Sun, 03 Mar 2024 11:39:40 +0100 ASSI wrote: > Takashi Yano writes: > >> After noticing that we enumerate all the processes (which is an expensive > >> operation) just to skip all of the non-Cygwin ones anyway, I wonder if it > >> wouldn't be smarter to go through the internal list of cygpids and

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread ASSI
Takashi Yano writes: >> After noticing that we enumerate all the processes (which is an expensive >> operation) just to skip all of the non-Cygwin ones anyway, I wonder if it >> wouldn't be smarter to go through the internal list of cygpids and take it >> from there, skipping the `SystemProcessInfo

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Takashi Yano
On Sun, 3 Mar 2024 10:34:44 +0100 (CET) Johannes Schindelin wrote: > Hi Takashi, > > thank you for the fix! I can confirm that it addresses the problem > demonstrated by the reproducer in that MSYS2-runtime ticket. Thanks for testing! > After noticing that we enumerate all the processes (which i

Re: [PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-03 Thread Johannes Schindelin
Hi Takashi, thank you for the fix! I can confirm that it addresses the problem demonstrated by the reproducer in that MSYS2-runtime ticket. After noticing that we enumerate all the processes (which is an expensive operation) just to skip all of the non-Cygwin ones anyway, I wonder if it wouldn't

[PATCH] Cygwin: pipe: Give up to use query_hdl for non-cygwin apps.

2024-03-02 Thread Takashi Yano
Non-cygwin app may call ReadFile() which makes NtQueryObject() for ObjectNameInformation block in fhandler_pipe::get_query_hdl_per_process. Therefore, stop to try to get query_hdl for non-cygwin apps. Addresses: https://github.com/msys2/msys2-runtime/issues/202 Fixes: b531d6b06eeb ("Cygwin: pipe: