Subject: pkg/24517: mozilla can't resolve more than one host names simultaneously
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <hira@po6.nsk.ne.jp>
List: netbsd-bugs
Date: 02/22/2004 11:43:05
>Number:         24517
>Category:       pkg
>Synopsis:       mozilla can't resolve more than one host names simultaneously
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 22 02:44:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Kouichirou Hiratsuka
>Release:        NetBSD 1.6ZK
>Organization:
>Environment:
System: NetBSD firefly.localdomain 1.6ZK NetBSD 1.6ZK (FIREFLY.MP) #7: Sun Feb 22 08:48:21 JST 2004 root@firefly.localdomain:/usr/src/sys/arch/i386/compile/FIREFLY.MP i386
Architecture: i386
Machine: i386
>Description:
	The mozilla-1.6 can't resolve more than one host names simultaneously.
	Because getaddrinfo(3) is not reentrant, lock is necessary for it.

>How-To-Repeat:
	try to resolve more than one host names on the mozilla simultaneously

>Fix:
--- nsprpub/pr/src/misc/prnetdb.c.orig	2004-02-19 21:45:15.000000000 +0900
+++ nsprpub/pr/src/misc/prnetdb.c	2004-02-19 21:50:57.000000000 +0900
@@ -2094,7 +2094,12 @@
          */
         hints.ai_socktype = SOCK_STREAM;
 
+        LOCK_DNS();
+
         rv = GETADDRINFO(hostname, NULL, &hints, &res);
+
+        UNLOCK_DNS();
+
         if (rv == 0)
             return (PRAddrInfo *) res;
 
>Release-Note:
>Audit-Trail:
>Unformatted: