[Samba] smbd processes 99% cpu and end-user locks up (good gdb attached)

Nathan Vidican nvidican at wmptl.com
Wed Oct 19 15:43:23 GMT 2005


Thanks, makes sense... so I waited for another (locked up) pid, and did a `gdb 
/usr/samba/sbin/smbd <pid>` , and got a (hopefully useful) gdb output. I have 
atatched the output here, along with the logfile of the user which the smbd 
process belonged to when it happened.

So here goes guys, what next?


-- 
Nathan Vidican
nvidican at wmptl.com
Windsor Match Plate & Tool Ltd.
http://www.wmptl.com/

Martin Zielinski wrote:
> On Linux the syntax is gdb -p <pid>.
>                            ^^^
> The "..39389: No such file..." message seems to tell, that you didn't 
> attach to the process but tried to debug a file called 39389.
> 
> 
> 
> Nathan Vidican wrote:
> 
>> Okay, re-compiled with -g, (I think), assuming the -g was to CFLAGS, I 
>> attached the output of ./configure --prefix=/usr/samba CFLAGS=-g, the 
>> output of make, and the warnings reported by make.
>>
>> When I run a `top` and get an output similar to this (pardon the 
>> word-wrap mangling):
>>
>> last pid: 39681;  load averages:  1.04,  1.02,  0.88   up 3+17:11:28 
>> 10:06:34
>> 67 processes:  1 running, 66 sleeping
>> CPU states:  6.9% user,  0.0% nice, 43.1% system,  0.0% interrupt, 
>> 50.0% idle
>> Mem: 56M Active, 1530M Inact, 228M Wired, 59M Cache, 213M Buf, 9144K Free
>> Swap: 4087M Total, 48K Used, 4087M Free
>>
>>   PID USERNAME       THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU 
>> COMMAND
>> 39389 root             1 114    0 30716K  8704K CPU0   0  33:04 99.17% 
>> smbd
>>   494 ldap             4  20    0   118M  7768K kserel 0   0:20  0.00% 
>> slapd
>>  7249 root             1  96    0 21460K  4188K select 0   0:07  0.00% 
>> cupsd
>>   318 root             1  96    0  3532K   940K select 0   0:03  0.00% 
>> syslogd
>> 39470 root             1  96    0 30852K  8836K select 0   0:03  0.00% 
>> smbd
>> 39505 pcarlini         1  96    0 31256K  9292K select 1   0:03  0.00% 
>> smbd
>>
>>
>> I then tried a 'gdb 39389', which gave me a prompt something like this:
>>
>> GNU gdb 6.1.1 [FreeBSD]
>> Copyright 2004 Free Software Foundation, Inc.
>> GDB is free software, covered by the GNU General Public License, and 
>> you are
>> welcome to change it and/or distribute copies of it under certain 
>> conditions.
>> Type "show copying" to see the conditions.
>> There is absolutely no warranty for GDB.  Type "show warranty" for 
>> details.
>> This GDB was configured as "amd64-marcel-freebsd"...39389: No such 
>> file or directory.
>>
>> (gdb)
>>
>> Where I then tried 'bt' as you instructed and got:
>>
>> (gdb) bt
>> No stack.
>> (gdb)
>>
>> What am I doing wrong? Admittedly never done anything before with gdb 
>> and not too sure of what I'm doing here... assuming CFLAGS=-g was what 
>> you meant by compile smbd with -g, and I didn't get any warnings 
>> running gdb <pid>, so assuming it worked... what next?
>>
>>
> 
> 
-------------- next part --------------
wmptwo# gdb /usr/samba/sbin/smbd 39579
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Attaching to program: /usr/samba/sbin/smbd, process 39579
Reading symbols from /usr/local/lib/libldap-2.2.so.7...done.
Loaded symbols for /usr/local/lib/libldap-2.2.so.7
Reading symbols from /usr/local/lib/liblber-2.2.so.7...done.
Loaded symbols for /usr/local/lib/liblber-2.2.so.7
Reading symbols from /usr/lib/libgssapi.so.8...done.
Loaded symbols for /usr/lib/libgssapi.so.8
Reading symbols from /usr/lib/libkrb5.so.8...done.
Loaded symbols for /usr/lib/libkrb5.so.8
Reading symbols from /usr/lib/libasn1.so.8...done.
Loaded symbols for /usr/lib/libasn1.so.8
Reading symbols from /lib/libcrypto.so.4...done.
Loaded symbols for /lib/libcrypto.so.4
Reading symbols from /usr/lib/libroken.so.8...done.
Loaded symbols for /usr/lib/libroken.so.8
Reading symbols from /lib/libcrypt.so.3...done.
Loaded symbols for /lib/libcrypt.so.3
Reading symbols from /usr/lib/libcom_err.so.3...done.
Loaded symbols for /usr/lib/libcom_err.so.3
Reading symbols from /usr/local/lib/libcups.so.2...done.
Loaded symbols for /usr/local/lib/libcups.so.2
Reading symbols from /usr/local/lib/libgnutls.so.12...done.
Loaded symbols for /usr/local/lib/libgnutls.so.12
Reading symbols from /usr/local/lib/libgcrypt.so.13...done.
Loaded symbols for /usr/local/lib/libgcrypt.so.13
Reading symbols from /usr/local/lib/libgpg-error.so.1...done.
Loaded symbols for /usr/local/lib/libgpg-error.so.1
Reading symbols from /lib/libz.so.3...done.
Loaded symbols for /lib/libz.so.3
Reading symbols from /usr/local/lib/libiconv.so.3...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /usr/lib/libssl.so.4...done.
Loaded symbols for /usr/lib/libssl.so.4
Reading symbols from /usr/local/lib/libintl.so.6...done.
Loaded symbols for /usr/local/lib/libintl.so.6
Reading symbols from /usr/local/lib/nss_ldap.so.1...done.
Loaded symbols for /usr/local/lib/nss_ldap.so.1
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
0x0000000801cdc1dc in select () from /lib/libc.so.6
(gdb) bt
#0  0x0000000801cdc1dc in select () from /lib/libc.so.6
#1  0x000000080097ab45 in ldap_result () from /usr/local/lib/libldap-2.2.so.7
#2  0x000000080097f32b in ldap_sasl_bind_s () from /usr/local/lib/libldap-2.2.so.7
#3  0x000000080097f830 in ldap_simple_bind_s () from /usr/local/lib/libldap-2.2.so.7
#4  0x00000000006bc278 in smbldap_connect_system (ldap_state=0x90eb48, ldap_struct=0x991200) at lib/smbldap.c:780
#5  0x00000000006bc787 in smbldap_open (ldap_state=0x90eb48) at lib/smbldap.c:860
#6  0x00000000006bca2b in another_ldap_try (ldap_state=0x90eb48, rc=0x7fffffffd4d0, attempts=0x7fffffffd4cc, endtime=1129735908)
    at lib/smbldap.c:937
