Bug 4238 - Setting printdrivers leads to smbd panic.
Summary: Setting printdrivers leads to smbd panic.
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Printing (show other bugs)
Version: 3.0.23c
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Guenther Deschner
QA Contact: Samba QA Contact
Depends on:
Reported: 2006-11-20 08:06 UTC by Antti Niemi
Modified: 2012-01-09 10:59 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Antti Niemi 2006-11-20 08:06:18 UTC

I've stumbled into a following smbd panic problem, which I think may be a bug. This is also reproducible.

The setup is RHEL4 on a Dell PowerEdge 2950 server. Target is to integrate printingservices to this server by using samba and cups. Samba installed is samba-3.0.23c and the version of CUPS is cups-1.2.5. AD environment consist of several w2k3 servers, +20000 users and +400 different groups.

Definition of the bug is as follows: 
I've setup samba-3.0.23c together with cups-1.2.5 to serve as a print server for linux workstations and WinXP workstations in a 2003 Servers based AD domain. I have successfully joined the domain without no probs. Using XP workstation, I can see I'm getting authenticated and all the printers are visible. By issuing net rpc rights grant 'DOMAIN\printerAdmins' SePrintOperatorPrivilege, I have succesfully granted printeradmin rights for the correct Windows group. Now if I try to migrate printer drivers and settings from a printserver running W2K3 server using net "rpc printer MIGRATE ALL printername -U admin -S printserver.somedomain.com" results in a few errors as follows: 

cannot set printer-info: WERR_UNKNOWN_LEVEL
could not set printerdataex: WERR_INVALID_NAME

Now, if I stop-start smbd it results in internal error.

In smbd.log I see the following:
[2006/11/14 14:31:24, 0] lib/fault.c:fault_report(41)
[2006/11/14 14:31:24, 0] lib/fault.c:fault_report(42)
  INTERNAL ERROR: Signal 11 in pid 24181 (3.0.23c)
  Please read the Trouble-Shooting section of the Samba3-HOWTO
[2006/11/14 14:31:24, 0] lib/fault.c:fault_report(44)

  From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
[2006/11/14 14:31:24, 0] lib/fault.c:fault_report(45)
[2006/11/14 14:31:24, 0] lib/util.c:smb_panic(1592)
  PANIC (pid 24181): internal error
[2006/11/14 14:31:24, 0] lib/util.c:log_stack_trace(1699)
  BACKTRACE: 12 stack frames:
   #0 smbd(log_stack_trace+0x26) [0xb9d095]
   #1 smbd(smb_panic+0x76) [0xb9cf20]
   #2 smbd [0xb8b0b0]
   #3 smbd [0xb8b0be]
   #4 /lib/tls/libpthread.so.0 [0x16f898]
   #5 smbd(ads_destroy+0x72) [0xc12dfe]
   #6 smbd(check_published_printers+0x24d) [0xbc533c]
   #7 smbd(nt_printing_init+0x4e8) [0xbbe0e0]
   #8 smbd(print_backend_init+0x1c3) [0xbb78ef]
   #9 smbd(main+0x65a) [0xc2d960]
   #10 /lib/tls/libc.so.6(__libc_start_main+0xd3) [0x491de3]
   #11 smbd [0xa0a259]
[2006/11/14 14:31:24, 0] lib/util.c:smb_panic(1600)
  smb_panic(): calling panic action [/bin/sleep 999999]

Attaching gdb to the sleeping process gives the following backtrace:

#0  0x0072a7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0x00507453 in __waitpid_nocancel () from /lib/tls/libc.so.6
#2  0x004b1349 in do_system () from /lib/tls/libc.so.6
#3  0x0016f78d in system () from /lib/tls/libpthread.so.0
#4  0x00b9cf99 in smb_panic () from /l/samba/sbin/smbd
#5  0x00b8b0b0 in fault_report () from /l/samba/sbin/smbd
#6  0x00b8b0be in sig_fault () from /l/samba/sbin/smbd
#7  <signal handler called>
#8  0x004df325 in free () from /lib/tls/libc.so.6
#9  0x00c12dfe in ads_destroy () from /l/samba/sbin/smbd
#10 0x00bc533c in check_published_printers () from /l/samba/sbin/smbd
#11 0x00bbe0e0 in nt_printing_init () from /l/samba/sbin/smbd
#12 0x00bb78ef in print_backend_init () from /l/samba/sbin/smbd
#13 0x00c2d960 in main () from /l/samba/sbin/smbd

If I use WinXP as a client machine and setup printer properties from the XP workstation, the outcome is the same. I can upload the drivers to the samba server, but after clicking apply and ok, smbd always crashes. In the logs is following:


[2006/11/20 15:54:47, 5] printing/nt_printing.c:nt_printer_publish_ads(3016)
  publishing printer HP LaserJet 4350 PS
