[Prev][Next][Index][Thread]
libwww3.0 really isn't thread-safe...
-
To: www-lib@w3.org
-
Subject: libwww3.0 really isn't thread-safe...
-
From: Erik Selberg <speed@cs.washington.edu>
-
Date: Fri, 23 Jun 1995 16:02:24 PDT
-
From speed@cs.washington.edu Fri Jun 23 19: 02:26 1995
-
Message-Id: <199506232302.QAA25638@meitner.cs.washington.edu>
found this one today.
HTTCP.c and HTNews.c both use gethostbyname --- a seemingly innocuous
call, which returns a pointer to a static struct hostent.
wait, did someone say STATIC?
yup, that's right --- it ain't reentrant (at least on Alphas using
POSIX threads!). The fix? Easy enough --- use gethostbyname_r (the
re-entrant version) and #define _REENTRANT (or #define _THREAD_SAFE).
I'll post patches if someone likes.
Cheers,
-Erik