[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#204735: Bug#204736: more information on temporary fix



On Sat, Aug 16, 2003 at 11:22:21PM -0400, Freels, James D. wrote:

> I am assuming that samba will get a new upstream version soon, and get
> built against libc6-2.3.2 and get around this problem.

> I recommend removing the bug report for libc6 and keeping the bug report
> for samba until it works with libc6-2.3.2.

Unless one of the glibc maintainers can show that samba was using
private glibc interfaces that it shouldn't have been, or that the
current Samba binaries are misbuilt due to toolchain issues, I disagree.
Samba hasn't changed here, glibc has -- it's the responsibility of the
libc6 maintainers to ensure that binaries compiled against earlier
versions of the library continue to work (unless they intend to start
shipping libc7 instead).

On my own systems, Samba doesn't seem to show this instability.  I
gather from the backtrace that this is a crash on startup, as that's the
only place that code is called.  There are two possible causes for the
backtrace in question.  One is an actual segfault; the other is an
SMB_ASSERT(), to make sure the provided pid number is positive.  The
code that provides the pid value in question is as follows:

pid_t pidfile_pid(const char *name)
{
        int fd;
        char pidstr[20];
        unsigned ret;
        pstring pidFile;

        slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name);

        fd = sys_open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
        if (fd == -1) {
                return 0;
        }

        ZERO_ARRAY(pidstr);

        if (read(fd, pidstr, sizeof(pidstr)-1) <= 0) {
                goto noproc;
        }

        ret = atoi(pidstr);

        ...
}

The 'ret' is then passed to the following function:

BOOL process_exists(pid_t pid)
{
        /* Doing kill with a non-positive pid causes messages to be
         * sent to places we don't want. */
        SMB_ASSERT(pid > 0);
        return(kill(pid,0) == 0 || errno != ESRCH);
}

If there's something here that should cause a crash, I don't see it.

-- 
Steve Langasek
postmodern programmer

Attachment: pgppnsejVMBhH.pgp
Description: PGP signature


Reply to: