Date: Wed, 26 Jul 2000 12:21:33 EDT From: "Greg Thompson" <johnnyteardrop@hotmail.com> To: freebsd-hackers@freebsd.org Subject: getipnodebyname Message-ID: <20000726162133.17863.qmail@hotmail.com>
next in thread | raw e-mail | index | archive | help
hackers, i have a multithreaded app that makes heavy use of sockets. i'm seeing a deadlock that looks like it's coming from getipnodebyname. it's my understanding that this guy is supposed to be threadsafe, but comments like this one in libc/net/getaddrinfo.c make me wonder: * Issues to be discussed: * - Thread safe-ness must be checked. have exhaustive tests been done against it? here are the stacks i'm seeing in two threads when my process locks up: #0 0x28181ebe in _thread_kern_sched () from /usr/lib/libc_r.so.4 #1 0x28182ad2 in _thread_kern_sched_state () from /usr/lib/libc_r.so.4 #2 0x281869fd in _thread_fd_lock_debug () from /usr/lib/libc_r.so.4 #3 0x281b918a in _close () from /usr/lib/libc_r.so.4 #4 0x28189faa in _res_close () from /usr/lib/libc_r.so.4 #5 0x28189ab4 in res_send () from /usr/lib/libc_r.so.4 #6 0x2818cc90 in res_query () from /usr/lib/libc_r.so.4 #7 0x2818d16c in res_querydomain () from /usr/lib/libc_r.so.4 #8 0x2818c529 in freehostent () from /usr/lib/libc_r.so.4 #9 0x2818c808 in freehostent () from /usr/lib/libc_r.so.4 #10 0x2818a8e8 in _thread_sys_poll () from /usr/lib/libc_r.so.4 #11 0x2818aa2a in _getipnodebyname_multi () from /usr/lib/libc_r.so.4 #12 0x2818ab11 in getipnodebyname () from /usr/lib/libc_r.so.4 #0 0x28181ebe in _thread_kern_sched () from /usr/lib/libc_r.so.4 #1 0x28182ad2 in _thread_kern_sched_state () from /usr/lib/libc_r.so.4 #2 0x281a1535 in recvfrom () from /usr/lib/libc_r.so.4 #3 0x28189af7 in res_send () from /usr/lib/libc_r.so.4 #4 0x2818cc90 in res_query () from /usr/lib/libc_r.so.4 #5 0x2818d16c in res_querydomain () from /usr/lib/libc_r.so.4 #6 0x2818c529 in freehostent () from /usr/lib/libc_r.so.4 #7 0x2818c808 in freehostent () from /usr/lib/libc_r.so.4 #8 0x2818a8e8 in _thread_sys_poll () from /usr/lib/libc_r.so.4 #9 0x2818aa2a in _getipnodebyname_multi () from /usr/lib/libc_r.so.4 #10 0x2818ab11 in getipnodebyname () from /usr/lib/libc_r.so.4 if i mutex-protect the call to getipnodebyname, my process does not lock up. i can try to make a small repro case if anyone has doubts about the threadsafeness of this function. thanks. -- -greg ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000726162133.17863.qmail>