Re: Unix Domain Socket Limitation?

2020-12-05 Thread Ken Brown via Cygwin

On 12/4/2020 8:51 AM, Norton Allen wrote:

On 12/3/2020 8:11 PM, Ken Brown wrote:

On 12/2/2020 12:30 PM, Norton Allen wrote:

On 11/30/2020 9:22 PM, Norton Allen wrote:
Yeah, so now the example no longer blocks for me. Unfortunately these bugs 
are not present in my application, so I will need to keep working on this.




After paring the main application down and back up, I finally narrowed in on 
the condition that was causing this blocking behavior. The issue arises when 
a client connect()s twice to the same server with non-blocking unix-domain 
sockets before calling select().


There are a few pieces to this. With the client configured to connect() just 
once, I can see that the server's select() returns as soon as the client 
calls connect(), but then the server's accept() blocks until the client calls 
select(). That is not proper non-blocking behavior, but it appears that the 
implementation under Cygwin does require that client and server both be 
communicating synchronously to accomplish the connect() operation.


I tried running this under Ubuntu 16.04 and found that connect() succeeded 
immediately, so no subsequent select() is required, and there does not appear 
to be a possibility for this collision. That proves to hold true even if the 
server is not waiting in select() to process the connect() with accept().


A workaround for this issue may be to keep the socket blocking until after 
connect().


I have pushed the new minimal example program,  'rapid_connects' to 
https://github.com/nthallen/cygwin_unix


The server is run like before as:

    $ ./rapid_connects server

The client can be run in two different modes. To connect with just one socket:

    $ ./rapid_connects client1

To connect with two:

    $ ./rapid_connects client2

My immediate strategy will be to develop a workaround for my project. Having 
spent a day inside cygwin1.dll, I can see that I have a steep learning curve 
to make much of a contribution there.


I'm traveling at the moment and unable to do any testing, but I wonder if 
you're bumping into an issue that was just discussed on the cygwin-developers 
list:


https://cygwin.com/pipermail/cygwin-developers/2020-December/012015.html

A different workaround is described there.

If it's the same issue, then I don't think it will happen with the new AF_UNIX 
implementation.  More in a few days.



It does seem related.

A work around that is working for me is to do a blocking connect() and switch to 
non-blocking when that completes. In my application, the connect() generally 
occurs once at the beginning of a run, so blocking for a few milliseconds does 
not impact responsiveness.


For the record, I can confirm that (a) the problem occurs with the current 
AF_UNIX implementation and (b) it does not occur with the new implementation (on 
the topic/af_unix branch).  With both client1 and client2, I see "connect() 
apparently succeeded immediately" using the new implementation.


The new implementation is not yet ready for prime time, but with any luck it 
might be ready within a few months.


Ken
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


[ANNOUNCEMENT] Updated: Perl distributions

2020-12-05 Thread Achim Gratz


The following Perl distributions have been updated to their latest
release version available on CPAN:

x86/x86_64
--
perl-DateTime-1.54-1

-- 
  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Updated: Perl distributions

2020-12-05 Thread Achim Gratz


The following Perl distributions have been updated to their latest
release version available on CPAN:

x86/x86_64
--
perl-DateTime-1.54-1

-- 
  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.


[ANNOUNCEMENT] Updated: libarchive-3.5.0-1, mingw64-{x86_64, i686}-libarchive-3.5.0-1

2020-12-05 Thread Achim Gratz


Libarchive has been updated to version 3.5.0-1, the following
(sub-)packages:

libarchive (source)
libarchive-devel
libarchive13
bsdcat
bsdcpio
bsdtar
mingw64-i686-libarchive
mingw64-x86_64-libarchive

are available in the Cygwin distribution.  The MinGW64 packages for
the cross-compilation toolchains have now been updated as well:


CHANGES
Fixes to configure for Cygwin and enabling of ZStd and LZO
compression formats (since version 3.4.3).

DESCRIPTION
Multi-format archive and compression library
It is a portable, efficient C library that can read and write streaming
archives in a variety of formats. It also includes implementations
of the common tar, cpio, and zcat command-line tools that use the
libarchive library.

HOMEPAGE
https://www.libarchive.org/


-- 
  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Updated: libarchive-3.5.0-1, mingw64-{x86_64, i686}-libarchive-3.5.0-1

2020-12-05 Thread Achim Gratz


Libarchive has been updated to version 3.5.0-1, the following
(sub-)packages:

libarchive (source)
libarchive-devel
libarchive13
bsdcat
bsdcpio
bsdtar
mingw64-i686-libarchive
mingw64-x86_64-libarchive

are available in the Cygwin distribution.  The MinGW64 packages for
the cross-compilation toolchains have now been updated as well:


CHANGES
Fixes to configure for Cygwin and enabling of ZStd and LZO
compression formats (since version 3.4.3).

DESCRIPTION
Multi-format archive and compression library
It is a portable, efficient C library that can read and write streaming
archives in a variety of formats. It also includes implementations
of the common tar, cpio, and zcat command-line tools that use the
libarchive library.

HOMEPAGE
https://www.libarchive.org/


-- 
  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.


Re: Environment variable named !:: (exclamation mark + colon + colon)

2020-12-05 Thread Csaba Raduly via Cygwin
On Sat, 5 Dec 2020 at 15:25, tzccinct wrote:
>
> Hi,
>
> I have found an environment variable that has a strange name `!::'
> (exclamation mark + colon + colon) on my terminal (both mintty and Tera
> Term). The value is also strange, `::\' (colon + colon + backslash).
>
> $ env | sort | head -n 3
> !::=::\
> _=/usr/bin/env
> ALLUSERSPROFILE=C:\ProgramData
>

This seems to be related :
https://unix.stackexchange.com/questions/251174/strange-environment-variable-in-cygwin

Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformant way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: ssh to cygwin-box and access remote exe fails saying exe is a directory

2020-12-05 Thread Raj Kumar Sanpui via Cygwin
I feel, i got the answer to the question here:
https://superuser.com/questions/1607551/remote-login-using-ssh-keys-vs-password-weird-error-is-a-directory/1607563

This issue may be marked as close.

On Sat, Dec 5, 2020 at 7:16 PM Raj Kumar Sanpui 
wrote:

> I haven't received any help/suggestions from the forum, but i tried
> digging deeper.
> Now i can see the "Is a directory" error happens if I do passwordless ssh
> (copying my public key using ssh-copy-id) to remote Cygwin box and try
> executing the exe, i get the error.
>
> rsanpui@cygwin ~
> $ "//DNVM/E920/System920/x86/MyWorld Client Install/install/setup.exe"
> -bash: //DNVM/E920/System920/x86/MyWorld Client Install/install/setup.exe: Is 
> a directory
>
>
> If i do a usual password based logging using ssh, then there is no error
> message.
> rsanpui@cygwin ~
>$ "//DNVM/E920/System920/x86/MyWorld Client Install/install/setup.exe"
>
> Guys, i am really stuck as we are trying to develop an application which
> will do passwordless ssh and execution of the exe. Can someone please
> suggest?
>
> On Wed, Oct 14, 2020 at 11:23 AM Raj Kumar Sanpui <
> raj.kumar.san...@gmail.com> wrote:
>
>> Hi All,
>>
>> I am trying to access an exe hosted in a shared drive in a remote machine.
>> (Please note: T*he exe is NOT hosted on the box where cygwin is
>> installed but a different one*.)
>>
>>
>> *Case 1: Which fails*
>> If i ssh to the Windows box where cygwin is installed, and then try to
>> access the remote exe it *fails saying "exe is a directory"*
>>
>> [rundeck@den PKG_INSTALL_SERVICE]$ cat snapshot1.bat | ssh
>> rsanpui@cygwin-box
>>
>> Pseudo-terminal will not be allocated because stdin is not a terminal.
>> -bash: line 1: //remote-box/owshare/owinstal/Snapshot/SnapShot.exe: *Is
>> a directory*
>>
>> What i have inside snapshot1.bat is simple -
>> [rundeck@den PKG_INSTALL_SERVICE]$ cat snapshot1.bat
>> "//remote-box/owshare/owinstal/Snapshot/SnapShot.exe"
>>
>> *Case 2: Which works*
>> If i login to the Windows VM where cygwin is installed, and try to access
>> the same remote exe it works.
>>
>> What am I missing? Please advise.
>>
>> Thanks
>>
>>
>>
>>
>>
>>
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


gnuplot post-install : exit code 1

2020-12-05 Thread Fergus Daly via Cygwin
Both cygwin32 and cygwin64, both up-to-date:
Following recent update to gnuplot I'm getting post-install errors
as follows in both setup logs:
running: D:\cygwin..\bin\bash.exe --norc --noprofile 
"/etc/postinstall/gnuplot.sh"
abnormal exit: exit code=1
My installed.db shows 
gnuplot-X11 gnuplot-X11-5.4.1-1.tar.bz2 1
gnuplot-base gnuplot-base-5.4.1-1.tar.bz2 0
for both 32 and 64 bit setups.
Previously to this update, no such messages.
Any ideas?
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Environment variable named !:: (exclamation mark + colon + colon)

