Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 18246 invoked by uid 500); 20 Jul 2001 03:21:12 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 18217 invoked from network); 20 Jul 2001 03:21:11 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Ryan Bloom Reply-To: rbb@covalent.net Organization: Covalent Technologies To: Ian Holsman , Justin Erenkrantz Subject: Re: [PATCH] Add reentrant gethostbyname call Date: Thu, 19 Jul 2001 20:22:23 -0700 X-Mailer: KMail [version 1.2] Cc: dev@apr.apache.org References: <20010719193655.K324@ebuilt.com> <3B579D80.90101@cnet.com> In-Reply-To: <3B579D80.90101@cnet.com> MIME-Version: 1.0 Message-Id: <01071920222300.01142@koj.rkbloom.net> Content-Transfer-Encoding: 8bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N On Thursday 19 July 2001 19:54, Ian Holsman wrote: > Justin Erenkrantz wrote: > >During some testing with flood (~30 threads), we ran into a stack > >corruption error in our code. We tracked it down to the fact that > > we were using a non-reentrant version of gethostbyname. This > > patch lets us call the reentrant version of gethostbyname and now > > we haven't been able to recreate the segfault. > > > >The only possible optimization would be the size of the temporary > >buffer (currently 256). Roy mentioned that the address array in > >hostent has a maximum of 10 entries. If so, the size of the > >structure plus the maximum size of the array (10 entries) may be > >sufficient. If we send in a too small buffer, we should > >receive ERANGE. > > Is there a reason why we shouldn't just use the re-entrant versions > where it is available? It can be overhead that we don't need, it all depends on how the re-entrant version is implemented. > >Any reason we shouldn't commit? -- justin You can't check for threads that way. You need to use the same basic logic that we use in dir.c to check for readdir_r. Ryan