Valgrind 错误:UME 失败,错误 22
我正在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我没有答案,但这个问题有一个未解决的错误。
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
我为我的案例解决了这个问题并提交了补丁:
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.我也遇到了这个错误。在我的情况下,我正在分析的程序包含巨大的静态分配数组,这导致
.bss
段大小爆炸(超过 2 GiB):大型数组仅在重负载下进行测试时才需要,所以我在代码中将数组定义得小得多并重新编译。这将
.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):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 under932000000
in order for Valgrind to run without the error, although this threshold seemed somewhat arbitrary.