smbd panic at find_oplock_types().

Hemanth Thummala hemanth.thummala at gmail.com
Mon Aug 4 16:42:55 MDT 2014


Hi,

We are using samba 3.6.12+ stack. And we are hitting this smbd panic
customer site frequently(atleast once in a week). Couldn't reproduce this
issue in house but collected few details. This issue happens only with PDF
application files.

Here is the bt:
#0  0x0000000802cf3ffc in thr_kill () from /lib/libc.so.7
#1  0x0000000802d8f58b in abort () from /lib/libc.so.7
#2  0x00000000007925d1 in dump_core () at lib/fault.c:414
#3  0x00000000007a246f in smb_panic (why=<optimized out>) at lib/util.c:1133
#4  0x0000000000502276 in find_oplock_types (fsp=<optimized out>,
oplock_request=<optimized out>, lck=0x803781e50, pp_batch=0x7fffffffc5d0,
pp_ex_or_batch=0x7fffffffc5d8,
    got_level2=0x7fffffffc62d, got_no_oplock=0x7fffffffc62e) at
smbd/open.c:1112
#5  0x0000000000507c5e in open_file_ntcreate (fsp=<optimized out>,
pinfo=<optimized out>, private_flags=<optimized out>, oplock_request=0,
new_dos_attributes=0,
    create_options=<optimized out>, create_disposition=<optimized out>,
share_access=<optimized out>, access_mask=65664, req=<optimized out>,
conn=<optimized out>) at smbd/open.c:1942
#6  create_file_unixpath (conn=0x803753c50, req=0x803f28e00,
smb_fname=0x803f28f90, access_mask=65664, share_access=7,
create_disposition=1, create_options=<optimized out>,
    file_attributes=0, oplock_request=0, allocation_size=0,
private_flags=0, sd=0x0, ea_list=0x0, result=0x7fffffffc6d8,
pinfo=0x7fffffffc6e4) at smbd/open.c:3426
#7  0x0000000000508f4b in create_file_default (conn=0x803753c50,
req=0x803f28e00, root_dir_fid=0, smb_fname=0x803f28f90, access_mask=65664,
share_access=7, create_disposition=1,
    create_options=2097216, file_attributes=0, oplock_request=0,
allocation_size=0, private_flags=0, sd=0x0, ea_list=0x0,
result=0x7fffffffe328, pinfo=0x7fffffffe0d4) at smbd/open.c:3814


Panic is in find_oplock_types() at
if (lck->share_modes[i].op_type == NO_OPLOCK) {
if (*pp_batch || *pp_ex_or_batch) {
smb_panic("Bad no oplock entry."); ===> over here.
}
*got_no_oplock = true;
}


Here is the shared mode lock entry dump:
(gdb) p lck->share_modes[0]

$7 = {pid = {pid = ****1960****, vnn = 4294967295, unique_id =
5913386914170295756}, op_mid = 2475, op_type = 2, access_mask = 1442207,
share_access = 0, private_options = 0, time = {
    tv_sec = 1405534551, tv_usec = 782120}, id = {devid = 2377832956, inode
= 1411629584, extid = 0}, share_file_id = 853173925, uid = 270026576, flags
= 0, name_hash = 1856006537}
(gdb) p lck->share_modes[1]
$8 = {pid = {pid = ****1960****, vnn = 4294967295, unique_id =
5913386914170295756}, op_mid = 0, op_type = 0, access_mask = 0,
share_access = 7, private_options = 0, time = {tv_sec = 1405534593,
    tv_usec = 757982}, id = {devid = 2377832956, inode = 1411629584, extid
= 0}, share_file_id = 853173926, uid = 270026576, flags = 0, name_hash =
1856006537}

As you can observe, process 1960 has these oplocks. One with batch oplock
and other with no oplock.

Where as the PID for the current open request is not matching.
(gdb) f 6
#6  create_file_unixpath (conn=0x803753c50, req=0x803f28e00,
smb_fname=0x803f28f90, access_mask=65664, share_access=7,
create_disposition=1, create_options=<optimized out>,
    file_attributes=0, oplock_request=0, allocation_size=0,
private_flags=0, sd=0x0, ea_list=0x0, result=0x7fffffffc6d8,
pinfo=0x7fffffffc6e4) at smbd/open.c:3426
3426    in smbd/open.c
(gdb) p *req->sconn->msg_ctx
$9 = {id = {pid = ****40538****, vnn = 4294967295, unique_id =
5549152702172022726}, event_ctx = 0x80370e110, callbacks = 0x8037a5350,
local = 0x803738150, remote = 0x0}

I have actually two questions here.

1) Would like to know if client can really request no_oplock(with access
mask zero) when it already owns a batch oplock. From the code, I could see
that we do internal opens on base file when there is a open request comes
for stream file. In this case, there are no streams on the file.

2) In samba master I have seen the code to handle stale
PIDs(share_mode_stale_pid). I am assuming that this case also client would
have been disconnected and left the shared mode entries in the same state.
Would like to know if stale pid handling code is introduced to handle this
kind of issues. If so, I will need to port this part of code to samba 3.6.X

Thanks,
Hemanth.


More information about the samba-technical mailing list