2020-12-05 Thread tzccinct via Cygwin

Hi,

I have found an environment variable that has a strange name `!::' 
(exclamation mark + colon + colon) on my terminal (both mintty and Tera 
Term). The value is also strange, `::\' (colon + colon + backslash).


$ env | sort | head -n 3
!::=::\
_=/usr/bin/env
ALLUSERSPROFILE=C:\ProgramData

Is this an expected environment variable on Cygwin? If so, what is this for?

Best regards,
tzccinct
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: ssh to cygwin-box and access remote exe fails saying exe is a directory

2020-12-05 Thread Raj Kumar Sanpui via Cygwin
I haven't received any help/suggestions from the forum, but i tried digging
deeper.
Now i can see the "Is a directory" error happens if I do passwordless ssh
(copying my public key using ssh-copy-id) to remote Cygwin box and try
executing the exe, i get the error.

rsanpui@cygwin ~
$ "//DNVM/E920/System920/x86/MyWorld Client Install/install/setup.exe"
-bash: //DNVM/E920/System920/x86/MyWorld Client
Install/install/setup.exe: Is a directory


If i do a usual password based logging using ssh, then there is no error
message.
rsanpui@cygwin ~
   $ "//DNVM/E920/System920/x86/MyWorld Client Install/install/setup.exe"

Guys, i am really stuck as we are trying to develop an application which
will do passwordless ssh and execution of the exe. Can someone please
suggest?

On Wed, Oct 14, 2020 at 11:23 AM Raj Kumar Sanpui <
raj.kumar.san...@gmail.com> wrote:

> Hi All,
>
> I am trying to access an exe hosted in a shared drive in a remote machine.
> (Please note: T*he exe is NOT hosted on the box where cygwin is installed
> but a different one*.)
>
>
> *Case 1: Which fails*
> If i ssh to the Windows box where cygwin is installed, and then try to
> access the remote exe it *fails saying "exe is a directory"*
>
> [rundeck@den PKG_INSTALL_SERVICE]$ cat snapshot1.bat | ssh
> rsanpui@cygwin-box
>
> Pseudo-terminal will not be allocated because stdin is not a terminal.
> -bash: line 1: //remote-box/owshare/owinstal/Snapshot/SnapShot.exe: *Is a
> directory*
>
> What i have inside snapshot1.bat is simple -
> [rundeck@den PKG_INSTALL_SERVICE]$ cat snapshot1.bat
> "//remote-box/owshare/owinstal/Snapshot/SnapShot.exe"
>
> *Case 2: Which works*
> If i login to the Windows VM where cygwin is installed, and try to access
> the same remote exe it works.
>
> What am I missing? Please advise.
>
> Thanks
>
>
>
>
>
>
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: setup.exe corruption

2020-12-05 Thread o lu via Cygwin
How does this acl option work? Im on Win 10 Home.


On Thu, Apr 16, 2020 at 9:10 AM o lu  wrote:

> How does the acl option work? I ran it on a regular Windows directory (to
> my knowledge).
>
> Your english is fine.
>
> On Thu, Apr 16, 2020 at 4:20 AM Andrey Repin  wrote:
>
>> Greetings, o lu!
>>
>> > It worked, but I dont understand on Windows
>>
>> If you have downloaded it into a directory mounted with "acl" option,
>> POSIX
>> behavior apply.
>>
>>
>> --
>> With best regards,
>> Andrey Repin
>> Thursday, April 16, 2020 11:06:22
>>
>> Sorry for my terrible english...
>>
>>
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: blockdev.exe is missing in util-linux. How to determine block device size in bash?

2020-12-05 Thread Ilya Basin via Cygwin
Strange. On Win7 this doesn't work:

il@mar2 /cygdrive/c/Windows/System32
$ cat /proc/partitions
major minor  #blocks  name   win-mounts

8 0 0 sda
816 0 sdb

il@mar2 /cygdrive/c/Windows/System32
$ dd of=/dev/null if=/dev/sda bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.215181 s, 487 MB/s


On 28.11.2020 20:04, Brian Inglis wrote:
> $ cat /proc/partitions
> major minor  #blocks  name   win-mounts
> 
> 8 0 976762584 sda
> 8 1 16384 sda1
> 8 2 97678 sda2   C:\
> 816 976762584 sdb
> 817131072 sdb1
> 818102400 sdb2
> 819 975482161 sdb3   D:\
> 820577536 sdb4
> 821465920 sdb5
> 832 0 sdc
--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple