From dreamind@dreamind.de Mon Oct 4 00:34:10 2004 Received: with ECARTIS (v1.0.0; list fam); Mon, 04 Oct 2004 00:34:23 -0700 (PDT) Received: from horaz.ls-hosting.de (foobar@horaz.ls-hosting.de [213.239.197.103]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id i947Y900008903 for ; Mon, 4 Oct 2004 00:34:10 -0700 Mime-Version: 1.0 (Apple Message framework v619) To: fam@oss.sgi.com Message-Id: Content-Type: multipart/mixed; boundary=Apple-Mail-2-456431454 From: Stefan Pfetzing Subject: send() returns less than len (assertation in NetConnection.c++) Date: Mon, 4 Oct 2004 09:33:52 +0200 X-Mailer: Apple Mail (2.619) X-archive-position: 283 X-ecartis-version: Ecartis v1.0.0 Sender: fam-bounce@oss.sgi.com Errors-to: fam-bounce@oss.sgi.com X-original-sender: dreamind@dreamind.de Precedence: bulk X-list: fam --Apple-Mail-2-456431454 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hi, I today found out that on one of our servers (the nfs server) famd, which has enabled remote connections, randomly crashes. It seems to be because in NetConnection.c++ there is an assert(ret == omsgList->len); and famd aborts. I already searched google for it and the mailinglist, but I didn't find anything about it. For send() there was also no hint, if its possible that send returns less than the len parameter, so I fixed this kinda hackish (see the attached patch) but I dunno if its ok. --Apple-Mail-2-456431454 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="04_remove_assert_in_NetConnection.patch" Content-Disposition: attachment; filename=04_remove_assert_in_NetConnection.patch diff -uNr fam-2.7.0/src/NetConnection.c++ fam-2.7.0-patched/src/NetConnection.c++ --- fam-2.7.0/src/NetConnection.c++ 2003-01-18 15:18:12.000000000 +0100 +++ fam-2.7.0-patched/src/NetConnection.c++ 2004-10-04 09:07:16.000000000 +0200 @@ -247,9 +247,11 @@ break; } else { - if (ret >= 0) + if (ret >= 0 && omsgList->len != ret) { - assert(ret == omsgList->len); + Log::error("Argh, disconnecting len: %d ret: %d", omsgList->len, ret); + shutdown(false); + return; } else { /* Since the client library can close it's fd before --Apple-Mail-2-456431454 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed bye Stefan -- http://www.dreamind.de/ Oroborus and Debian GNU/Linux Developer. --Apple-Mail-2-456431454--