From owner-freebsd-stable@FreeBSD.ORG Wed Mar 12 07:34:33 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D4286B2 for ; Wed, 12 Mar 2014 07:34:33 +0000 (UTC) Received: from mail-ve0-x233.google.com (mail-ve0-x233.google.com [IPv6:2607:f8b0:400c:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CE8A2B6 for ; Wed, 12 Mar 2014 07:34:33 +0000 (UTC) Received: by mail-ve0-f179.google.com with SMTP id db12so9911962veb.10 for ; Wed, 12 Mar 2014 00:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=6AlVGIck3p8WqwKRD36MRV0usB5qvs3+XC47aE1TOj0=; b=j0R+uSOhI6+9fowJmHkBL3lAm9+kk7BnJDQBVnWzsWscubEaOu5bY3L3SGMmU8FyNz FQvb6UiK+QiDw8FpbCcGUUSwbdA2X99FD083mwVGVhN92Edm7qiXa8546cuAq5x2hdlN 0aoR1VmtCUC9tEJo3TMurzNqT873JII1qzrOEfN6upWpnn/EgFKKnVecaGJUzP/gHkQR Urlr8KV3pTgTzTDAk7TPsk8HMsMMXsLpVeWJ091GiEuT8fB+EdeihXr6vPdHfbyzeK1L Z5MxAV7khMsllgDiK4KQ5XrcrMivXn9phSdneR2EYXvC5wg4kxEYFwrLioY7J8JlTpVb RR9g== MIME-Version: 1.0 X-Received: by 10.220.133.80 with SMTP id e16mr31155989vct.13.1394609672185; Wed, 12 Mar 2014 00:34:32 -0700 (PDT) Received: by 10.52.255.231 with HTTP; Wed, 12 Mar 2014 00:34:32 -0700 (PDT) Date: Wed, 12 Mar 2014 11:34:32 +0400 Message-ID: Subject: net/nylon hangs in read(2) under FreeBSD10 From: Pavel Timofeev To: freebsd-stable stable Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 07:34:33 -0000 Hello! I used net/nylon (socks proxy server, born in openbsd) for some time under FreeBSD10.0-RELEASE amd64. I had no problems in testlab with that configuration. But now I have problems in production with that. Sometimes nylon starts to eat whole CPU. For example, I have proxy.xxx.ru (192.168.31.198) and client1.xxx.ru (192.168.2.6). Here is what I see every time. Let's say that hung nylon has pid 5323 # truss -p 5323 ...... read(6,0x7fffffffdb13,1) ERR#35 'Resource temporarily unavailable' read(6,0x7fffffffdb13,1) ERR#35 'Resource temporarily unavailable' read(6,0x7fffffffdb13,1) ERR#35 'Resource temporarily unavailable' read(6,0x7fffffffdb13,1) ERR#35 'Resource temporarily unavailable' read(6,0x7fffffffdb13,1) ERR#35 'Resource temporarily unavailable' ^C Nylon tries to read from FD 6 (right?) and gets errno 35. Infinite loop. # lsof -p 5323 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nylon 5323 root cwd VDIR 0,96 1024 2 / nylon 5323 root rtd VDIR 0,96 1024 2 / nylon 5323 root txt VREG 0,96 34840 1134069 /usr/local/bin/nylon nylon 5323 root txt VREG 0,96 111696 240770 /libexec/ld-elf.so.1 nylon 5323 root txt VREG 0,96 306532 2970271 /usr/local/lib/event2/libevent-2.0.so.6 nylon 5323 root txt VREG 0,96 1567216 481549 /lib/libc.so.7 nylon 5323 root txt VREG 0,96 105104 481569 /lib/libthr.so.3 nylon 5323 root 0u VCHR 0,15 0t0 15 /dev/null nylon 5323 root 1u VCHR 0,15 0t0 15 /dev/null nylon 5323 root 2u VCHR 0,15 0t0 15 /dev/null nylon 5323 root 4u IPv4 0xfffff800646b9c00 0t0 TCP proxy.xxx.ru:socks (LISTEN) nylon 5323 root 5u unix 0xfffff8006494d000 0t0 ->0xfffff800098862b8 nylon 5323 root 6u IPv4 0xfffff8011cd07400 0t0 TCP proxy.xxx.ru:socks->client1.xxx.ru:45737 (ESTABLISHED) Looks like that FD is last line in this output. It's tcp socket (right?). # sockstat | grep 5323 root nylon 5323 4 tcp4 192.168.31.198:1080 *:* root nylon 5323 5 dgram -> /var/run/logpriv root nylon 5323 6 tcp4 192.168.31.198:1080 192.168.2.6:45737 That pid has open socket with client1.xxx.ru (192.168.2.6). I looked to open sockets in client1.xxx.ru and didn't find suitable. And I can kill that hung pid only using "kill -9". It appears to be a problem here. But where? In nylon or even in FreeBSD? I'm not UNIX OS and programming professional and I don't know wheater OS has to return errno 35 for read of that dead(?) socket. Do I have to provide more info? Which one? I'm looking forward! It happens quite often now.