You are not logged in.

#1 2026-01-03 12:43:46

wtx
Member
Registered: 2014-06-09
Posts: 90

[SOLVED ]cp command from coreutils 9.9-1 hangs

Today I noticed that that simple command hangs on copying some of the files from /var/log/journal in my system:

cp -rv /var/log/journal/ /tmp/z/

Seems the "cp" program hangs in user space as I saw infinite loop of :

354989 lseek(4, 31162368, SEEK_SET)     = 31162368
354989 lseek(4, 31162368, SEEK_DATA)    = 31162368
354989 lseek(4, 31162368, SEEK_SET)     = 31162368
354989 lseek(4, 31162368, SEEK_DATA)    = 31162368
354989 lseek(4, 31162368, SEEK_SET)     = 31162368
354989 lseek(4, 31162368, SEEK_DATA)    = 31162368
354989 lseek(4, 31162368, SEEK_SET)     = 31162368
354989 lseek(4, 31162368, SEEK_DATA)    = 31162368

while running strace on this command.

The wrong coreutils is in latest version 9.9-1. I've checked previous ones and all of them are good. So only 9.9-1 is bad.

This is backtrace of "cp" process:

gdb) bt
#0  __lseek64 (fd=fd@entry=4, offset=offset@entry=4943872, whence=whence@entry=3) at ../sysdeps/unix/sysv/linux/lseek64.c:40
#1  0x000055cff2552a7a in lseek_copy (src_fd=4, dest_fd=5, abuf=0x7ffdaf626c08, buf_size=262144, src_pos=0, ibytes=9223372036854775807, scan_inference=<synthetic pointer>, src_total_size=<optimized out>, sparse_mode=SPARSE_AUTO, allow_reflink=true,
    src_name=0x55d0150ad550 "/var/log/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal",
    dst_name=0x55d0150ad5e0 "/tmp/z/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal", hole_size=0x7ffdaf626c10, debug=0x55cff2565170 <copy_debug>) at src/copy-file-data.c:423
#2  copy_file_data (ifd=ifd@entry=4, ist=ist@entry=0x7ffdaf626f90, ipos=ipos@entry=0, iname=iname@entry=0x55d0150ad550 "/var/log/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal", ofd=ofd@entry=5, ost=ost@entry=0x7ffdaf626f00, opos=0,
    oname=0x55d0150ad5e0 "/tmp/z/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal", ibytes=9223372036854775807, x=0x7ffdaf627190, debug=0x55cff2565170 <copy_debug>) at src/copy-file-data.c:589
#3  0x000055cff254e162 in copy_reg (src_name=0x55d0150ad550 "/var/log/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal",
    dst_name=0x55d0150ad5e0 "/tmp/z/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal", dst_dirfd=3,
    dst_relname=0x55d0150ad5e7 "journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal", x=<optimized out>, dst_mode=416, omitted_permissions=<optimized out>, new_dst=<synthetic pointer>, src_sb=0x7ffdaf626de0) at src/copy.c:1048
#4  copy_internal (src_name=src_name@entry=0x55d0150ad550 "/var/log/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal",
    dst_name=dst_name@entry=0x55d0150ad5e0 "/tmp/z/journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal", dst_dirfd=dst_dirfd@entry=3,
    dst_relname=dst_relname@entry=0x55d0150ad5e7 "journal/f3420feef7c34e87a30ad700ffa364ba/system@69f10fce0cef47b5bbc14ffa0c29723e-0000000000b08b57-000644b6a34fbec4.journal", nonexistent_dst=<optimized out>, nonexistent_dst@entry=0, parent=parent@entry=0x7ffdaf627210, ancestors=<optimized out>, x=<optimized out>,
    command_line_arg=<optimized out>, first_dir_created_per_command_line_arg=<optimized out>, copy_into_self=<optimized out>, rename_succeeded=<optimized out>) at src/copy.c:2504
#5  0x000055cff254da8a in copy_dir (src_name_in=0x55d0150ab530 "/var/log/journal/f3420feef7c34e87a30ad700ffa364ba", dst_name_in=0x55d0150ab570 "/tmp/z/journal/f3420feef7c34e87a30ad700ffa364ba", dst_dirfd=3, dst_relname_in=0x55d0150ab577 "journal/f3420feef7c34e87a30ad700ffa364ba", new_dst=<optimized out>,
    src_sb=0x7ffdaf627210, ancestors=<optimized out>, x=<optimized out>, first_dir_created_per_command_line_arg=0x7ffdaf6275be, copy_into_self=0x7ffdaf6275bd) at src/copy.c:418
