Skip to content
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

du dumps core on tmfs drive #4

Closed
jonasaugust opened this issue Oct 4, 2012 · 10 comments
Closed

du dumps core on tmfs drive #4

jonasaugust opened this issue Oct 4, 2012 · 10 comments
Assignees

Comments

@jonasaugust
Copy link

I wanted to find out how much space I'd need to restore a Mac backup called "pont" accessed using tmfs, so I tried to use du, but I got a core dump.

jonas@P9X79:~$ cd /mnt/time-machine-root/pont/
jonas@P9X79:/mnt/time-machine-root/pont$ ls -l
total 0
drwxr-xr-x 1 jonas jonas 6 Aug 27 17:16 2012-08-27-171617
drwxr-xr-x 1 jonas jonas 6 Aug 31 09:56 2012-08-31-095659
drwxr-xr-x 1 jonas jonas 6 Sep  2 19:28 2012-09-02-192834
drwxr-xr-x 1 jonas jonas 6 Sep  3 05:58 2012-09-03-055819
drwxr-xr-x 1 jonas jonas 6 Sep  5 11:28 2012-09-05-112759
drwxr-xr-x 1 jonas jonas 6 Sep  7 15:06 2012-09-07-150644
drwxr-xr-x 1 jonas jonas 6 Sep  7 15:06 Latest
jonas@P9X79:/mnt/time-machine-root/pont$ cd 2012-09-07-150644/
jonas@P9X79:/mnt/time-machine-root/pont/2012-09-07-150644$ ls
Macintosh HD
jonas@P9X79:/mnt/time-machine-root/pont/2012-09-07-150644$ du -s Macintosh\ HD/
Aborted (core dumped)

Specs: tmfs from today, Ubuntu 12.04 x64, boost 1.46.1, fuse 2.8.6.

@abique
Copy link
Owner

abique commented Oct 4, 2012

Thanks for the report, but it looks like a du bug?
Did tmfs crash?
Can you strace du so we'll get an idea of which stat reported wrong informations.

Thanks.

@ghost ghost assigned abique Oct 4, 2012
@jonasaugust
Copy link
Author

Well it doesn't always fail. It may be that for smaller directory trees it works, but not for larger, as this example shows:

jonas@P9X79:/mnt/time-machine-root/pont/Latest/Macintosh HD/Users/jonas/Documents/julia$ du -sh
1.9G    .
jonas@P9X79:/mnt/time-machine-root/pont/Latest/Macintosh HD/Users/jonas/Documents/julia$ cd ..
jonas@P9X79:/mnt/time-machine-root/pont/Latest/Macintosh HD/Users/jonas/Documents$ du -sh
Aborted (core dumped)

Possible 32 vs 64 bit bug? (I'm on Ubuntu 12.04 AMD64.)

Here's the strace:

jonas@P9X79:/mnt/time-machine-root/pont/Latest/Macintosh HD/Users/jonas/Documents$ strace du -sh
execve("/usr/bin/du", ["du", "-sh"], [/* 37 vars */]) = 0
brk(0)                                  = 0x1ad1000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feb2fa36000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=87090, ...}) = 0
mmap(NULL, 87090, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7feb2fa20000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\30\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1811128, ...}) = 0
mmap(NULL, 3925208, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7feb2f457000
mprotect(0x7feb2f60c000, 2093056, PROT_NONE) = 0
mmap(0x7feb2f80b000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b4000) = 0x7feb2f80b000
mmap(0x7feb2f811000, 17624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7feb2f811000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feb2fa1f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feb2fa1e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7feb2fa1d000
arch_prctl(ARCH_SET_FS, 0x7feb2fa1e700) = 0
mprotect(0x7feb2f80b000, 16384, PROT_READ) = 0
mprotect(0x617000, 4096, PROT_READ)     = 0
mprotect(0x7feb2fa38000, 4096, PROT_READ) = 0
munmap(0x7feb2fa20000, 87090)           = 0
brk(0)                                  = 0x1ad1000
brk(0x1af2000)                          = 0x1af2000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=7220736, ...}) = 0
mmap(NULL, 7220736, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7feb2ed74000
close(3)                                = 0
newfstatat(AT_FDCWD, ".", {st_mode=S_IFDIR|0700, st_size=137, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, ".", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_DIRECTORY|O_NOFOLLOW) = 3
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFDIR|0700, st_size=137, ...}) = 0
fcntl(3, F_GETFL)                       = 0x38800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_NOFOLLOW)
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
newfstatat(AT_FDCWD, ".", {st_mode=S_IFDIR|0700, st_size=137, ...}, AT_SYMLINK_NOFOLLOW) = 0
fcntl(3, F_DUPFD, 3)                    = 4
fcntl(4, F_GETFD)                       = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
getdents(3, /* 81 entries */, 32768)    = 3680
getdents(3, /* 58 entries */, 32768)    = 2680
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
newfstatat(4, ".DS_Store", {st_mode=S_IFREG|0600, st_size=24580, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(4, ".localized", {st_mode=S_IFREG|0644, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(4, "About Stacks.pdf", {st_mode=S_IFREG|0600, st_size=303444, ...}, AT_SYMLINK_NOFOLLOW) = 0
newfstatat(4, "AdobeStockPhotos", {st_mode=S_IFDIR|0771, st_size=5, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(4, "AdobeStockPhotos", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_DIRECTORY|O_NOFOLLOW) = 3
fcntl(3, F_GETFD)                       = 0
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
fstat(3, {st_mode=S_IFDIR|0771, st_size=5, ...}) = 0
fcntl(3, F_GETFL)                       = 0x38800 (flags O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_NOFOLLOW)
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid()                                = 3536
tgkill(3536, 3536, SIGABRT)             = 0
--- SIGABRT (Aborted) @ 0 (0) ---
+++ killed by SIGABRT (core dumped) +++
Aborted (core dumped)

Unfortunately I can't give this more time now. I ended up using tmutil restore on a Mac.

@jonasaugust
Copy link
Author

I forgot to mention: tmfs itself doesn't crash when du dumps core.

@abique
Copy link
Owner

abique commented Oct 8, 2012

To me it is a du bug, as it should not crash even if stat/readdir reports broken data.

I forward the issue to bug-coreutils@gnu.org.

@abique
Copy link
Owner

abique commented Oct 8, 2012

By the way can you show me the output of du --version? Thanks.

@jonasaugust
Copy link
Author

jonas@P9X79:~/pkg/tmfs/build$ du --version
du (GNU coreutils) 8.13

@abique
Copy link
Owner

abique commented Oct 8, 2012

This is not the last version of coreutils, if you have the time, can you check with coreutils 8.19?

@jonasaugust
Copy link
Author

OK, I installed coreutils 8.19 from https://launchpad.net/~dns/+archive/gnu/+build/3794330 . Still get core dump:

root@P9X79:/home/jonas# du -hs /mnt/time-machine-root/pont/Latest/Macintosh\ HD/Users/jonas/Documents/julia/
1.9G    /mnt/time-machine-root/pont/Latest/Macintosh HD/Users/jonas/Documents/julia/
root@P9X79:/home/jonas# du -hs /mnt/time-machine-root/pont/Latest/Macintosh\ HD/Users/jonas/Documents/
Aborted (core dumped)
root@P9X79:/home/jonas# du --version
du (GNU coreutils) 8.19

@abique
Copy link
Owner

abique commented Oct 8, 2012

Jonasaugust, would you mind if we continue the conversation here: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12601 ?

Also could you run du in gdb with debug symbols and get a backtrace with info locals for last level of the stack ?

Thanks ;)

@abique
Copy link
Owner

abique commented May 10, 2020

I guess the issue has been fixed on the coreutils by now.
Please re-open if not.

@abique abique closed this as completed May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants