From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 10 05:40:02 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 897C31065672 for ; Thu, 10 Jun 2010 05:40:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 669428FC14 for ; Thu, 10 Jun 2010 05:40:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o5A5e1H2035428 for ; Thu, 10 Jun 2010 05:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o5A5e11E035427; Thu, 10 Jun 2010 05:40:01 GMT (envelope-from gnats) Resent-Date: Thu, 10 Jun 2010 05:40:01 GMT Resent-Message-Id: <201006100540.o5A5e11E035427@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Minkus Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80E771065670 for ; Thu, 10 Jun 2010 05:33:42 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 659658FC14 for ; Thu, 10 Jun 2010 05:33:42 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o5A5XfHt006790 for ; Thu, 10 Jun 2010 05:33:41 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o5A5Xf3r006789; Thu, 10 Jun 2010 05:33:41 GMT (envelope-from nobody) Message-Id: <201006100533.o5A5Xf3r006789@www.freebsd.org> Date: Thu, 10 Jun 2010 05:33:41 GMT From: Martin Minkus To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/147756: open_socket_in: Protocol not supported - after a few days? X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jun 2010 05:40:02 -0000 >Number: 147756 >Category: kern >Synopsis: open_socket_in: Protocol not supported - after a few days? >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 10 05:40:01 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Martin Minkus >Release: 8-STABLE >Organization: >Environment: FreeBSD kinetic.pulse.local 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #4: Wed May 26 18:09:14 NZST 2010 martinm@kinetic.pulse.local:/usr/obj/usr/src/sys/PULSE amd64 >Description: Samba 3.4 on FreeBSD 8-STABLE branch. After a few days I start getting weird errors and windows PC's can't access the samba share, have trouble accessing files, etc, and samba becomes totally unusable. Restarting samba doesn't fix it, only a reboot does. log.smb: [2010/06/10 17:22:39, 0] lib/util_sock.c:902(open_socket_in) open_socket_in(): socket() call failed: Protocol not supported [2010/06/10 17:22:39, 0] smbd/server.c:457(smbd_open_one_socket) smbd_open_once_socket: open_socket_in: Protocol not supported [2010/06/10 17:22:39, 2] smbd/server.c:676(smbd_parent_loop) waiting for connections log.ANYPC: [2010/06/08 19:55:55, 0] lib/util_sock.c:1491(get_peer_addr_internal) getpeername failed. Error was Socket is not connected read_fd_with_timeout: client 0.0.0.0 read error = Socket is not connected. The code in lib/util_sock.c, around line 902: /**************************************************************************** Open a socket of the specified type, port, and address for incoming data. ****************************************************************************/ int open_socket_in(int type, uint16_t port, int dlevel, const struct sockaddr_storage *psock, bool rebind) { struct sockaddr_storage sock; int res; socklen_t slen = sizeof(struct sockaddr_in); sock = *psock; #if defined(HAVE_IPV6) if (sock.ss_family == AF_INET6) { ((struct sockaddr_in6 *)&sock)->sin6_port = htons(port); slen = sizeof(struct sockaddr_in6); } #endif if (sock.ss_family == AF_INET) { ((struct sockaddr_in *)&sock)->sin_port = htons(port); } res = socket(sock.ss_family, type, 0 ); if( res == -1 ) { if( DEBUGLVL(0) ) { dbgtext( "open_socket_in(): socket() call failed: " ); dbgtext( "%s\n", strerror( errno ) ); } In other words, something in the kernel is being exhausted in my case and some tuning is required as its failing to create sockets? /boot/loader.conf: mvs_load="YES" zfs_load="YES" vm.kmem_size="20G" #vfs.zfs.arc_min="512M" #vfs.zfs.arc_max="1536M" vfs.zfs.arc_min="512M" vfs.zfs.arc_max="3072M" /etc/sysctl.conf: kern.ipc.maxsockbuf=2097152 net.inet.tcp.sendspace=262144 net.inet.tcp.recvspace=262144 net.inet.tcp.mssdflt=1452 net.inet.udp.recvspace=65535 net.inet.udp.maxdgram=65535 net.local.stream.recvspace=65535 net.local.stream.sendspace=65535 (those don't seem to fix anything, btw.) >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: