gpt4 book ai didi

linux - 如果映射文件未显示在过程映射中,我如何找到它?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:50:58 25 4
gpt4 key购买 nike

我试图 gdb 一个函数,它的调用堆栈,调用函数落入地址 a4734000-a4e93000,所以我检查/proc//maps 文件,发现有:

a4734000-a4e93000 r-xp 00000000 00:00 0 
a4ee0000-a527c000 r-xp 00000000 00:00 0

这对我来说没有意义,因为通常它会显示为可执行地址映射的目标二进制文件。有谁知道这是某种把戏吗?非常感谢。

最佳答案

权限字段r-xp包含p,所以这些映射是私有(private)的。路径字段为空,因此这些映射是匿名的。

因此,这些是私有(private)匿名映射,使用 MAP_ANONMAP_PRIVATE 标志创建。它们可能是由 malloc(3) 创建的:

When allocating blocks of memory larger than MMAP_THRESHOLD bytes, the glibc malloc() implementation allocates the memory as a private anonymous mapping using mmap(2).

另见 this问题和documentation .

关于linux - 如果映射文件未显示在过程映射中,我如何找到它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31512704/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com