From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 2 16:30:21 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C7D2B16A4C0 for ; Tue, 2 Sep 2003 16:30:21 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34E0D43FAF for ; Tue, 2 Sep 2003 16:30:18 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h82NUIUp064023 for ; Tue, 2 Sep 2003 16:30:18 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h82NUIZZ064022; Tue, 2 Sep 2003 16:30:18 -0700 (PDT) Resent-Date: Tue, 2 Sep 2003 16:30:18 -0700 (PDT) Resent-Message-Id: <200309022330.h82NUIZZ064022@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, "Burton M. Strauss III" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 58C3116A4BF for ; Tue, 2 Sep 2003 16:26:55 -0700 (PDT) Received: from mail03.powweb.com (mail03.powweb.com [63.251.216.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BD6643FE9 for ; Tue, 2 Sep 2003 16:26:54 -0700 (PDT) (envelope-from Burton@ntopsupport.com) Received: from zebra (12-239-98-199.client.attbi.com [12.239.98.199]) by mail03.powweb.com (Postfix) with ESMTP id 8409515C16 for ; Tue, 2 Sep 2003 16:36:52 -0700 (PDT) Message-Id: Date: Tue, 2 Sep 2003 18:26:53 -0500 From: "Burton M. Strauss III" To: Subject: kern/56339: select() call (poll() too) hangs, yet call works perfectly (no hang) under gdb X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2003 23:30:21 -0000 >Number: 56339 >Category: kern >Synopsis: select() call (poll() too) hangs, yet call works perfectly >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 02 16:30:17 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Burton M. Strauss III >Release: FreeBSD 4.8-RELEASE i386 >Organization: private citizen >Environment: System: FreeBSD owl.gateway.2wire.net 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Thu Apr 3 10:53:38 GMT 2003 root@free bsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC i386 >Description: A normal user program (multi-threaded) hangs on a select() call. Changing the call to a poll() still hangs. Under gdb, the program works perfectly. Here is the code: while(myGlobals.capturePackets != FLAG_NTOPSTATE_TERM) { traceEvent(CONST_TRACE_INFO, "DEBUG: Select(ing) %d....", topSock); memcpy(&mask, &mask_copy, sizeof(fd_set)); rc = select(topSock+1, &mask, 0, 0, NULL /* Infinite */); traceEvent(CONST_TRACE_INFO, "DEBUG: select returned: %d", rc); if(rc > 0) { handleSingleWebConnection(&mask); } } (traceEvent becomes a call to syslog). The log message shows the call to select, but it never returns. This is true, even if I change the timeout from infinite to, say 10s. Same behavior is seen on FreeBSD 5.1. Same behavior if you convert select() to poll(), (example below), the call never returns. while(myGlobals.capturePackets != FLAG_NTOPSTATE_TERM) { for (i=0; iHow-To-Repeat: No specifics - it just happens in our code every time. >Fix: >Release-Note: >Audit-Trail: >Unformatted: X-send-pr-version: 3.113 X-GNATS-Notify: (no hang) under gdb