Comments (12)
Let me know if I can do anything to troubleshoot.
from xattr.
@fd0 - I'll take a look. Right now we use "golang.org/x/sys/unix"
(instead of syscalls), so maybe there is something....
from xattr.
@kuba-- thanks! I find this error very odd, the machine @ifelsefi used seemed to have enough free memory available, and usually Go panics instead of returning an error when no memory could be allocated... I'm a bit puzzled.
For the record, the commit of xattr
in question should be v0.2.3
(1d7b7ff).
from xattr.
@fd0, @ifelsefi - There are 2 places In xattr.List
where OOM
may happen. One is when we convert path
string to byte slice, and the second one is when we allocate memory for a buffer with all attributes. In your case, most likely it happened here:
https://github.com/pkg/xattr/blob/v0.2.3/xattr_linux.go#L37
I don't know if we can do anything with that. Maybe I can add extra check if buf != nil
and/or go to the unsafe low level and check memory limits (if I can allocate as much memory as needed).
Can you also check if it's reproducible with the latest?
from xattr.
from xattr.
@kuba-- thanks for the hints. @ifelsefi is the user in question and he's now running the latest version of restic which uses 0.3.1. We'll see what he reports. If it persists, I'd like him to run restic on just a single file, when that works out, we can e.g. use strace
to see what's going on between the program and the kernel.
What I find odd is that in all cases where I had Go programs which were unable to allocate enough memory, they panic instead of returning an error (especially whith make([]byte, n)
)...
from xattr.
from xattr.
@davecheney - the issue was encountered on linux, so most likely it's because sysAlloc
returned nil
:
https://github.com/golang/go/blob/77f9b2728eb08456899e6500328e00ec4829dddf/src/runtime/mem_linux.go#L21
https://github.com/golang/go/blob/4c1c839a3d2270d846f5a6d1cd1287e8560f0265/src/runtime/malloc.go#L1189
or
https://github.com/golang/go/blob/415e948eaea05930b2a16bab6af9e38b24e8414b/src/runtime/mheap.go#L1673
And because it was xattr + rustic it could be any place where errno is ENOMEM
, most likely from mmap:
https://github.com/golang/go/blob/77f9b2728eb08456899e6500328e00ec4829dddf/src/runtime/mem_linux.go#L164
from xattr.
from xattr.
I understand it happened on linux with version 0.2.3, so if you got an errno 12 from syscall:
https://github.com/pkg/xattr/blob/v0.2.3/xattr_linux.go#L39
Then there is nothing what we can do - we just propagate the error.
from xattr.
@fd0 @ifelsefi - shall I close it? Have you had a time to investigate and/or check the latest version?
from xattr.
Ah, yes, @ifelsefi reproduced the issue while running strace:
[pid 4640] listxattr("/[...].png", 0x1049ef0, 0) = -1 ENOMEM (Cannot allocate emory)
This looks like it's just ENOMEM
returned from the kernel, so in my opinion this library does the right thing. Sorry for the noise and thanks for the support!
from xattr.
Related Issues (18)
- xattr.Setxattr triggers an error with (errno 0) code HOT 4
- test fails: "operation not supported" HOT 7
- Darwin panic: com.apple.rootless attr has no value HOT 3
- Solaris/Illumos Support HOT 5
- List() fails with ERANGE on SMB1 HOT 4
- Tests fail on tmpfs HOT 4
- Symlink handling? HOT 4
- github build action HOT 2
- operation not supported
- Supporting for Windows HOT 11
- Code is not formatted according to gofmt? HOT 2
- Build is broken on linux with the recent changes HOT 2
- Typo
- Superfluous space in `(*Error).String()` when `Error.Name == ""` HOT 1
- API stutters a lot HOT 2
- Switch to github CI
- EINVAL instead of ENOTSUP on Solaris HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xattr.