2.0.7pre2 - problem with include =

Pierre-Jules Tremblay trep at cortexmachina.com
Mon Mar 27 15:12:04 GMT 2000


Managed to get a backtrace in gdb by adding a 10-second sleep call just before reset_globals_after_fork() is called (see below).

There is a SIGSEGV due to a bad pointer, apparently coming out of the parm_table (pointer not initialised?), see frame #4 in stack trace below.

param/loadparm.c:2245:parm_table[parmnum].special(pszParmValue,(char **)parm_ptr);

*parm_ptr is pointing out of bounds.

backtrace:

Breakpoint 1, open_sockets (is_daemon=1, port=5555) at smbd/server.c:247
247                                     reset_globals_after_fork();
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
__libc_free (mem=0x47415241) at malloc.c:2914
malloc.c:2914: No such file or directory.
(gdb) bt
#0  __libc_free (mem=0x47415241) at malloc.c:2914
#1  0x80f2301 in string_free (s=0x812caf4) at lib/util_str.c:1079
#2  0x80f231c in string_set (dest=0x812caf4, src=0xbfffe350 "ARAGORN")
    at lib/util_str.c:1089
#3  0x808e8b8 in handle_netbios_name (pszParmValue=0x814ba1d "ARAGORN", 
    ptr=0x812caf4) at param/loadparm.c:1908
#4  0x808f6c3 in lp_do_parameter (snum=-2, 
    pszParmName=0x814ba10 "netbios name", pszParmValue=0x814ba1d "ARAGORN")
    at param/loadparm.c:2245
#5  0x808f9f3 in do_parameter (pszParmName=0x814ba10 "netbios name", 
    pszParmValue=0x814ba1d "ARAGORN") at param/loadparm.c:2324
#6  0x80919f7 in Parameter (InFile=0x814b958, pfunc=0x808f990 <do_parameter>, 
    c=0) at param/params.c:429
#7  0x8091ae1 in Parse (InFile=0x814b958, sfunc=0x808fd4c <do_section>, 
    pfunc=0x808f990 <do_parameter>) at param/params.c:484
#8  0x8091d39 in pm_process (FileName=0xbfffe808 "./smbtest.conf", 
    sfunc=0x808fd4c <do_section>, pfunc=0x808f990 <do_parameter>)
    at param/params.c:568
#9  0x8090b41 in lp_load (pszFname=0x8124c38 "./smbtest.conf", global_only=0, 
    save_defaults=0, add_ipc=1) at param/loadparm.c:2789
#10 0x804b59d in reload_services (test=1) at smbd/server.c:306
#11 0x8069990 in reply_special (inbuf=0x8151961 "\201", 
    outbuf=0x8161d69 "\202") at smbd/reply.c:122
#12 0x808455e in construct_reply (inbuf=0x8151961 "\201", 
    outbuf=0x8161d69 "\202", size=76, bufsize=65535) at smbd/process.c:567
#13 0x808477b in process_smb (inbuf=0x8151961 "\201", outbuf=0x8161d69 "\202")
    at smbd/process.c:645
#14 0x8085281 in smbd_process () at smbd/process.c:1041
#15 0x804c2b9 in main (argc=10, argv=0xbffff924) at smbd/server.c:757
#16 0x40083cb3 in __libc_start_main (main=0x804bb24 <main>, argc=10, 
    argv=0xbffff924, init=0x8049f94 <_init>, fini=0x80febe0 <_fini>, 
    rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffff91c)
    at ../sysdeps/generic/libc-start.c:78
(gdb) 

> 
> I'm experiencing a problem with 2.0.7 (both pre1 and pre2) when an
> include = directive is present in smb.conf (same smb.conf with 2.0.6
> works OK).  The smbd process responsible for listening for new
> connections seems to work fine, but child smbd's seem to crash as soon
> as they are fork()ed. In the machine-specific log files, I get:
> 
>   ===============================================================
> [2000/03/24 17:00:51, 0] lib/fault.c:fault_report(41)
>   INTERNAL ERROR: Signal 11 in pid 30206 (2.0.7-pre2)
>   Please read the file BUGS.txt in the distribution
> [2000/03/24 17:00:51, 0] lib/fault.c:fault_report(43)
>   ===============================================================
> [2000/03/24 17:00:51, 0] lib/util.c:smb_panic(2381)
>   PANIC: internal error
> [2000/03/24 17:00:52, 0] lib/fault.c:fault_report(40)
>   ===============================================================
> 
> and this is repeated several times.  Increasing the log level has no
> effect for the child smbd log files.  When the include directive is
> commented out, everything works just fine.  Here is an excerpt of my
> smb.conf.
> 
> # Samba config file created using SWAT
> # Date: 2000/03/08 12:09:27
> 
> # Global parameters
> [global]
> 	workgroup = CORTEX
> 	netbios name = ARAGORN
> 	server string = Aragorn PDC
> 	interfaces = <snip>
> 	encrypt passwords = Yes
> 	passwd program = /usr/bin/passwd %u
> 	passwd chat = *password* %n\n *password* %n\n *successfull*
> 	password level = 10
> 	unix password sync = Yes
> 	log file = /usr/local/samba/var/log.%m
> 	log level = 1
> # this is the offending line.
> #	include = /usr/local/samba/lib/smb.conf-%m
> 	max log size = 2000
> 	logon script = %m.bat
> 	logon home = \\%N\%U
> 	logon path = \\%N\%U\profile
> 	logon drive = f:
> 	domain logons = Yes
> 	dns proxy = No
> 	wins server = <snip>
> 	guest account = guest
> 	hosts allow = <snip>
> 
> <snip>
> 
> Any ideas?
> 
> Pierre
> 
> 



More information about the samba-technical mailing list