From owner-freebsd-bugs Thu Dec 7 14:40:12 2000 From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 7 14:40:01 2000 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 86B9537B401 for ; Thu, 7 Dec 2000 14:40:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eB7Me1F08592; Thu, 7 Dec 2000 14:40:01 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 7 Dec 2000 14:40:01 -0800 (PST) Resent-Message-Id: <200012072240.eB7Me1F08592@freefall.freebsd.org> Resent-From: gnats-admin@FreeBSD.org (GNATS Management) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: gnats-admin@FreeBSD.org, chrisp@netwinsite.com Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 83E5737B401 for ; Thu, 7 Dec 2000 14:34:11 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eB7MYBv07910; Thu, 7 Dec 2000 14:34:11 -0800 (PST) (envelope-from nobody) Message-Id: <200012072234.eB7MYBv07910@freefall.freebsd.org> Date: Thu, 7 Dec 2000 14:34:11 -0800 (PST) From: chrisp@netwinsite.com Sender: nobody@FreeBSD.org To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/23364: gethostbyaddr takes longer or locks up and burns cpu when linked to -pthread Resent-Sender: gnats@FreeBSD.org Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23364 >Category: misc >Synopsis: gethostbyaddr takes longer or locks up and burns cpu when linked to -pthread >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 Dec 07 14:40:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Chris Pugmire >Release: 4.1.1-RELEASE >Organization: NetWin Ltd >Environment: FreeBSD news.siscom.net 4.1.1-RELEASE FreeBSD 4.1.1-RELEASE #2: Mon Nov 27 14:21:06 EST 2000 root@news.siscom.net:/usr/src/sys/compile/GENERIC i386 >Description: With a test program doing ip number to name lookups for a number that does not have an entry if the program is linked with -pthread then it takes 30 seconds longer and burns 100% cpu until it times out. I believe it sometimes never times out or takes much longer but cannot reproduce this in a test case. Note that no actual threads are used, this program is simply linked with -pthread and then behaves in this odd way. >How-To-Repeat: Sample code included: (include headers...) int do_reverse(char *ipnum); int main(int argc, char *argv[]) { int i; if (argc<2) { usage: printf("Usage: testdns -rev n.n.n.n\n"); return 0; } tcp_startup(); for (i=1; ih_name!=NULL) { printf("result (%s)\n",hp->h_name); } printf("Delay %d seconds\n",time(NULL)-start); return TRUE; } Example output with the same program linked different ways: news# ./testdns_nopthread -rev 160.79.54.12 Looking up (160.79.54.12) Result 0x0 Delay 80 seconds news# ./testdns_pthread -rev 160.79.54.12 Looking up (160.79.54.12) Result 0x0 Delay 111 seconds (and in the second case watching top will show the testdns process burning cpu) >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message