samba PANIC: failed to set uid

Bug #341816 reported by Jan Schneider
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: samba

Samba crashes with the following backtrace:

[2009/02/27 10:30:21, 0] lib/util_sec.c:assert_uid(101)
  Failed to set uid privileges to (11789,11789) now set to (0,0)
[2009/02/27 10:30:21, 0] lib/util.c:smb_panic(1633)
  PANIC (pid 27857): failed to set uid

[2009/02/27 10:30:21, 0] lib/util.c:log_stack_trace(1737)
  BACKTRACE: 15 stack frames:
   #0 /usr/sbin/smbd(log_stack_trace+0x1c) [0x613b4c]
   #1 /usr/sbin/smbd(smb_panic+0x43) [0x613c33]
   #2 /usr/sbin/smbd [0x618cf1]
   #3 /usr/sbin/smbd [0x61b8ab]
   #4 /usr/sbin/smbd [0x61bbbb]
   #5 /usr/sbin/smbd(messaging_send+0x20) [0x61bfd0]
   #6 /usr/sbin/smbd(notify_trigger+0x2a1) [0x64a0e1]
   #7 /usr/sbin/smbd(notify_fname+0x50) [0x648440]
   #8 /usr/sbin/smbd(rename_internals+0xdca) [0x48f3ea]
   #9 /usr/sbin/smbd(reply_mv+0x239) [0x4966c9]
   #10 /usr/sbin/smbd [0x4c87ce]
   #11 /usr/sbin/smbd(smbd_process+0x7e2) [0x4c9bc2]
   #12 /usr/sbin/smbd(main+0x8cd) [0x6c5fad]
   #13 /lib/libc.so.6(__libc_start_main+0xf4) [0x7fae3332f1c4]
   #14 /usr/sbin/smbd [0x45a899]
[2009/02/27 10:30:21, 0] lib/fault.c:dump_core(181)
  dumping core in /var/log/samba/cores/smbd

Seems not to be client-specific.
Occures only with more than about 100 clients connected.

Ubuntu version: 8.04.2 (amd64)
Samba version: 3.0.28a-1ubuntu4.7

FIX:
Build the sernet samba packages from source (3.0.34):
http://ftp.sernet.de/pub/samba/old/src/debian/3.0.34

Revision history for this message
Paul Dufresne (paulduf) wrote :

Thank you for this bug report.
Many other similar bugs have been reported, some on Ubuntu, sometimes on Fedora, or even in FreeBSD.
In Ubuntu I speak of bug #216358, bug #314657 and bug #229654.

Could you check if user ID 11789 really exist by doing:
sudo cat /etc/passwd | grep 11789
sudo cat /etc/group | grep 11789

and if so, try to become this user with "su <user>" and issue
ulimit -u
and give the result here.

Changed in samba:
status: New → Incomplete
Revision history for this message
Jan Schneider (j-schneider-uib) wrote :

Yes, i have seen a lot of similar bug reports too, but all of them were unresolved.

When the problem appeared we checked a lot of configuration issues.
The problem seems NOT to be user or client specific.
The users where the PANIC appeared:
 - had a unix account
 - a samba account with the same uid
 - no special ulimits set
 - no group membership which seems to be responsible for the problem
 - su <user> did work, opening files as this user did work, no messages like: to many open files...

# getent passwd 11789
diehl:x:11789:11700::/home/diehl:/bin/bash

# pdbedit -L -u diehl
diehl:11789:

# su - diehl -c 'ulimit -u'
30720

# getent group 11700
<groupname>:x:11700:

# net groupmap list | grep <groupname>
<groupname> (<SID>) -> <groupname>

Samba worked without any problems if there were less than about 100 clients/users connected.

Volker Lendecke from SerNet proposed to set "change notify = no" as a workaround, which we did not really test.

If you need more information, please let me know, but since this server acts as a domain controller in an productive environment I cannot reproduce the bug.

Revision history for this message
Paul Dufresne (paulduf) wrote : Re: [Bug 341816] Re: samba PANIC: failed to set uid

I think you did the right thing by installing Samba 3.0.34.
Indeed the changelog suggest that it was fixed there:
http://www.samba.org/samba/history/samba-3.0.34.html
o Andrew Tridgell
    * Avoid a race condition in glibc between AIO and setresuid().
    * Become root for AIO operations.

2009/3/16, Jan Schneider <email address hidden>:
> Yes, i have seen a lot of similar bug reports too, but all of them were
> unresolved.
>
> When the problem appeared we checked a lot of configuration issues.
> The problem seems NOT to be user or client specific.
> The users where the PANIC appeared:
> - had a unix account
> - a samba account with the same uid
> - no special ulimits set
> - no group membership which seems to be responsible for the problem
> - su <user> did work, opening files as this user did work, no messages
> like: to many open files...
>
> # getent passwd 11789
> diehl:x:11789:11700::/home/diehl:/bin/bash
>
> # pdbedit -L -u diehl
> diehl:11789:
>
> # su - diehl -c 'ulimit -u'
> 30720
>
> # getent group 11700
> <groupname>:x:11700:
>
> # net groupmap list | grep <groupname>
> <groupname> (<SID>) -> <groupname>
>
> Samba worked without any problems if there were less than about 100
> clients/users connected.
>
> Volker Lendecke from SerNet proposed to set "change notify = no" as a
> workaround, which we did not really test.
>
> If you need more information, please let me know, but since this server
> acts as a domain controller in an productive environment I cannot
> reproduce the bug.
>
> --
> samba PANIC: failed to set uid
> https://bugs.launchpad.net/bugs/341816
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Thierry Carrez (ttx) wrote :

This might not be a duplicate of bug 216358.
Could the reporter try the packages in my PPA and see if they fix it for him (as well as 3.0.34 did).
(samba_3.0.28a-1ubuntu4.9~ppa1) at https://launchpad.net/~ttx/+archive/ppa
Thanks !

Revision history for this message
Jan Schneider (j-schneider-uib) wrote :

Sorry, as I said before, I can't try the package because it is a productive environment...

Chuck Short (zulcss)
Changed in samba (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Cory Coager (ccoager) wrote :

Having the same issue here:
kernel 2.6.24-23-server x64
samba 3.0.28a-1ubuntu4.9

The setting "change notify = no" seems to work as a workaround.

Revision history for this message
Chuck Short (zulcss) wrote :

I am going to mark this as fixed released, but this is probably a good candidate for an SRU.

chuck

Changed in samba (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.