Skip to content

[Bug] dfs_v2打开pagecache,运行elf后会存在memleak #9900

Open
@wycwyhwyq

Description

RT-Thread Version

53bd56c

Hardware Type/Architectures

risc-v/K230

Develop Toolchain

GCC

Describe the bug

  1. dfs_v2打开pagecache,运行任意elf后,通过free对比运行前后发现存在memleak

Other additional context

定位到具体位置有两处:

  1. 加载elf文件时对应的struct dfs_file *file结构未释放,原因为elf map时会增加file->ref_count,导致执行close->fd_release->fdt_fd_releasefile->ref_count不等于1,未能正常释放
  2. 用户程序退出时会执行lwp_exit->_clear_child_tid->sys_futex,此处是个share futex,不会被删除

对于share futex,还有一个疑问,对于没有进程使用的futex似乎没有删除操作?

Metadata

Assignees

No one assigned

    Labels

    BSP: K230BSP related with K230

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions