Bug 4858 - abort() in telldir on FreeBSD/amd64
abort() in telldir on FreeBSD/amd64
Status: RESOLVED DUPLICATE of bug 4715
Product: Samba 3.0
Classification: Unclassified
Component: File Services
3.0.25a
x64 FreeBSD
: P3 critical
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-04 16:36 UTC by tim newsham (550 5.1.1 User unknown)
Modified: 2007-08-05 12:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tim newsham (550 5.1.1 User unknown) 2007-08-04 16:36:07 UTC
I built Samba 3.0.25a on FreeBSD/amd64 using the FreeBSD ports.
I configured it with a similar config I used on my old machine.
I accessed it remotely and it caused a crash when viewing some
directories.  The crash occurs at lib/replace/repdir_getdirentries.c
line 135 (abort()):

long telldir(DIR *dir)
#endif
{
        struct dir_buf *d = (struct dir_buf *)dir;
        if (d->ofs >= d->nbytes) {
                d->seekpos = lseek(d->fd, 0, SEEK_CUR);
                d->ofs = 0;
                d->nbytes = 0;
        }
        /* this relies on seekpos always being a multiple of
           DIR_BUF_SIZE. Is that always true on BSD systems? */
        if (d->seekpos & (DIR_BUF_SIZE-1)) {
                abort();
        }
        return d->seekpos + d->ofs;
}

the value of d->seekpos is 496 while DIR_BUF_SIZE is 512.  The
directory in question is on an ext2fs partition that I mounted into
FreeBSD (note: this filesystem type is not often used in BSD).

I can provide more information if necessary.  I can readily reproduce
the issue and have smbd built with debugging symbols and debug support
and can easily attach gdb and perform more tests.  (newsham@lava.net).
Comment 1 Jeremy Allison 2007-08-04 23:45:57 UTC

*** This bug has been marked as a duplicate of 4715 ***
Comment 2 tim newsham (550 5.1.1 User unknown) 2007-08-05 12:44:49 UTC
I tested os2_delete.c on FreeBSD/amd64 6.2-stable (updated 8/2/2007)
and FreeBSD/x86 6.2-release and both still fail the test.