deepseek-ai / deepseek-ai/3FS

userdata lead to memory leak in fuse demo

Open
#386 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
10.2k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.