Bug 1284 - samba crashes and than losed locks
samba crashes and than losed locks
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.2a
All Linux
: P3 major
: none
Assigned To: Samba Bugzilla Account
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-22 08:51 UTC by Marek Veber
Modified: 2005-11-14 09:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Veber 2004-04-22 08:51:00 UTC
Package: samba
Version: 3.0.2a-0.backports.org.2

I've got some panic actions with samba (1-3 times in a day):
> The Samba 'panic action' script, /usr/share/samba/panic-action.2,
> was called for user 'miloslav.juren@rabatcr.cz', pid 31330 (/usr/sbin/smbd).
> 
> Below is a backtrace for this process generated with gdb, which shows
> the state of the program at the time the error occured.  You are
> encouraged to submit this information as a bug report to Debian.  For
> information about the procedure for submitting bug reports , please see
> http://www.debian.org/Bugs/Reporting or the reportbug(1) manpage.
> 
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> (no debugging symbols found)...(no debugging symbols found)...
> 0x402aea59 in wait4 () from /lib/libc.so.6
> #0  0x402aea59 in wait4 () from /lib/libc.so.6
> #1  0x40325e48 in __check_rhosts_file () from /lib/libc.so.6
> #2  0x402537c5 in system () from /lib/libc.so.6
> #3  0x0818538d in smb_panic ()
> #4  0x081760e3 in dbgtext ()
> #5  0x08176145 in dbgtext ()
> #6  0x402376b8 in sigaction () from /lib/libc.so.6
> #7  0x4027caa3 in free () from /lib/libc.so.6
> #8  0x080fb91b in rpc_spoolss_init ()
> #9  0x08124c1d in close_policy_hnd ()
> #10 0x080fbcd1 in invalidate_printer_hnd_cache ()
> #11 0x080fec54 in _spoolss_closeprinter ()
> #12 0x080f7dff in _srv_net_name_validate ()
> #13 0x08124221 in api_rpcTNP ()
> #14 0x08123f7a in api_pipe_request ()
> #15 0x0811e5a0 in free_pipe_context ()
> #16 0x0811e78c in free_pipe_context ()
> #17 0x0811e9f5 in free_pipe_context ()
> #18 0x0811ebaf in write_to_pipe ()
> #19 0x0811eb35 in write_to_pipe ()
> #20 0x0808773f in send_trans_reply ()
> #21 0x08087922 in send_trans_reply ()
> #22 0x080882bf in reply_trans ()
> #23 0x080ba04a in respond_to_all_remaining_local_messages ()
> #24 0x080ba0e3 in respond_to_all_remaining_local_messages ()
> #25 0x080ba383 in process_smb ()
> #26 0x080bacdf in smbd_process ()
> #27 0x081ddb3f in main ()
> #28 0x4022714f in __libc_start_main () from /lib/libc.so.6

In log:
[2004/04/22 10:02:33, 0] lib/fault.c:fault_report(36)
  ===============================================================
[2004/04/22 10:02:33, 0] lib/fault.c:fault_report(37)
  INTERNAL ERROR: Signal 11 in pid 31330 (3.0.2a-Debian)
  Please read the appendix Bugs of the Samba HOWTO collection
[2004/04/22 10:02:33, 0] lib/fault.c:fault_report(39)
  ===============================================================
[2004/04/22 10:02:33, 0] lib/util.c:smb_panic(1390)
  smb_panic(): calling panic action [/usr/share/samba/panic-action 31330]
[2004/04/22 10:02:33, 0] lib/util.c:smb_panic(1398)
  smb_panic(): action returned status 0
[2004/04/22 10:02:33, 0] lib/util.c:smb_panic(1400)
  PANIC: internal error
