[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gethostbyname()
From: |
Gordon Tetlow |
Subject: |
Re: gethostbyname() |
Date: |
Mon, 4 Jun 2001 10:57:41 -0700 (PDT) |
Hi! I'm the FreeBSD cfengine portmaintainer.
On Mon, 4 Jun 2001, t0m wrote:
> Anyone have any ideas on a problem we have, we're running cfengine on FreeBSD
> 4.1.1-RELEASE and have had a problem with gethostbyname() getting stuck and
> causing a loop which makes the cpu hit nearly max.
>
> PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
> 4255 root 63 0 2596K 1548K RUN 16:57 97.31% 97.31% cfengine
[snip]
> If anyone can explain why this is running gethostbyname() and not
> gethostbyname_r() considering it's in a threaded program that would be
> usefull.
Kris Kennaway first pointed this out to me. As I understand it, this is
because cfengine isn't really supposed to be linked against libc_r. cfd is
a threaded program and as such needs to be linked againt libc_r. Meanwhile
cfengine isn't threaded and is supposed to be linked against libc. But in
the way the compilation is done, it's one or the other. Anyway, this is a
bit over my head as I'm not the world's greatest coder (understatement of
the year) and my site isn't using cfengine atm (which I'm working on
changing). And hopefully this will all be a moot point when cfengine 2.0
comes out with it's own batch of problems.
> We have tried recompiling it with the -pthread option to LDFLAGS that the
> FreeBSD ports collection notes.
Right, well if you don't need cfd, try recompiling it without the -pthread
option and see how that works. Also, please let me know how it goes as I'm
painfully lacking on data about how the port does or does not work.
-gordo