bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gethostbyname()


From: t0m
Subject: gethostbyname()
Date: Mon, 04 Jun 2001 14:25:23 GMT
User-agent: slrn/0.9.7.0 (FreeBSD)

Hi,

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

Stopping the process and keeping the core, gdb gave us this:

Reading symbols from /usr/libexec/ld-elf.so.1...done.
0x281e9de0 in _thread_sys_poll () from /usr/lib/libc_r.so.4 
(gdb) bt
#0  0x281e9de0 in _thread_sys_poll () from /usr/lib/libc_r.so.4 
#1  0x281e8ca7 in _thread_kern_sched_state_unlock () from /usr/lib/libc_r.so.4
#2  0x281e80ba in _thread_kern_sched () from /usr/lib/libc_r.so.4
#3  0x281e87b6 in _thread_kern_sched_state () from /usr/lib/libc_r.so.4
#4  0x281efc62 in kevent () from /usr/lib/libc_r.so.4
#5  0x281ef5c4 in res_send () from /usr/lib/libc_r.so.4
#6  0x281f2890 in res_query () from /usr/lib/libc_r.so.4
#7  0x281f2d6c in res_querydomain () from /usr/lib/libc_r.so.4
#8  0x281f2aae in res_search () from /usr/lib/libc_r.so.4
#9  0x281fe492 in _gethostbydnsname () from /usr/lib/libc_r.so.4
#10 0x281fcf78 in gethostbyname2 () from /usr/lib/libc_r.so.4
#11 0x281fcef4 in gethostbyname () from /usr/lib/libc_r.so.4
#12 0x805e72b in GetNameInfo () at misc.c:241
#13 0x804a123 in main (argc=3, argv=0xbfbffd7c) at cfengine.c:83
#14 0x804a045 in _start ()
(gdb) frame 12
#12 0x805e72b in GetNameInfo () at misc.c:241
241     if ((hp = gethostbyname(VSYSNAME.nodename)) == NULL)
(gdb) print VSYSNAME.nodename
$1 = "blahblah.uk.clara.net", '\000' <repeats 12 times>
(gdb) frame 13
#13 0x804a123 in main (argc=3, argv=0xbfbffd7c) at cfengine.c:83
83         GetNameInfo();
(gdb) quit
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: /usr/local/sbin/cfengine, process 4255, thread 1
ptrace: No such process.  

If anyone can explain why this is running gethostbyname() and not 
gethostbyname_r() considering it's in a threaded program that would be usefull. 

We have tried recompiling it with the -pthread option to LDFLAGS that the 
FreeBSD ports collection notes.

Many thanks.

--------------------------------------------------------------------------------
Tom Hughes                                                      address@hidden
ClaraNET UK Ltd. Network Operations Team                    http://www.clara.net
System Administrator                                        



reply via email to

[Prev in Thread] Current Thread [Next in Thread]