#7  0x00000000006bce7f in smbldap_search_ext (ldap_state=0x90eb48, base=0x98dc48 "dc=wmptl,dc=net", scope=2,
    filter=0x7fffffffd6f0 "(&(sambaSID=S-1-5-21-2818898263-1345796712-1011627658-1001)(objectclass=sambaSamAccount))", attrs=0x950c00,
    attrsonly=0, sctrls=0x0, cctrls=0x0, sizelimit=0, res=0x7fffffffdcb8) at lib/smbldap.c:1026
#8  0x00000000006bcfad in smbldap_search (ldap_state=0x90eb48, base=0x98dc48 "dc=wmptl,dc=net", scope=2,
    filter=0x7fffffffd6f0 "(&(sambaSID=S-1-5-21-2818898263-1345796712-1011627658-1001)(objectclass=sambaSamAccount))", attrs=0x950c00,
    attrsonly=0, res=0x7fffffffdcb8) at lib/smbldap.c:1050
#9  0x00000000006bdaf1 in smbldap_search_suffix (ldap_state=0x90eb48,
    filter=0x7fffffffd6f0 "(&(sambaSID=S-1-5-21-2818898263-1345796712-1011627658-1001)(objectclass=sambaSamAccount))", search_attr=0x950c00,
    result=0x7fffffffdcb8) at lib/smbldap.c:1239
