-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Crash: listxattr failed #1462
Comments
Can you reproduce this with patched code if i give you some patch? |
OK, should I build it then from github? (I was running from a repo package...) |
Maybe make a copy of the original file, then apply patch. If you reproduce with the patch, the exception message will contain n and n2 values. Guess we can fix the issue if we know these. I suspect that they are both positive but not equal. Also, I need the line from /proc/mounts of the filesystem where your backup source files are. |
It says this:
|
You didn't apply the patch, you have one single-quote too much, after "failed". |
Note: the code for freebsd and darwin is rather similar, so might need the same fix. |
Sorry, I had to go somewhere. I'll have a look as soon as I get back. -------- Original Message --------
|
Result:
|
Also, I xfs_repaired the filesystem (no problems reported). |
The code looks racy. Is this a consistent issue that always appears on the same file or a bit more random looking?
|
I've looked at some other xattr code, their strategy:
hmm, that's also problematic: https://bugs.python.org/issue13669 use similar approach as for lz4 buffer growing (thread-local module level buffer)? |
Yes. 4K is a sane starting buffer size and would often require no resizing at all, since often files have no xattrs at all, or only the security namespace or other small xattrs. Also, the failure in step 4 in #1462 (comment) should absolutely not be fatal, since it's inherently racy (filesystem APIs that are racy... can't be! :) |
…#1462 this also fixes the race condition seen in borgbackup#1462 because there is only 1 call now. either it succeeds, then we get the correct length as result and truncate the result value to that length. or it fails with ERANGE, then we grow the buffer to double size and repeat. or it fails with some other error, then we throw OSError.
Here is the /proc/mounts line for source and dest: |
…#1462 this also fixes the race condition seen in borgbackup#1462 because there is only 1 call now. either it succeeds, then we get the correct length as result and truncate the result value to that length. or it fails with ERANGE, then we grow the buffer to double size and repeat. or it fails with some other error, then we throw OSError.
There is at least one more race in the xattr code itself: #906 |
…#1462 this also fixes the race condition seen in borgbackup#1462 because there is only 1 call now. either it succeeds, then we get the correct length as result and truncate the result value to that length. or it fails with ERANGE, then we grow the buffer to double size and repeat. or it fails with some other error, then we throw OSError.
Could you give me some instructions how I could try this? |
You would need to git pull or git clone from the branch the pull request is made from and install borg from source (see docs). Or just wait until this got reviewed/merged, it will hopefully get into 1.0.7rc2 and can be tried there. |
…#1462 this also fixes the race condition seen in borgbackup#1462 because there is only 1 call now. either it succeeds, then we get the correct length as result and truncate the result value to that length. or it fails with ERANGE, then we grow the buffer to double size and repeat. or it fails with some other error, then we throw OSError.
xattr: dynamically grow result buffer until it fits, fixes #1462
Fixed by #1464. |
Sure, I'm eager to try! Which branch was the pull request made from?? |
As it is merged now, you can use 1.0-maint branch. |
So far I did:
Then it seems I am on a too old distribution (Ubuntu 14.04.5):
Don't want to mess too much with this box... If I store them on ext4 this bug won't be a problem, right?? |
I've just released 1.0.7rc2 (with a lot of xattr fixes/changes), so you could just take that. |
I got the standalone binary borg-linux64, and did:
Thank you very much Thomas and friends! |
Thanks for testing. |
(Same issue as jborg/attic#120 it seems, very similar traceback.)
Borg (1.0.6-2
ubuntu14.04.1ppa1) failed just now. From xfs to xfs (on same file system), on Ubuntu 14.04 trusty. Of my five directories (each a separate archive, same repo) only one worked. Yesterday all five worked.Example failure:
The text was updated successfully, but these errors were encountered: