Bug 1743 - PANIC: deferred_open_entries_identical: logic error.
Summary: PANIC: deferred_open_entries_identical: logic error.
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.6
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Jeremy Allison
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-09 06:49 UTC by Helmut Heinreichsberger
Modified: 2005-08-24 10:16 UTC (History)
0 users

See Also:


Attachments
Patch for this bug. (948 bytes, patch)
2004-09-18 18:15 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Heinreichsberger 2004-09-09 06:49:30 UTC
Server: Linux 2.4.27 SMP
Client: WinXP SP1




This Panic Action was ONCE at normal operation, in six days of running this 
Server.
------------------------------------------------------------------
[2004/09/09 13:56:28, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir1/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:28, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:28, 2] smbd/open.c:check_share_mode(521)
  Share violation on file (2,4,2,7055,Dir1/Dir2/File1.xls,fcbopen = 0, flags = 
0) = 0
[2004/09/09 13:56:28, 2] smbd/open.c:open_file(245)
  UserName opened file Dir1/Dir2/File1.xls read=Yes write=No (numopen=3)
[2004/09/09 13:56:28, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2) inheriting from Dir1
[2004/09/09 13:56:28, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/Thumbs.db) inheriting from Dir1/Dir2
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/Thumbs.db) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/open.c:check_share_mode(521)
  Share violation on file (1,4,2,7055,Dir1/Dir2/File1.xls,fcbopen = 0, flags = 
0) = 0
[2004/09/09 13:56:29, 2] smbd/open.c:open_file(245)
  UserName opened file Dir1/Dir2/File1.xls read=Yes write=No (numopen=3)
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/open.c:check_share_mode(521)
  Share violation on file (1,4,2,7055,Dir1/Dir2/File1.xls,fcbopen = 0, flags = 
0) = 0
[2004/09/09 13:56:29, 2] smbd/open.c:open_file(245)
  UserName opened file Dir1/Dir2/File1.xls read=Yes write=No (numopen=3)
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/open.c:open_file(245)
  UserName opened file Dir1/Dir2/File1.xls read=Yes write=No (numopen=3)
[2004/09/09 13:56:29, 2] smbd/close.c:close_normal_file(262)
  username closed file Dir1/Dir2/File1.xls (numopen=2)
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/open.c:check_share_mode(521)
  Share violation on file (1,4,2,7055,Dir1/Dir2/File1.xls,fcbopen = 0, flags = 
0) = 0
[2004/09/09 13:56:29, 2] smbd/open.c:open_file(245)
  UserName opened file Dir1/Dir2/File1.xls read=Yes write=No (numopen=3)
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:29, 2] smbd/open.c:check_share_mode(521)
  Share violation on file (1,4,2,7055,Dir1/Dir2/File1.xls,fcbopen = 0, flags = 
0) = 0
[2004/09/09 13:56:29, 2] smbd/open.c:open_file(245)
  UserName opened file Dir1/Dir2/File1.xls read=Yes write=No (numopen=3)
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2) inheriting from Dir1
[2004/09/09 13:56:29, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2) inherit mode 42775
[2004/09/09 13:56:30, 2] smbd/dosmode.c:unix_mode(60)
  unix_mode(Dir1/Dir2/File1.xls) inheriting from Dir1/Dir2
[2004/09/09 13:56:30, 2] smbd/dosmode.c:unix_mode(68)
  unix_mode(Dir1/Dir2/File1.xls) inherit mode 42775
[2004/09/09 13:56:30, 0] lib/util.c:smb_panic2(1375)
  smb_panic(): calling panic action [/usr/share/samba/panic-action 11419]
[2004/09/09 13:56:30, 0] lib/util.c:smb_panic2(1383)
  smb_panic(): action returned status 0
[2004/09/09 13:56:30, 0] lib/util.c:smb_panic2(1385)
  PANIC: PANIC: deferred_open_entries_identical: logic error.

[2004/09/09 13:56:30, 0] lib/util.c:smb_panic2(1393)
  BACKTRACE: 12 stack frames:
   #0 /usr/sbin/smbd(smb_panic2+0x68) [0x81a76b8]
   #1 /usr/sbin/smbd(smb_panic+0x11) [0x81a7871]
   #2 /usr/sbin/smbd(delete_deferred_open_entry+0x2f0) [0x81789f0]
   #3 /usr/sbin/smbd [0x80b4db6]
   #4 /usr/sbin/smbd(open_file_shared1+0x187) [0x80b51f7]
   #5 /usr/sbin/smbd(reply_ntcreate_and_X+0x6cb) [0x809311b]
   #6 /usr/sbin/smbd [0x80c4db3]
   #7 /usr/sbin/smbd(process_smb+0x163) [0x80c5173]
   #8 /usr/sbin/smbd(smbd_process+0x13e) [0x80c5d8e]
   #9 /usr/sbin/smbd(main+0x444) [0x81fd634]
   #10 /lib/libc.so.6(__libc_start_main+0xc6) [0x4009cdc6]
   #11 /usr/sbin/smbd(chroot+0x35) [0x8075401]
