On Wed, 2015-09-09 at 10:57 +0200, Samuel Thibault wrote: > Svante Signell, le Wed 09 Sep 2015 10:57:37 +0200, a écrit : > > I do also see the ssh/sshd freeze when creating a socket and removing it > > with rm on that box. > > Just to make sure: how do you create the socket?
It does not happen every time, so it is hard to find out now which program causes the freeze. One simple program is attached, but I have not been able to get the freeze with that program today. As written on IRC I have a test program, server-client, that reveals a pflocal bug I've been trying to hunt down. That bug will be described in a separate mail.
#include <stdlib.h> #include <sys/socket.h> #include <sys/un.h> #include <errno.h> #include <stdio.h> #include <string.h> #include <unistd.h> //#define PF_LOCAL 1 //#define SOCK_STREAM 1 #define MY_SOCK_PATH "./stream_socket" int main(void) { struct sockaddr_un my_addr; memset(&my_addr, 0, sizeof(struct sockaddr_un)); /* Clear structure */ my_addr.sun_family = AF_UNIX; strncpy(my_addr.sun_path, MY_SOCK_PATH, sizeof(my_addr.sun_path) - 1); /* First call to socket() function */ // int sockfd = socket(AF_UNIX, SOCK_STREAM, 0); int sockfd = socket(AF_UNIX, SOCK_DGRAM, 0); if (sockfd < 0) { printf("socket() failed with errno %d (%s)", errno, strerror(errno)); perror("ERROR opening socket"); exit(1); } /* Now bind the host address using bind() call.*/ int ret = bind(sockfd, (struct sockaddr *) &my_addr, sizeof(my_addr)); if (ret < 0) { perror("ERROR on binding"); exit(1); } return 0; }