markfasheh / duperemove

Tools for deduping file systems
GNU General Public License v2.0
689 stars 75 forks source link

duperemove-0.13 stuck? #309

Closed thesamesam closed 7 months ago

thesamesam commented 9 months ago

In the past, duperemove on this set of data didn't take that long (maybe 10 minutes at most). But so far, it's been running for over 1hr10m.

# duperemove --version
duperemove 0.13
$ duperemove -rdh --hashfile=/root/srv.hash /srv
[...]
[0x55d2dc6b7660] Dedupe 1 extents (id: cdd4e3b8) with target: (0.0B, 35.5MB), "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/log/portage/build/sys-libs/glibc-2.37-r3:20230717-182547.log"
[0x7f4b60002770] (319/320) Try to dedupe extents with id c78f3b81
[0x7f4b60002770] Dedupe 1 extents (id: c78f3b81) with target: (0.0B, 40.0MB), "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/log/journal/fb5ada9b7627494494560ca2f206c183/system@0005fb17e33b0d69-33811b7f6cc81ead.journal~"
[0x55d2e0222ff0] (320/320) Try to dedupe extents with id 2348887a
[0x55d2e0222ff0] Dedupe 1 extents (id: 2348887a) with target: (0.0B, 104.0MB), "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/log/journal/fb5ada9b7627494494560ca2f206c183/system@0005f2cb00d56333-65dbd451b112dd49.journal~"

If I attach gdb, I get (I'm going to rebuild it with debug info now):

0x00007f4b6b08222d in syscall () from /usr/lib64/libc.so.6
(gdb) bt
#0  0x00007f4b6b08222d in syscall () from /usr/lib64/libc.so.6
#1  0x00007f4b6b387744 in g_cond_wait (cond=cond@entry=0x55d2dffb53e0, mutex=0x55d2dffb8a50) at ../glib-2.78.0/glib/gthread-posix.c:1552
#2  0x00007f4b6b358d0c in g_thread_pool_free (pool=0x55d2dffb53c0, immediate=0, wait_=<optimized out>) at ../glib-2.78.0/glib/gthreadpool.c:931
#3  0x000055d1df462bf9 in dedupe_results ()
#4  0x000055d1df45aab5 in process_duplicates ()
#5  0x000055d1df460fe8 in populate_tree ()
#6  0x000055d1df45a721 in main ()

strace -f says:

[...]
[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
^C[pid 1490503] ioctl(5, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292}strace: Process 1450986 detached
strace: Process 1453088 detached
strace: Process 1490503 detached
 <detached ...>
thesamesam commented 9 months ago

It seems stuck on a single file for me.

Okay, trying again with --debug:

$ duperemove -rdh --hashfile=/root/srv.hash /srv --debug
[...]
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
^Z0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
0 extents found
fiemap_iter: filename "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index" idx 0 return poff 0 loff 0 len 0 flags 0x0
Fiemap file "/srv/chroots/.#machine.amd64-stable1a48a14e69a8548b/var/lib/portage/home/.cache/mesa_shader_cache/index", start: 0, count: 292
[... going on and on, spamming the terminal ...]

gdb attached to the process:

0x00007f27cc2d222d in syscall () from /usr/lib64/libc.so.6
(gdb) bt
#0  0x00007f27cc2d222d in syscall () from /usr/lib64/libc.so.6
#1  0x00007f27cc5d7744 in g_cond_wait (cond=cond@entry=0x55ccbc080ce0, mutex=0x55ccbc081400) at ../glib-2.78.0/glib/gthread-posix.c:1552
#2  0x00007f27cc5a8d0c in g_thread_pool_free (pool=0x55ccbc080cc0, immediate=0, wait_=<optimized out>) at ../glib-2.78.0/glib/gthreadpool.c:931
#3  0x000055cbb59b1bf9 in dedupe_results (res=<optimized out>, whole_file=<optimized out>) at run_dedupe.c:647
#4  0x000055cbb59a9ab5 in process_duplicates () at duperemove.c:513
#5  0x000055cbb59affe8 in populate_tree (cfg=cfg@entry=0x55cbb59c1320 <dbfile_cfg>, callback=callback@entry=0x55cbb59a99d0 <process_duplicates>) at file_scan.c:1031
#6  0x000055cbb59a9721 in main (argc=<optimized out>, argv=0x7ffd4f005878) at duperemove.c:670

strace -f -p (it's noisier this time because of --debug):

[...]
[pid 2328047] write(1, "fiemap_iter: filename \"/srv/chro"..., 171) = 171
[pid 2328047] write(1, "Fiemap file \"/srv/chroots/.#mach"..., 140) = 140
[pid 2328047] ioctl(4, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 2328047] write(1, "0 extents found\n", 16) = 16
[pid 2328047] write(1, "fiemap_iter: filename \"/srv/chro"..., 171) = 171
[pid 2328047] write(1, "Fiemap file \"/srv/chroots/.#mach"..., 140) = 140
[pid 2328047] ioctl(4, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 2328047] write(1, "0 extents found\n", 16) = 16
[pid 2328047] write(1, "fiemap_iter: filename \"/srv/chro"..., 171) = 171
[pid 2328047] write(1, "Fiemap file \"/srv/chroots/.#mach"..., 140) = 140
[pid 2328047] ioctl(4, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 2328047] write(1, "0 extents found\n", 16) = 16
[pid 2328047] write(1, "fiemap_iter: filename \"/srv/chro"..., 171) = 171
[pid 2328047] write(1, "Fiemap file \"/srv/chroots/.#mach"..., 140) = 140
[pid 2328047] ioctl(4, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 2328047] write(1, "0 extents found\n", 16) = 16
[pid 2328047] write(1, "fiemap_iter: filename \"/srv/chro"..., 171) = 171
[pid 2328047] write(1, "Fiemap file \"/srv/chroots/.#mach"..., 140) = 140
[pid 2328047] ioctl(4, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292} => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
[pid 2328047] write(1, "0 extents found\n", 16) = 16
[pid 2328047] write(1, "fiemap_iter: filename \"/srv/chro"..., 171) = 171
[pid 2328047] write(1, "Fiemap file \"/srv/chroots/.#mach"..., 140) = 140
[pid 2328047] ioctl(4, FS_IOC_FIEMAP, {fm_start=0, fm_length=18446744073709551615, fm_flags=0, fm_extent_count=292}^C => {fm_flags=0, fm_mapped_extents=0, ...}) = 0
strace: Process 2242507 detached
strace: Process 2327882 detached
strace: Process 2328047 detached
seadra commented 8 months ago

Same here, using duperemove -rd dir, it gets stuck at a particular file all the time.

thesamesam commented 7 months ago

0.14 seems OK for me. I can reopen if others are still seeing it stuck.