-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
max-depth semantics seem incorrect? #240
Comments
I can't explain how the --max-depth code is supposed to work haven't
used it myself or played with it, but I will look into the seg fault
and come up with a patch when I get a chance.
If Zevv doesn't beat me to it. :-)
|
Quoting John (2020-05-14 03:35:26)
I can't explain how the --max-depth code is supposed to work haven't
used it myself or played with it, but I will look into the seg fault
and come up with a patch when I get a chance.
I'm afraid the semantics are indeed not well defined, and it's hard to
make something up that makes sense. I believe the original intent was to
fully traverse the file system, but only store the totals up to depth N.
The problem is that the resulting output often does not make sense,
because the end result does not add up to the total. We have to take a
good look at this to see if and how this can be fixed I think.
|
Hi Michael,
Could you give us some more details on how you built duc, I haven't
been able to re-create your seg-fault, but I don't use zsh (which
shouldn't be a problem...) and I wonder which backend you're using.
Can you share the output of:
cat /proc/cpuinfo
duc --version
CFLAGS="-g" ./configure --prefix=/var/tmp/duc
And share the output at the end of the process, before you then do:
make -j 4
and maybe also attach a tar or zip file of the test directories and
files you setup? I haven't been able to make it crash or segfault
when I compile on Debian Stretch running my own compiled kernel
5.0.21, so I'm looking for a reproducer.
Thanks,
John
P.S. Of course once I write and send this email, it will fail.
Right? :-)
|
Sure. I was running into the segfault with 1.4.4 from the Arch Linux AUR: https://aur.archlinux.org/packages/duc/, using the leveldb backend:
Unfortunately, arch linux packages don’t include debug info by default, so loading the core dump into gdb isn’t very useful:
Next, I tried building from git so that I get debug symbols. Unfortunately (?), I cannot reproduce the crash with the version built from git, so maybe it was fixed in the meantime?
I then rebuilt the 1.4.4 tarball which the AUR package uses, and I can reproduce the crash with it:
I’m currently using Linux 5.5.8, but it seems unlikely that the kernel version would matter :) |
Hi Michael,
Thanks for the great info! I'll start poking more at the
duc_read_dir() function, but would it be possible to get a copy of
your DB to look over as well? You can just send it to my directly if
you like via email attachment: john@stoffel.org
Can you give us more info on the version of leveldb you're using as
well? I have 1.18-5 on my debian box. And would it be possible for
you to try an older version, say 1.4.3 on your bad DB as well? That
would be interesting to see if we can chase this down.
Looking at src/libduc/dir.c, not much has really changed there in
quite a while.
Ideally, this is already fixed in master and we should really just
spin a v1.4.5 or v.1.5 release.
John
|
I used git bisect to track it down to commit 8afb1ba, which fixes the segfault. |
>>>> "Michael" == Michael Stapelberg ***@***.***> writes:
Michael> I used git bisect to track it down to commit 8afb1ba, which fixes the segfault.
Awesome! Thanks for confirming it. I was playing with this off and
on today but couldn't get a segfault in my tests. Looks like we
really need to make a new release to roll up various fixes and
changes.
It's also good to know that some distros are using other DBs by
default.
John
|
Using
--max-depth 0
seems to be the same thing as not specifying a limit:Maybe the manpage could mention that?
Next up,
--max-depth 1
. This seems to result in an empty database, and makesduc
crash when accessing a specific path:So let’s try
--max-depth 2
. This gives me what I intuitively think of as a depth of 1: I do see thehost1
andhost2
subdirectories of the indexed directory, but nothing underneath them:So maybe we need
--max-depth 3
? This gives mehost1
,host2
, their subdirectories (as desired!) but also files within those subdirectories (unexpected)?!Can you explain how
--max-depth
is supposed to work in my scenario? I want the first level (host1
andhost2
) as well as the level underneath (dated subdirectories like2020-05-10
), but nothing more. It doesn’t seem to be possible to do this right now, as per the above examples?The text was updated successfully, but these errors were encountered: