[Samba] HELP: Samba server crashing on me
John H Terpstra - Samba Team
jht at samba.org
Sun Sep 6 21:54:57 MDT 2009
On 09/06/2009 10:47 PM, Timothy Normand Miller wrote:
> I'm stymied by the fact that no matter what I set the CFLAGS to in the
> environment, the compile is optimizing out symbols, but here's what
> I'm finding in the source:
>
> static bool open_sockets_smbd(bool is_daemon, bool interactive, const
> char *smb_ports)
> {
> ...
> struct dns_reg_state * dns_reg = NULL;
>
> ... nothing that modifies dns_reg ...
>
> /* process pending nDNS responses */
> if (dns_register_smbd_reply(dns_reg, &r_fds, &idle_timeout)) {
> --num;
> }
> ...
> }
>
>
> Then the function dns_register_smbd_reply blindly rereferences the
> first argument:
>
> bool dns_register_smbd_reply(struct dns_reg_state *dns_state,
> fd_set *lfds, struct timeval *timeout)
> {
> int mdnsd_conn_fd = -1;
>
> if (dns_state->srv_ref == NULL) {
> return false;
> }
> ...
> }
>
> So, can anyone tell me what I might do to avoid this sequence of
> events? It didn't happen before. I don't know what's causing it to
> happen now.
>
>
> On Sun, Sep 6, 2009 at 11:26 PM, Timothy Normand
> Miller<theosib at gmail.com> wrote:
>> This is where smbd is getting signal 11 (see the ***):
>>
>> /* Processes reply from mDNS daemon. Returns true if a reply was received */
>> bool dns_register_smbd_reply(struct dns_reg_state *dns_state,
>> fd_set *lfds, struct timeval *timeout)
>> {
>> int mdnsd_conn_fd = -1;
>>
>> if (dns_state->srv_ref == NULL) { // *** RIGHT HERE AT LINE 171 ***
>> return false;
>> }
>>
>> mdnsd_conn_fd = DNSServiceRefSockFD(dns_state->srv_ref);
>>
>> /* Process reply from daemon. Handles any errors. */
>> if ((mdnsd_conn_fd != -1) && (FD_ISSET(mdnsd_conn_fd,lfds)) ) {
>> DNSServiceErrorType err;
>>
>> err = DNSServiceProcessResult(dns_state->srv_ref);
>> if (err != kDNSServiceErr_NoError) {
>> DEBUG(3, ("failed to process mDNS result (err
>> %d), re-trying\n",
>> err));
>> schedule_dns_register_smbd_retry(dns_state, timeout);
>> }
>>
>> return true;
>> }
>>
>> return false;
>> }
>>
>>
>> It appears that dns_state is null, which is evident from the stack trace:
>>
>> #6 dns_register_smbd_reply (dns_state=0x0, lfds=0x7fffbf342960,
>> timeout=0x7fffbf342af0) at smbd/dnsregister.c:171
>>
>> That's called from here in server.c, in main():
>>
>> if (dns_register_smbd_reply(dns_reg, &r_fds, &idle_timeout)) {
>> --num;
>> }
>>
>> Unfortunately, I can't debug further since dns_reg is optimized out by -O2.
>>
>
>
>
Please file a bug report on https://bugzilla.samba.org - attach all the
info you presented on this list, and also the output of "testparm -s".
Suggest you also include the output of "smbd -b" and of "uname -a".
What is your platform? Did you compile Samba yourself or is this from a
recognized packaged source?
Would like to understand why you have this problem and noone else has
reported this problem.
Cheers,
John T.
More information about the samba
mailing list