smbd: ../../../libraries/libldap/unbind.c:49: ldap_unbind_ext: Assertion `( (ld)->ld_options.ldo_valid == 0x2 )' failed.
[2006/11/20 15:54:47, 0] lib/fault.c:fault_report(41)
[2006/11/20 15:54:47, 0] lib/fault.c:fault_report(42)
  INTERNAL ERROR: Signal 6 in pid 6035 (3.0.23d)
  Please read the Trouble-Shooting section of the Samba3-HOWTO
[2006/11/20 15:54:47, 0] lib/fault.c:fault_report(44)

  From: http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
[2006/11/20 15:54:47, 0] lib/fault.c:fault_report(45)
[2006/11/20 15:54:47, 0] lib/util.c:smb_panic(1599)
  PANIC (pid 6035): internal error
[2006/11/20 15:54:47, 0] lib/util.c:log_stack_trace(1706)
  BACKTRACE: 32 stack frames:
   #0 smbd(log_stack_trace+0x26) [0x3c20cb]
   #1 smbd(smb_panic+0x76) [0x3c1f56]
   #2 smbd [0x3b0060]
   #3 smbd [0x3b006e]
   #4 /lib/tls/libpthread.so.0 [0x185898]
   #5 /lib/tls/libc.so.6(abort+0xe9) [0xce4209]
   #6 /lib/tls/libc.so.6(__assert_fail+0x101) [0xcdbd91]
   #7 /usr/lib/libldap-2.2.so.7(ldap_unbind_ext+0x8a) [0xb38b48]
   #8 /usr/lib/libldap-2.2.so.7(ldap_unbind+0x39) [0xb38ba5]
   #9 smbd(ads_destroy+0x3d) [0x438b75]
   #10 smbd(nt_printer_publish+0x2f2) [0x3ea82d]
   #11 smbd [0x30302d]
   #12 smbd(_spoolss_setprinter+0x197) [0x3031d6]
   #13 smbd [0x2f4118]
   #14 smbd(api_rpcTNP+0x251) [0x328c71]
   #15 smbd(api_pipe_request+0x106) [0x328998]
   #16 smbd [0x322050]
   #17 smbd [0x322219]
   #18 smbd [0x3228e3]
   #19 smbd [0x322adf]
   #20 smbd(write_to_pipe+0xfc) [0x322a4d]
   #21 smbd [0x247e5c]
   #22 smbd [0x2480b8]
   #23 smbd [0x248304]
   #24 smbd(reply_trans+0x628) [0x248978]
   #25 smbd [0x292744]
   #26 smbd [0x2927d4]
   #27 smbd [0x292b49]
   #28 smbd(smbd_process+0x158) [0x293990]
   #29 smbd(main+0xa37) [0x454744]
   #30 /lib/tls/libc.so.6(__libc_start_main+0xd3) [0xccfde3]
   #31 smbd [0x22d3e9]
[2006/11/20 15:54:47, 0] lib/util.c:smb_panic(1607)
  smb_panic(): calling panic action [/bin/sleep 999999]

After deleting /var/locks/ntprinters.tdb I'm able to get the smbd services up and running.

This also happened with samba-3.0.22 and samba-3.0.23d.


Load smb config files from /l/samba/lib/smb.conf
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Press enter to see a dump of your service definitions

        workgroup = ABC
        realm = ABC.DEF.GH
        server string = CUPS2 Print server
        security = ADS
        log level = 10
        log file = /var/log/samba/%m.log
        max log size = 1000
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        printcap name = /etc/printcap
        preferred master = No
        local master = No
        domain master = No
        dns proxy = No
        panic action = /bin/sleep 999999
        idmap uid = 100000-180000
        idmap gid = 100000-180000
        admin users = root, username, ABC\username
        cups options = raw

        comment = All Printers
        path = /var/spool/samba
        admin users = +ABC\printerAdmins, root, username
        write list = +ABC\printerAdmins, root, username
        printable = Yes
        browseable = No

        comment = Printer Drivers
        path = /l/windrivers
        admin users = +ABC\printerAdmins, ABC\username, root, username
        write list = +ABC\printerAdmins, ABC\username, root, username
        read only = No
        guest ok = Yes

If required, I'll gladly dig out more information. 


Comment 1 Antti Niemi 2006-11-30 04:31:12 UTC
This is now solved. We did not want to publish the printers before they would be fully configured, so our Windows administrators removed read rights from samba server object's security descriptor "Authenticated Users".

Analyzing the network traffic released, that DC didn't return any LDAP attributes to the samba servers LDAP search request. "Surprisingly" giving read rights to the Authenticated Users security descriptor solved this problem.

However, I still think this as a bug, because it shouldn't cause smbd to panic during restart. If requested, I can provide thorough information for developers to fix this.


Comment 2 Karolin Seeger 2009-12-02 04:19:39 UTC
Is this still an issue in Samba 3.4?
Comment 3 Andreas Schneider 2012-01-09 10:59:47 UTC
This is probably fixed with a newer Samba version. If you still see the error. Please open a new bug with 'debug level = 10' logfiles of the new Samba version 3.5 or 3.6. Thanks!