[Samba] smbd processes 99% cpu and end-user locks up

Nathan Vidican nvidican at wmptl.com
Wed Oct 19 14:07:52 GMT 2005


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?


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

Jeremy Allison wrote:
> On Tue, Oct 18, 2005 at 04:28:44PM -0400, Nathan Vidican wrote:
> 
>>Still having a situation, in particular with Microsoft Office products 
>>(Excel, MS Word, etc), wherein a user locks up while saving a file.
>>
>>The scenario goes as follows:
>>
>>user opens up a file (excel document, word document, etc), user changes 
>>file, user hits save, user hangs...
>>
>>`top` reports an smbd belonging to user locked in some sort of loop 
>>causing 99% cpu utilization.
>>
>>net status sessions | grep 'usermachinename' reports two smbd processes 
>>belonging to the end user, the first (99% cpu), and the second.
>>
>>kill <looped process>   does nothing, kill -9 takes it out and the 
>>user's machine returns to normal, they save their file and we save the 
>>day until ten minutes later when someone else calls us with the same 
>>problem. This is happening a few time per hour, usually with a handfull 
>>of the same users (about 6-7 users have issues).
> 
> 
> Ensure that smbd is compiled with -g, and when the smbd is in this
> state attach to it with gdb and type "bt" to get a backtrace.
> 
> Please post the results of this to the list.
> 
> Thanks,
> 
> 	Jeremy.
> 
> 
-------------- next part --------------
# make >> make.output
rpc_parse/parse_prs.c: In function `prs_pointer':
rpc_parse/parse_prs.c:601: warning: cast from pointer to integer of different size
rpc_parse/parse_misc.c: In function `smb_io_dom_sid2_p':
rpc_parse/parse_misc.c:299: warning: cast from pointer to integer of different size
rpc_parse/parse_misc.c: In function `prs_io_unistr2_p':
rpc_parse/parse_misc.c:1006: warning: cast from pointer to integer of different size
rpc_parse/parse_misc.c: In function `prs_io_unistr2':
rpc_parse/parse_misc.c:1041: warning: cast from pointer to integer of different size
libsmb/ntlmssp_parse.c: In function `msrpc_parse':
libsmb/ntlmssp_parse.c:219: warning: cast to pointer from integer of different size
libsmb/ntlmssp_parse.c:247: warning: cast to pointer from integer of different size
libsmb/ntlmssp_parse.c:275: warning: cast to pointer from integer of different size
rpc_server/srv_reg_nt.c: In function `construct_registry_sd':
rpc_server/srv_reg_nt.c:87: warning: passing arg 8 of `make_sec_desc' from incompatible pointer type
rpc_server/srv_reg_nt.c: In function `make_default_reg_sd':
rpc_server/srv_reg_nt.c:1015: warning: passing arg 8 of `make_sec_desc' from incompatible pointer type
registry/regfio.c: In function `lookup_hbin_block':
registry/regfio.c:564: warning: cast from pointer to integer of different size
rpc_server/srv_svcctl_nt.c: In function `construct_scm_sd':
rpc_server/srv_svcctl_nt.c:102: warning: passing arg 8 of `make_sec_desc' from incompatible pointer type
rpc_server/srv_svcctl_nt.c: In function `construct_service_sd':
rpc_server/srv_svcctl_nt.c:137: warning: passing arg 8 of `make_sec_desc' from incompatible pointer type
rpc_parse/parse_buffer.c: In function `prs_rpcbuffer_p':
rpc_parse/parse_buffer.c:109: warning: cast from pointer to integer of different size
passdb/pdb_ldap.c: In function `init_sam_from_ldap':
passdb/pdb_ldap.c:707: warning: passing arg 3 of `pdb_nds_get_password' from incompatible pointer type
lib/iconv.c: In function `sys_iconv':
lib/iconv.c:139: warning: passing arg 2 of `libiconv' from incompatible pointer type
tdb/tdbutil.c: In function `tdb_unpack':
tdb/tdbutil.c:569: warning: cast to pointer from integer of different size
lib/smbldap.c: In function `free_attr_list':
lib/smbldap.c:270: warning: passing arg 1 of `free' discards qualifiers from pointer target type
lib/smbldap.c: In function `smbldap_check_root_dse':
lib/smbldap.c:1370: warning: passing arg 5 of `ldap_search_s' from incompatible pointer type
utils/smbcontrol.c: In function `do_printnotify':
utils/smbcontrol.c:431: warning: passing arg 3 of `notify_printer_byname' discards qualifiers from pointer target type
utils/profiles.c: In function `main':
utils/profiles.c:619: warning: cast from pointer to integer of different size
utils/ntlm_auth.c: In function `offer_gss_spnego_mechs':
utils/ntlm_auth.c:756: warning: assignment from incompatible pointer type
utils/ntlm_auth.c: In function `manage_client_ntlmssp_init':
utils/ntlm_auth.c:1055: warning: assignment from incompatible pointer type
utils/ntlm_auth.c: In function `manage_client_krb5_init':
utils/ntlm_auth.c:1205: warning: assignment from incompatible pointer type
utils/ntlm_auth.c: In function `manage_gss_spnego_client_request':
utils/ntlm_auth.c:1308: warning: initialization from incompatible pointer type
rpc_parse/parse_prs.c: In function `prs_pointer':
rpc_parse/parse_prs.c:601: warning: cast from pointer to integer of different size
rpc_parse/parse_misc.c: In function `smb_io_dom_sid2_p':
rpc_parse/parse_misc.c:299: warning: cast from pointer to integer of different size
rpc_parse/parse_misc.c: In function `prs_io_unistr2_p':
rpc_parse/parse_misc.c:1006: warning: cast from pointer to integer of different size
rpc_parse/parse_misc.c: In function `prs_io_unistr2':
rpc_parse/parse_misc.c:1041: warning: cast from pointer to integer of different size
libsmb/ntlmssp_parse.c: In function `msrpc_parse':
libsmb/ntlmssp_parse.c:219: warning: cast to pointer from integer of different size
libsmb/ntlmssp_parse.c:247: warning: cast to pointer from integer of different size
libsmb/ntlmssp_parse.c:275: warning: cast to pointer from integer of different size
lib/iconv.c: In function `sys_iconv':
lib/iconv.c:139: warning: passing arg 2 of `libiconv' from incompatible pointer type
tdb/tdbutil.c: In function `tdb_unpack':
tdb/tdbutil.c:569: warning: cast to pointer from integer of different size
libsmb/libsmbclient.c: In function `smbc_lseek_ctx':
libsmb/libsmbclient.c:1617: warning: passing arg 4 of `cli_getattrE' from incompatible pointer type
libsmb/libsmbclient.c: In function `smbc_telldir_ctx':
libsmb/libsmbclient.c:2824: warning: cast from pointer to integer of different size
libsmb/libsmbclient.c: In function `smbc_print_file_ctx':
libsmb/libsmbclient.c:4944: warning: cast from pointer to integer of different size
libsmb/libsmbclient.c:4953: warning: cast from pointer to integer of different size
libsmb/libsmb_compat.c: In function `smbc_open_print_job':
libsmb/libsmb_compat.c:423: warning: cast from pointer to integer of different size
rpc_parse/parse_buffer.c: In function `prs_rpcbuffer_p':
rpc_parse/parse_buffer.c:109: warning: cast from pointer to integer of different size
passdb/pdb_ldap.c: In function `init_sam_from_ldap':
passdb/pdb_ldap.c:707: warning: passing arg 3 of `pdb_nds_get_password' from incompatible pointer type
lib/smbldap.c: In function `free_attr_list':
lib/smbldap.c:270: warning: passing arg 1 of `free' discards qualifiers from pointer target type
lib/smbldap.c: In function `smbldap_check_root_dse':
lib/smbldap.c:1370: warning: passing arg 5 of `ldap_search_s' from incompatible pointer type


More information about the samba mailing list