#6  copy_internal (src_name=src_name@entry=0x55d0150ab530 "/var/log/journal/f3420feef7c34e87a30ad700ffa364ba", dst_name=dst_name@entry=0x55d0150ab570 "/tmp/z/journal/f3420feef7c34e87a30ad700ffa364ba", dst_dirfd=dst_dirfd@entry=3, dst_relname=dst_relname@entry=0x55d0150ab577 "journal/f3420feef7c34e87a30ad700ffa364ba",
    nonexistent_dst=<optimized out>, nonexistent_dst@entry=0, parent=parent@entry=0x7ffdaf627640, ancestors=<optimized out>, x=<optimized out>, command_line_arg=<optimized out>, first_dir_created_per_command_line_arg=<optimized out>, copy_into_self=<optimized out>, rename_succeeded=<optimized out>) at src/copy.c:2419
#7  0x000055cff254da8a in copy_dir (src_name_in=0x7ffdaf628d6b "/var/log/journal/", dst_name_in=0x55d0150ab470 "/tmp/z/journal", dst_dirfd=3, dst_relname_in=0x55d0150ab477 "journal", new_dst=<optimized out>, src_sb=0x7ffdaf627640, ancestors=<optimized out>, x=<optimized out>,
    first_dir_created_per_command_line_arg=0x7ffdaf627907, copy_into_self=0x7ffdaf62799f) at src/copy.c:418
#8  copy_internal (src_name=src_name@entry=0x7ffdaf628d6b "/var/log/journal/", dst_name=dst_name@entry=0x55d0150ab470 "/tmp/z/journal", dst_dirfd=dst_dirfd@entry=3, dst_relname=<optimized out>, nonexistent_dst=<optimized out>, parent=parent@entry=0x0, ancestors=<optimized out>, x=<optimized out>,
    command_line_arg=<optimized out>, first_dir_created_per_command_line_arg=<optimized out>, copy_into_self=<optimized out>, rename_succeeded=<optimized out>) at src/copy.c:2419
#9  0x000055cff2551b47 in copy (src_name=src_name@entry=0x7ffdaf628d6b "/var/log/journal/", dst_name=dst_name@entry=0x55d0150ab470 "/tmp/z/journal", dst_dirfd=dst_dirfd@entry=3, dst_relname=dst_relname@entry=0x55d0150ab477 "journal", nonexistent_dst=<optimized out>, options=options@entry=0x7ffdaf627ac0,
    copy_into_self=0x7ffdaf62799f, rename_succeeded=0x0) at src/copy.c:2823
#10 0x000055cff254b6ab in do_copy (n_files=<optimized out>, file=0x7ffdaf627c98, target_directory=<optimized out>, target_directory@entry=0x0, no_target_directory=no_target_directory@entry=false, x=x@entry=0x7ffdaf627ac0) at src/cp.c:763
#11 0x000055cff2549cd4 in main (argc=4, argv=0x7ffdaf627c88) at src/cp.c:1279

Anybody else noticed that?

Last edited by wtx (2026-01-04 08:40:51)

Offline

#2 2026-01-03 13:15:18

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,559

Offline

#3 2026-01-04 08:40:26

wtx
Member
Registered: 2014-06-09
Posts: 90

Re: [SOLVED ]cp command from coreutils 9.9-1 hangs

Yes, seems like this is the commit that introduced the issue. After reverting it copying files from journal are working fine. Thanks @seth!

Offline

#4 2026-01-04 08:42:38

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,559

Re: [SOLVED ]cp command from coreutils 9.9-1 hangs

Could be a problem w/ the file or disk, but you should certainly file a bug upstream to have them look into that.

Offline

#5 2026-01-04 08:59:24

wtx
Member
Registered: 2014-06-09
Posts: 90

Re: [SOLVED ]cp command from coreutils 9.9-1 hangs

Yes, I just reported the issue on github.

Offline

Board footer

Powered by FluxBB