Open
Description
RT-Thread Version
Hardware Type/Architectures
risc-v/K230
Develop Toolchain
GCC
Describe the bug
- dfs_v2打开pagecache,运行任意elf后,通过free对比运行前后发现存在memleak
Other additional context
定位到具体位置有两处:
- 加载elf文件时对应的
struct dfs_file *file
结构未释放,原因为elf map时会增加file->ref_count
,导致执行close->fd_release->fdt_fd_release
时file->ref_count
不等于1,未能正常释放 - 用户程序退出时会执行
lwp_exit->_clear_child_tid->sys_futex
,此处是个share futex,不会被删除
对于share futex,还有一个疑问,对于没有进程使用的futex似乎没有删除操作?