[KinoSearch] Debian Lenny - fs_dir_handle test fails

Marvin Humphrey marvin at rectangular.com
Sun Nov 14 16:06:25 PST 2010


On Sun, Nov 14, 2010 at 04:28:07PM -0500, Paweł Matykiewicz wrote:
> On Linux Debian Lenny I get this failure:
> 
> t/core/062-fs_dir_handle.t ........... Failed 1/5 subtests

I've seen this same failure in the CPAN Testers smokes:

  http://www.cpantesters.org/cpan/report/60db527e-e590-11df-bef0-fa63f9a11ff6
  
The test that fails seems to be number 3:

    Test Summary Report
    -------------------
    t/core/062-fs_dir_handle.t         (Wstat: 0 Tests: 5 Failed: 1)
      Failed test:  3

That's this test from trunk/core/KinoSearch/Test/Store/TestFSDirHandle.c:

    TEST_TRUE(batch, foo_was_dir, 
        "Dir correctly identified by Entry_Is_Dir");

Somehow, when iterating over contents of the directory, the DirHandle saw
something called "foo", but didn't properly identify it as a directory.  The
code that's failing is this, from trunk/core/KinoSearch/Store/FSDirHandle.c:

    #ifdef CHY_HAS_DIRENT_D_TYPE
    return sys_dir_entry->d_type == DT_DIR ? true : false;
    #else 
    {
        struct stat stat_buf;
        if (!self->fullpath) { 
            self->fullpath = CB_new(CB_Get_Size(self->dir) + 20);
        }
        CB_setf(self->fullpath, "%o%s%o", self->dir, CHY_DIR_SEP,
            self->entry);
        if (stat((char*)CB_Get_Ptr8(self->fullpath), &stat_buf) != -1) {
            if (stat_buf.st_mode & S_IFDIR) return true;
        }
        return false;
    }

It would be interesting to know which branch is failing.  Please open up the
file "charmony.h", which should be right there after the build completes, and
see whether there's anything there for "CHY_HAS_DIRENT_D_TYPE".

It seems likely that it's the second branch messing up, as it's a hack
workaround for systems that don't have a d_type member in the dirent struct.
However, when I enable that branch on any of my systems, I can't seem to make
it fail.  So we'll have to cooperate a little to troubleshoot this...

> Debian Lenny does not have many packages installed out of box. Maybe
> I'm missing something that on other OS is pre-installed?

That seems unlikely, though maybe there's a libc-dev or something like that.
First step, though, is to find out which branch is executing.  We should
definitely be able to make this work without needing any more prerequisites.
In fact, I'm going to be bummed if we find that installing a package solves
this problem -- I'd much rather fix it right!

> Hope you can help

I've been itching to fix this test failure, but I haven't been able to
reproduce it before!

Marvin Humphrey




More information about the kinosearch mailing list