[Samba] HELP: Samba server crashing on me

Timothy Normand Miller theosib at gmail.com
Sun Sep 6 21:47:28 MDT 2009


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.
>



-- 
Timothy Normand Miller
http://www.cse.ohio-state.edu/~millerti
Open Graphics Project


More information about the samba mailing list