Bug 2563 - infinite loop in smbd on stat non existent file
infinite loop in smbd on stat non existent file
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.13
All Windows XP
: P3 normal
: none
Assigned To: Jeremy Allison
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-01 05:02 UTC by Alex Deiter
Modified: 2005-08-24 10:26 UTC (History)
0 users

See Also:


Attachments
Proposed patch. (388 bytes, patch)
2005-04-01 12:52 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Deiter 2005-04-01 05:02:23 UTC
I found infinite loop in smbd on stat non existent file.

top report me:
  PID USERNAME       PRI NICE   SIZE    RES STATE    TIME   WCPU    CPU COMMAND
47914 dav            124    0  9404K  5036K RUN      7:58 61.77% 61.77% smbd

truss -o 47914 -p 47914 report:
...
stat("abon/test.xls",0xbfbfdd60) ERR#2 'No such file or directory'
stat("abon/test.xls",0xbfbfdd60) ERR#2 'No such file or directory'
stat("abon/test.xls",0xbfbfdd60) ERR#2 'No such file or directory'
stat("abon/test.xls",0xbfbfdd60) ERR#2 'No such file or directory'
...

# gdb /usr/local/sbin/smbd 47914 report me:
GNU gdb 6.1.1 [FreeBSD]
...
(gdb) bt
#0  0x28568c0b in stat () from /lib/libc.so.5
#1  0x08194a27 in sys_stat ()
#2  0x080ba37d in vfswrap_stat ()
#3  0x0808337d in get_dir_entry ()
#4  0x080836e5 in is_visible_file ()
#5  0x08082ace in dptr_SearchDir ()
#6  0x080a7e8a in get_allocation_size ()
#7  0x080af9d8 in reply_trans2 ()
#8  0x080c48a8 in respond_to_all_remaining_local_messages ()
#9  0x080c4939 in respond_to_all_remaining_local_messages ()
#10 0x080c4c52 in process_smb ()
#11 0x080c57a6 in smbd_process ()
#12 0x081fcad4 in main ()

Thanks!
Comment 1 Jeremy Allison 2005-04-01 12:52:33 UTC
Created attachment 1130 [details]
Proposed patch.

I think this will fix it.
Jeremy.
Comment 2 Jeremy Allison 2005-04-01 12:54:14 UTC
Ok, I'm pretty sure the fix I've just applied will fix the
problem. Can you try it out and confirm ?

Thanks,

Jeremy.
Comment 3 Alex Deiter 2005-04-02 07:42:51 UTC
Many thanks! I have applied this patch and I can test it in heavy production on
Monday when working week will begin.
Comment 4 Alex Deiter 2005-04-05 03:17:56 UTC
Work fine for me!

Thanks a lot!
Comment 5 Jeremy Allison 2005-04-05 13:15:41 UTC
Problem fixed with patch. Will be in 3.0.14.
Jeremy.
Comment 6 Gerald (Jerry) Carter 2005-08-24 10:26:12 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.