Subject: Re: NetBSD getaddrinfo not reentrant
To: None <>
From: Jun-ichiro itojun Hagino <>
List: tech-net
Date: 05/03/2005 21:35:25
> I'm one of only 2 NetBSD folks participating in the EFF/tor
> project (The great majority of users are linux). I run NetBSD 2_Stable
> on a 300MHz P2 w/256M ram...
> Anyway, for the last month since the main branch of tor moved to
> a pthreads implementation, I have been fighting an eratic crash
> issue. After many debugging logs and gdb backtrace logs they
> (The tor core team) came to the following conclusion about
> the probmlem:
>  "this seems to be a general symptom of NetBSD
> not having any way to do thread-safe DNS lookups"
> "We're now thinking it has to do with the fact that your platform has
> no gethostbyname_r functions, and the getaddrinfo function on netbsd,
> while claiming to be reentrant, actually isn't."

	see BUGS section of getaddrinfo(3) manpage.  we do claim that our
	implementation is NOT thread safe.  DNS lookup may be ok by now
	(due to the switch to BIND8 resolver), but NIS/hosts lookup are not
	thread safe at all.

> 2) Is this a known issue?