-------------------------------------------------------------
smb.conf:
# Global parameters
[global]

# Do something sensible when Samba crashes: mail the admin a backtrace
    panic action = /usr/share/samba/panic-action %d
    workgroup = Workgroup
    netbios name = SERVER
    server string = Server von Meinem System
    interfaces = eth0
    encrypt passwords = true
#    passdb backend = smbpasswd guest
    passwd program = /usr/bin/passwd %u
    password server = pwserver.mydomain.com
    security = server
    syslog = 0
    log level = 2
    log file = /var/log/samba/log.%m
    max log size = 4096
    name resolve order = hosts lmhost bcast
    lpq cache time = 5
    unix charset = ISO8859-1
    lm announce = False
    comment = Datenserver %h
    writeable = Yes
#   writeable = No
    hide dot files = No
    delete readonly = Yes
    dos filetimes = Yes
    dos filetime resolution = Yes
    fake directory create times = Yes
    veto files = /*.{?*}/
    inherit permissions = yes

    load printers = No

    create mask = 0777

    deadtime = 600
    strict allocate = Yes

    vfs objects = vscan-clamav
    vscan-clamav: config-file = /etc/samba/vscan-clamav.conf

[homes]
    comment = Home Directories
    path = /users/%u
    valid users = %S
    browseable = No
    writeable = Yes

[service]
    comment = Globaler Datenaustausch
    path = /projekte/service
    valid users = +service
    force group = service
Comment 1 Jeremy Allison 2004-09-09 16:43:52 UTC
Is there any chance of reproducing this problem ? I need to see a dump of
the share mode database to see what may have happened here. Reproducing it
would be neccessary I think.

Jeremy.
Comment 2 Helmut Heinreichsberger 2004-09-09 23:46:36 UTC
we only had this error once, and the user sad that he did no abnormaly things. 
But what I had seen is, that the user have a speedy finger by double clicks on 
the file. The system now runs 6 days, with 30 users and 5 shares/user 
permanently connected, so i can say, that this problem is very rare. The only 
thing, that I seen, was the sharing violation.
Comment 3 Jeremy Allison 2004-09-10 19:07:54 UTC
Ok, thanks for that. What that means is we do have a race condition, it's
just a really narrow window and hard to trigger :-). I'll look over the
logic in the code and see if I can spot the problem by sheer will-power :-).
Thanks,
Jeremy.
Comment 4 Michael Dance 2004-09-14 06:14:24 UTC
I am getting this error regularly since we upgraded to 3.0 2 weeks ago.

If you need a tdb I can supply you one.

My email is md1@createservices.com
Comment 5 Jeremy Allison 2004-09-16 13:57:06 UTC
It's very unlikely you got this message if you upgraded *to* 3.0.2, as the
deferred open code didn't go into Samba until 3.0.6. Can you clarify please ?

Jeremy.
Comment 6 Jeremy Allison 2004-09-18 18:15:18 UTC
Created attachment 670 [details]
Patch for this bug.
Comment 7 Jeremy Allison 2004-09-18 18:16:07 UTC
Arggg. Stupid, stupid, stupid me ! I added a paranoia test
case when I was developing the deferred open case and made it
too tight. It will fire (incorrectly) and panic when a client
does a second open for a file with a different mid (multiplex-id)
request. Doh ! This is a perfectly valid thing for a client to
do (have two pending opens with different mids outstanding on
the same file) and currently when the first pending open expires
with a share violation the paranoia code will panic smbd.
                                                                               
                 
It's a rare condition, but obvious now I've looked at the
code.


Fixed in SVN.

Jeremy.
Comment 8 Michael Dance 2004-09-21 05:07:29 UTC
(In reply to comment #5)
> It's very unlikely you got this message if you upgraded *to* 3.0.2, as the
> deferred open code didn't go into Samba until 3.0.6. Can you clarify please ?
> 
> Jeremy.
> 
Nice to see it's now fixed, the clarification would have been "upgraded to
3.0.6, two weeks ago" and not "upgraded to 3.0 2 weeks ago".... Not the best way
of putting it, I have to admit!
Comment 9 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:16:27 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.