[GH-ISSUE #386] userdata lead to memory leak in fuse demo #227

Open
opened 2026-10-26 09:47:25 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @lcxywfe on GitHub (Jan 20, 2026).
Original GitHub issue: https://github.com/deepseek-ai/3FS/issues/386

In the fuse demo

ios = [(iov[:512], fd, 512), (iov[512:], fd, 0)] # iov, fd, offset
for io in ios:
    ior.prepare(io[0], True, io[1], io[2], userdata=io) # iov, for_read, fd, offset, userdata
    # Only for_read == True is allowed, because ior has for_read == True
    # userdata must be a referenced python object, we reference io in the list ios, so it will not be sent to GC
resv = ior.submit().wait(min_results=2)

Passing io as userdata will prevent io from being released. May be a misleading of userdata usage?

Originally created by @lcxywfe on GitHub (Jan 20, 2026). Original GitHub issue: https://github.com/deepseek-ai/3FS/issues/386 In the fuse [demo](https://github.com/deepseek-ai/3FS/blob/main/hf3fs_fuse/fuse_demo.py#L20) ``` ios = [(iov[:512], fd, 512), (iov[512:], fd, 0)] # iov, fd, offset for io in ios: ior.prepare(io[0], True, io[1], io[2], userdata=io) # iov, for_read, fd, offset, userdata # Only for_read == True is allowed, because ior has for_read == True # userdata must be a referenced python object, we reference io in the list ios, so it will not be sent to GC resv = ior.submit().wait(min_results=2) ``` Passing ```io``` as ```userdata``` will prevent ```io``` from being released. May be a misleading of ```userdata``` usage?
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/3FS#227
No description provided.