#10 0x00000000005eadfd in ldapsam_search_suffix_by_sid (ldap_state=0x90ea48, sid=0x98da98, result=0x7fffffffdcb8, attr=0x950c00)
    at passdb/pdb_ldap.c:252
#11 0x00000000005ee6b8 in ldapsam_get_ldap_user_by_sid (ldap_state=0x90ea48, sid=0x98da98, result=0x7fffffffdcb8) at passdb/pdb_ldap.c:1372
#12 0x00000000005ee787 in ldapsam_getsampwsid (my_methods=0x8d0c48, user=0x988448, sid=0x98da98) at passdb/pdb_ldap.c:1408
#13 0x00000000005e21a1 in context_getsampwsid (context=0x8d0a48, sam_acct=0x988448, sid=0x98da98) at passdb/pdb_interface.c:222
#14 0x00000000005e4b7f in pdb_getsampwsid (sam_acct=0x988448, sid=0x98da98) at passdb/pdb_interface.c:1015
#15 0x00000000005dddbc in local_sid_to_uid (puid=0x98dae4, psid=0x98da98, name_type=0x7fffffffdddc) at passdb/passdb.c:1193
#16 0x00000000005e98c9 in sid_to_uid (psid=0x98da98, puid=0x98dae4) at passdb/lookup_sid.c:395
#17 0x00000000004b9863 in create_canon_ace_lists (fsp=0x90ec00, pst=0x7fffffffe540, pfile_owner_sid=0x7fffffffe4f0,
    pfile_grp_sid=0x7fffffffe4a0, ppfile_ace=0x7fffffffe3d0, ppdir_ace=0x7fffffffe3c8, dacl=0x921cc8) at smbd/posix_acls.c:1393
#18 0x00000000004ba92e in unpack_canon_ace (fsp=0x90ec00, pst=0x7fffffffe540, pfile_owner_sid=0x7fffffffe4f0, pfile_grp_sid=0x7fffffffe4a0,
    ppfile_ace=0x7fffffffe498, ppdir_ace=0x7fffffffe490, security_info_sent=2147483652, psd=0x921c48) at smbd/posix_acls.c:1945
#19 0x00000000004bebd7 in set_nt_acl (fsp=0x90ec00, security_info_sent=2147483652, psd=0x921c48) at smbd/posix_acls.c:3175
#20 0x00000000004b48da in vfswrap_fset_nt_acl (handle=0x0, fsp=0x90ec00, fd=-1, security_info_sent=2147483652, psd=0x921c48)
    at smbd/vfs-wrap.c:837
#21 0x000000000046ec52 in set_sd (fsp=0x90ec00, data=0x90ef00 "\001", sd_len=144, security_info_sent=2147483652) at smbd/nttrans.c:1041
#22 0x000000000047283c in call_nt_transact_set_security_desc (conn=0x955048, inbuf=0x92f000 "", outbuf=0x961000 "", length=232, bufsize=131072,
    ppsetup=0x7fffffffe7c0, setup_count=0, ppparams=0x7fffffffe7d0, parameter_count=8, ppdata=0x7fffffffe7c8, data_count=144, max_data_count=0)
    at smbd/nttrans.c:2087
#23 0x0000000000474aca in reply_nttrans (conn=0x955048, inbuf=0x92f000 "", outbuf=0x961000 "", length=232, bufsize=131072)
    at smbd/nttrans.c:2990
#24 0x00000000004c4792 in switch_message (type=160, inbuf=0x92f000 "", outbuf=0x961000 "", size=232, bufsize=131072) at smbd/process.c:991
#25 0x00000000004c4866 in construct_reply (inbuf=0x92f000 "", outbuf=0x961000 "", size=232, bufsize=131072) at smbd/process.c:1021
#26 0x00000000004c4c3e in process_smb (inbuf=0x92f000 "", outbuf=0x961000 "") at smbd/process.c:1121
#27 0x00000000004c5ecf in smbd_process () at smbd/process.c:1670
#28 0x00000000006c12e2 in main (argc=2, argv=0x7fffffffebb8) at smbd/server.c:975
(gbd) quit


More information about the samba mailing list