[2004/04/22 10:02:33, 0] lib/util.c:smb_panic(1408)
  BACKTRACE: 27 stack frames:
   #0 /usr/sbin/smbd(smb_panic+0x16b) [0x8185493]
   #1 /usr/sbin/smbd [0x81760e3]
   #2 /usr/sbin/smbd [0x8176145]
   #3 /lib/libc.so.6 [0x402376b8]
   #4 /lib/libc.so.6(__libc_free+0xa7) [0x4027caa3]
   #5 /usr/sbin/smbd [0x80fb91b]
   #6 /usr/sbin/smbd(close_policy_hnd+0xd1) [0x8124c1d]
   #7 /usr/sbin/smbd [0x80fbcd1]
   #8 /usr/sbin/smbd(_spoolss_closeprinter+0x44) [0x80fec540
   #9 /usr/sbin/smbd [0x80f7dff]
   #10 /usr/sbin/smbd(api_rpcTNP+0x221) [0x8124221]
   #11 /usr/sbin/smbd(api_pipe_request+0xca) [0x8123f7a]
   #12 /usr/sbin/smbd [0x811e5a0]
   #13 /usr/sbin/smbd [0x811e78c]
   #14 /usr/sbin/smbd [0x811e9f5]
   #15 /usr/sbin/smbd [0x811ebaf]
   #16 /usr/sbin/smbd(write_to_pipe+0xd9) [0x811eb35]
   #17 /usr/sbin/smbd [0x808773f]
   #18 /usr/sbin/smbd [0x8087922]
   #19 /usr/sbin/smbd(reply_trans+0x94f) [0x80882bf]
   #20 /usr/sbin/smbd [0x80ba04a]
   #21 /usr/sbin/smbd [0x80ba0e3]
   #22 /usr/sbin/smbd(process_smb+0x187) [0x80ba383]
   #23 /usr/sbin/smbd(smbd_process+0x14f) [0x80bacdf]
   #24 /usr/sbin/smbd(main+0x69b) [0x81ddb3f]
   #25 /lib/libc.so.6(__libc_start_main+0xbb) [0x4022714f]
   #26 /usr/sbin/smbd(ldap_msgfree+0x7d) [0x8077271]


Based on samba sources I created "dumping&hacking program" to detect garbage
(locks on non existing pids) in tables:
  /var/run/samba/brlock.tdb
  /var/run/samba/locking.tdb


After samba process crash my program reported:
> The result of command '/usr/sbin/samba-checker /var/run/samba show-bad-only':
> Byte range locks:
>    Pid     dev:inode  R/W      start        size     fnum      sPid      Tid
> ----------------------------------------------------------------------------
>  31330   0000b:5fc0ea    W         480            1 10737     65279         6
>  31330   0000b:5fc0ea    W         481            1 10737     65279         6
> Locked files:
> Pid    DenyMode   Access      R/W        Oplock           Name
> --------------------------------------------------------------
> 31330  DENY_WRITE 0x2019f     RDWR       NONE            
/home/domains/rabatcr.cz/rabat-1/miloslav.juren@rabatcr.cz/outlook/mailbox.pst 
 Thu Apr 22 06:09:04 2004

This garbage disables locking the file by other samba daemons :-(

It's impossible to restart whole samba to clean these 'stale locks'.
So my hack: '/usr/sbin/samba-checker /var/run/samba bad-remove' repairs
it "In my opinion correctly". If You wish I can send sources of 'my hack'.

But I prefer bug-fix :-) If you need more info I can send it.
>  # file /usr/sbin/smbd
>> /usr/sbin/smbd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), strippedIs it a good idea to create smbd
with debuging info and use it ?

Thanks for your help, with regards

Thanks for your help, with regards
-- 
 -----------------------------------------------
| Marek Veber     email: Marek.Veber@solnet.cz  |
| soLNet, s.r.o    http://www.solnet.cz         |
|               private:+42 / 0602/767386       |
|                 mobil:+42 / 0777/714457       |
|                jabber: mara@jabber.solnet.cz  |
|               ICQ UIN: 85222257               |
 -----------------------------------------------
Comment 1 Gerald (Jerry) Carter 2004-04-22 19:30:39 UTC
This is very probably fixed in 3.0.3rc1.   Please reopen if you 
can still reproduce it against that version.
Comment 2 Gerald (Jerry) Carter 2005-08-24 10:26:04 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 3 Gerald (Jerry) Carter 2005-11-14 09:29:37 UTC
database cleanup