File descriptor leak when serializing into SurfaceDescriptorAndroidHardwareBuffer
Categories
(Core :: Graphics, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox96 | --- | fixed |
People
(Reporter: aosmond, Assigned: aosmond)
Details
Attachments
(1 file)
https://searchfox.org/mozilla-central/rev/3881c4ca80d1b4b2f43be695438ecaf90ee4f86c/gfx/layers/opengl/TextureClientOGL.cpp#271
https://searchfox.org/mozilla-central/rev/3881c4ca80d1b4b2f43be695438ecaf90ee4f86c/gfx/layers/client/TextureClientSharedSurface.cpp#87
There is a footgun with ipc::FileDescriptor(readerFd.release()) where we pass a raw file descriptor due to the release() call. The constructor chosen actually dups the file handle, requiring us to free our own:
We should just do a move to avoid this.
| Assignee | ||
Comment 1•3 years ago
|
||
We accidently duplicate the file descriptor when serializing because we
hit a constructor for ipc::FileDescriptor which duplicates the handle
instead of just taking it. This means we are supposed to close it
explicitly but we've already forgotten about it. We should just do a
move instead to avoid this.
Comment 3•3 years ago
|
||
| bugherder | ||
Description
•