Bug 7451 - nss_wins freezes in FUTEX - blocks anything samba
Summary: nss_wins freezes in FUTEX - blocks anything samba
Status: NEW
Alias: None
Product: Samba 3.4
Classification: Unclassified
Component: Winbind (show other bugs)
Version: 3.4.6
Hardware: x64 Linux
: P3 normal
Target Milestone: ---
Assignee: Michael Adam
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-22 16:45 UTC by Rick Moritz
Modified: 2010-05-22 16:54 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Moritz 2010-05-22 16:45:21 UTC
Steps to reproduce: add wins entry to host lookup mechanism in /etc/nsswitch.conf
set security=ads in smb.conf and run samba in role=domain_member mode.
run net (without any parameters) or smbd -i or any other samba tool.
Watch it grind to a halt. (smbd -id 100 - right after initializing the interfaces)
strace will tell you that a FUTEX will not return.
gdb gives:
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...
(gdb) start
Breakpoint 1 at 0x4857a0: file utils/net.c, line 619.
Starting program: /usr/bin/net
[Thread debugging using libthread_db enabled]
[New Thread 0x75712db7f750 (LWP 9220)]
[Switching to Thread 0x75712db7f750 (LWP 9220)]
main (argc=1, argv=0x7f8801dd4908) at utils/net.c:619
619     utils/net.c: No such file or directory.
        in utils/net.c
(gdb) continue
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x000075712a8ba7c4 in __lll_lock_wait () from /lib/libpthread.so.0
(gdb) bt
#0  0x000075712a8ba7c4 in __lll_lock_wait () from /lib/libpthread.so.0
#1  0x000075712a8b6029 in _L_lock_534 () from /lib/libpthread.so.0
#2  0x000075712a8b5e3e in pthread_mutex_lock () from /lib/libpthread.so.0
#3  0x000075712912f0a7 in _nss_wins_gethostbyname_r (hostname=0x75712d9f4920 "eth1", he=0x80, buffer=0x0, buflen=18446744073709551615,
    h_errnop=0x75712955de40) at ../nsswitch/wins.c:338
#4  0x000075712912f67d in _nss_wins_gethostbyname2_r (name=0x75712955de40 "\002", af=<value optimized out>, he=0x7f8801dd2990,
    buffer=0x0, buflen=18446744073709551615, h_errnop=0x2404) at ../nsswitch/wins.c:441
#5  0x000075712ad8ce8a in ?? () from /lib/libc.so.6
#6  0x000075712ad8ed01 in getaddrinfo () from /lib/libc.so.6
#7  0x00007571292075ef in interpret_string_addr_internal (ppres=0x7f8801dd2c68, str=0x75712d9f4920 "eth1", flags=32)
    at ../lib/util/util_net.c:48
#8  0x000075712922a6a5 in interpret_string_addr (pss=0x7f8801dd3050, str=0x75712d9f4920 "eth1", flags=0) at lib/util_sock.c:57
#9  0x00007571292168e2 in interpret_interface (token=0x75712d9f4920 "eth1") at lib/interface.c:387
#10 0x000075712921707f in load_interfaces () at lib/interface.c:542
#11 0x000075712912f16e in _nss_wins_gethostbyname_r (hostname=0x75712db3d390 "eth1", he=0x7f8801dd3920, buffer=0x7f8801dd33a0 "ΓΏ\002",
    buflen=1024, h_errnop=<value optimized out>) at ../nsswitch/wins.c:102
#12 0x000075712912f67d in _nss_wins_gethostbyname2_r (name=0x75712955de40 "\002", af=<value optimized out>, he=0x7f8801dd2990,
    buffer=0x0, buflen=18446744073709551615, h_errnop=0x2404) at ../nsswitch/wins.c:441
#13 0x000075712ad8ce8a in ?? () from /lib/libc.so.6
#14 0x000075712ad8ed01 in getaddrinfo () from /lib/libc.so.6
#15 0x00000000005b69cf in interpret_string_addr_internal (ppres=0x7f8801dd3bf8, str=0x75712db3d390 "eth1", flags=32)
    at ../lib/util/util_net.c:48
#16 0x00000000005d9a85 in interpret_string_addr (pss=0x7f8801dd3fe0, str=0x75712db3d390 "eth1", flags=0) at lib/util_sock.c:57
#17 0x00000000005c5cc2 in interpret_interface (token=0x75712db3d390 "eth1") at lib/interface.c:387
#18 0x00000000005c645f in load_interfaces () at lib/interface.c:542
#19 0x0000000000486023 in main (argc=1, argv=0x7f8801dd4908) at utils/net.c:760
(gdb)

removing wins lookup in nsswitch.conf results in not hitting this deadlock

this is on kernel 2.6.28-r9 (gentoo hardened stable)

As currently the wiki-entry http://wiki.samba.org/index.php/Samba_%26_Active_Directory recommends setting wins lookups for hosts, when using ad integration, this is a bit of a mess.
Comment 1 Volker Lendecke 2010-05-22 16:54:37 UTC
Thanks for reporting this!

It might take a bit though to fix, we need to convert nsswitch/wins.c to work via winbind. It is a mistake for that module to do the name lookups and everything itself.

Volker