You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unix sockets are partially implemented, and they do work. The socket files just don't show up in the file system. However, it's still possible to connect to them if you know the path of the socket file. Of course, this does break applications that attempt to "stat" a socket file or do anything else that depends on the file being present.
We're working to address this issue.
Reacted by Paul Biester, Justin Self, Sunil Muthuswamy, Maxime Tournier, Scott Mackay, Denis Akhiyarov, Mart Sõmermaa, Brent and Girish Gopalakrishna Pillai
As Sven Groot (@SvenGroot) mentions, file system integration of UNIX sockets is not complete yet. We will be tracking\prioritizing which features to light up next by looking at the feedback provided at the wpdev portal. We appreciate your feedback and please make sure to provide it through the wpdev portal as well.
Sven Groot (@SvenGroot)Sunil Muthuswamy (@sunilmut) Just an update I can reproduce the issue referenced with #1331. Jupyter notebook is using sockets and getting Invalid argument (src/tcp_address.cpp:186). Further investigation led me to find that libzmq is not currently working with BashOnWindows.
I built libzmq and got the following log from the test suite. All of the errors point to the same line of code. test-suite.txt
In particular, this is the code which is causing an invalid argument error. See getifaddrs.
#elif ((defined ZMQ_HAVE_LINUX || defined ZMQ_HAVE_FREEBSD ||\
defined ZMQ_HAVE_OSX || defined ZMQ_HAVE_OPENBSD ||\
defined ZMQ_HAVE_QNXNTO || defined ZMQ_HAVE_NETBSD ||\
defined ZMQ_HAVE_DRAGONFLY || defined ZMQ_HAVE_GNU)\
&& defined ZMQ_HAVE_IFADDRS)
#include <ifaddrs.h>
// On these platforms, network interface name can be queried
// using getifaddrs function.
int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_)
{
// Get the addresses.
ifaddrs *ifa = NULL;
const int rc = getifaddrs (&ifa);
errno_assert (rc == 0);
zmq_assert (ifa != NULL);
// Find the corresponding network interface.
bool found = false;
for (ifaddrs *ifp = ifa; ifp != NULL; ifp = ifp->ifa_next) {
if (ifp->ifa_addr == NULL)
continue;
const int family = ifp->ifa_addr->sa_family;
if ((family == AF_INET || (ipv6_ && family == AF_INET6))
&& !strcmp (nic_, ifp->ifa_name)) {
if (is_src_)
memcpy (&source_address, ifp->ifa_addr,
(family == AF_INET) ? sizeof (struct sockaddr_in)
: sizeof (struct sockaddr_in6));
else
memcpy (&address, ifp->ifa_addr,
(family == AF_INET) ? sizeof (struct sockaddr_in)
: sizeof (struct sockaddr_in6));
found = true;
break;
}
}
// Clean-up;
freeifaddrs (ifa);
if (!found) {
errno = ENODEV;
return -1;
}
return 0;
}
This AFAICT also breaks Rails 5 out of the box without the hack of disabling of spring (it's simply too slow at times without Spring so this is really painful). Any news on this?
This may be what's breaking the default socket-based configuration with NGINX and PHP-FPM? I was able to get it to run reliably only after configuring it to use TCP instead of sockets, and also failed to use sockets with PHP, is this all related to this issue?
Is there a fix on the way, or is this very far off? I really want to use UOW for development on my Windows system, mainly because there are features (such as sockets, threads and readline support) that are unavailable in Windows-builds of PHP.
Could someone on the WSL team perhaps summarize what they believe to be the status of this issue?
I have personally used UNIX Sockets without any issue. But I haven't done anything fancy with them. I realize it's more complicated than a simple "works" vs "not works" -- there are lots of flags and options and whatnot that you can set on a socket that affect its behavior; my understanding is that some work and some do not.
Adam Seering (@aseering) - We are not aware of any open issues with the WSL AF_UNIX socket implementation. But, I know it's not fully compatible yet because for example the dbus test does not give the same results as that of native Ubuntu. We haven't dug into all the failures yet. We are trying to prioritize issues reported here as they come.
Rasmus Schultz (@mindplay-dk) - Thanks for your post. We will have to take one issue at a time, so that we can root cause and fix it. Can you please post repro steps, build number and strace, if possible? You can see the template here. To gather strace, use strace -o <trace_file> -ff <cmd>
Regarding capturing an strace, the challenge here will presumably be identifying what command to run. (The "command" in this case is two separate backgrounded system services, nginx and php-fpm; both would need to be run directly and in the foreground.) Rasmus Schultz (@mindplay-dk) -- I think you indicated on #1851 that you weren't sure how to accomplish that level of Linux magic? I can try to take a look, but I may not get to it for a while. If anyone else is following this thread and would be willing to give it a shot, please do.
Sunil Muthuswamy (@sunilmut) -- thanks! The title of this ticket implies that UNIX sockets don't work at all. And the ticket is still open. Up to you, but I wonder if some ticket-wrangling might be in order? :-)
This project has a bunch of different scripts that all do the same thing - return a JPEG image - in different ways, because I'm using it to benchmark and evaluate the performance of various means of sending an image.
Clone the project locally.
Run composer install and you should be all set.
Run vendor/bin/ppm from the project root folder to launch.
The relevant changes for the php-pm setup happened in this commit and the only thing I wrote really was this simple front controller which does nothing except return the image, it doesn't even care what the Request looks like at all. Quick and dirty.
(oh, and I guess composer install worked on my system because it's in the path on my Windows system already and the phar file works with the Linux installation of PHP as well. If you don't have Composer installed, you may need to do that first.)
Activity
SvenGroot commentedon Apr 11, 2016
Unix sockets are partially implemented, and they do work. The socket files just don't show up in the file system. However, it's still possible to connect to them if you know the path of the socket file. Of course, this does break applications that attempt to "stat" a socket file or do anything else that depends on the file being present.
We're working to address this issue.
sunilmut commentedon Apr 11, 2016
As Sven Groot (@SvenGroot) mentions, file system integration of UNIX sockets is not complete yet. We will be tracking\prioritizing which features to light up next by looking at the feedback provided at the wpdev portal. We appreciate your feedback and please make sure to provide it through the wpdev portal as well.
MadcowD commentedon May 1, 2016
Sven Groot (@SvenGroot) Sunil Muthuswamy (@sunilmut) Just an update I can reproduce the issue referenced with #1331. Jupyter notebook is using sockets and getting Invalid argument (src/tcp_address.cpp:186). Further investigation led me to find that
libzmq is not currently working with BashOnWindows.
I built libzmq and got the following log from the test suite. All of the errors point to the same line of code.
test-suite.txt
In particular, this is the code which is causing an invalid argument error. See getifaddrs.
Related #69
benhillis commentedon Jun 1, 2016
Adding link to source code exhibiting an issue: #207
lypanov commentedon Nov 10, 2016
This AFAICT also breaks Rails 5 out of the box without the hack of disabling of spring (it's simply too slow at times without Spring so this is really painful). Any news on this?
mindplay-dk commentedon Apr 10, 2017
This may be what's breaking the default socket-based configuration with NGINX and PHP-FPM? I was able to get it to run reliably only after configuring it to use TCP instead of sockets, and also failed to use sockets with PHP, is this all related to this issue?
Is there a fix on the way, or is this very far off? I really want to use UOW for development on my Windows system, mainly because there are features (such as sockets, threads and readline support) that are unavailable in Windows-builds of PHP.
aseering commentedon Apr 10, 2017
Could someone on the WSL team perhaps summarize what they believe to be the status of this issue?
I have personally used UNIX Sockets without any issue. But I haven't done anything fancy with them. I realize it's more complicated than a simple "works" vs "not works" -- there are lots of flags and options and whatnot that you can set on a socket that affect its behavior; my understanding is that some work and some do not.
sunilmut commentedon Apr 10, 2017
Adam Seering (@aseering) - We are not aware of any open issues with the WSL AF_UNIX socket implementation. But, I know it's not fully compatible yet because for example the
dbustest does not give the same results as that of native Ubuntu. We haven't dug into all the failures yet. We are trying to prioritize issues reported here as they come.Rasmus Schultz (@mindplay-dk) - Thanks for your post. We will have to take one issue at a time, so that we can root cause and fix it. Can you please post repro steps, build number and strace, if possible? You can see the template here. To gather strace, use
strace -o <trace_file> -ff <cmd>aseering commentedon Apr 10, 2017
Regarding capturing an strace, the challenge here will presumably be identifying what command to run. (The "command" in this case is two separate backgrounded system services, nginx and php-fpm; both would need to be run directly and in the foreground.) Rasmus Schultz (@mindplay-dk) -- I think you indicated on #1851 that you weren't sure how to accomplish that level of Linux magic? I can try to take a look, but I may not get to it for a while. If anyone else is following this thread and would be willing to give it a shot, please do.
aseering commentedon Apr 10, 2017
Sunil Muthuswamy (@sunilmut) -- thanks! The title of this ticket implies that UNIX sockets don't work at all. And the ticket is still open. Up to you, but I wonder if some ticket-wrangling might be in order? :-)
sunilmut commentedon Apr 10, 2017
Adam Seering (@aseering) - Makes sense. I will close this issue out, it's too broad and not actionable. Rasmus Schultz (@mindplay-dk) - We will continue to work with you on the other issue.
As for the strace, we would have to then rely on the repro.
mindplay-dk commentedon Apr 11, 2017
Sunil Muthuswamy (@sunilmut) I know you closed this issue, but not sure where else to answer the questions you asked. (?)
To help you repeat the php-pm issue, here's the sandbox project for testing:
https://bitbucket.org/mindplaydk/http-bench
This project has a bunch of different scripts that all do the same thing - return a JPEG image - in different ways, because I'm using it to benchmark and evaluate the performance of various means of sending an image.
Clone the project locally.
Run
composer installand you should be all set.Run
vendor/bin/ppmfrom the project root folder to launch.The relevant changes for the php-pm setup happened in this commit and the only thing I wrote really was this simple front controller which does nothing except return the image, it doesn't even care what the Request looks like at all. Quick and dirty.
I posted steps to recreate my environment here.
I'm on Windows 10 Pro version 1703 build 15063.13
I tried to run that "strace" you asked for, so, this:
It produced these files.
I think that's everything you asked for - let me know if there's anything else I can do?
mindplay-dk commentedon Apr 11, 2017
(oh, and I guess
composer installworked on my system because it's in the path on my Windows system already and thepharfile works with the Linux installation of PHP as well. If you don't have Composer installed, you may need to do that first.)0x4248 commentedon Jan 25, 2021
im getting a Socket type not supported when i use tcpdump anyone help