Valgrind 错误:UME 失败,错误 22

发布于 2024-10-03 07:04:58 字数 284 浏览 5 评论 0原文

我正在 Valgrind 中进行工具开发,并收到以下错误:

valgrind: mmap(0x8048000, 4096) failed in UME with error 22 (Invalid argument).
valgrind: this can be caused by executables with very large text, data or bss segments.

但我的可执行文件除了简单的变量赋值之外什么都没有。我不明白如何解决这个问题。有什么建议吗?

I am playing around with tool development in Valgrind and am getting the following error:

valgrind: mmap(0x8048000, 4096) failed in UME with error 22 (Invalid argument).
valgrind: this can be caused by executables with very large text, data or bss segments.

but my executable has nothing but simple variable assignments. I am not able to understand how to fix this problem. Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

檐上三寸雪 2024-10-10 07:04:58

我没有答案,但这个问题有一个未解决的错误。

http://bugs.kde.org/show_bug.cgi?id=138424

I don't have an answer, but there is an open bug on this issue.

http://bugs.kde.org/show_bug.cgi?id=138424

深白境迁sunset 2024-10-10 07:04:58

我为我的案例解决了这个问题并提交了补丁:

https://bugs.kde.org/ show_bug.cgi?id=290061

如果您或其他遇到此问题的人正在使用 -pie 构建可执行文件,这也可能对您有所帮助。

I solved this for my case and submitted a patch:

https://bugs.kde.org/show_bug.cgi?id=290061

If you or anyone else having this problem are building your executable with -pie, this might help you too.

故事与诗 2024-10-10 07:04:58

我也遇到了这个错误。在我的情况下,我正在分析的程序包含巨大的静态分配数组,这导致 .bss 段大小爆炸(超过 2 GiB):

$ size ./MyExe
   text    data     bss          dec          hex      filename
  50324    2480     2338486216   2338539020   8b63460c MyExe.exe

大型数组仅在重负载下进行测试时才需要,所以我在代码中将数组定义得小得多并重新编译。这将 .bss 段缩小到更合理的范围,并允许我使用 Valgrind 正常运行程序。

注意:我似乎需要获取 932000000 下的 .bss 段,以便 Valgrind 运行时不会出现错误,尽管这个阈值似乎有些任意。

I encountered this error as well. In my situation, the program I was analyzing contained huge statically-allocated arrays, which caused the .bss segment size to blow up (over 2 GiB):

$ size ./MyExe
   text    data     bss          dec          hex      filename
  50324    2480     2338486216   2338539020   8b63460c MyExe.exe

The large arrays were only necessary for testing under heavy loads, so I defined the arrays to be much smaller in the code and recompiled. This shrunk the .bss segment down to something more reasonable, and allowed me to run the program normally with Valgrind.

Note: It seemed I needed to get the .bss segment under 932000000 in order for Valgrind to run without the error, although this threshold seemed somewhat arbitrary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文