【问题标题】:Valgrind program is crashing Bad permissions for mapped region at addressValgrind 程序正在崩溃 地址映射区域的错误权限
【发布时间】:2011-09-24 08:12:21
【问题描述】:

我正在尝试运行我的程序来检查我的程序中的内存泄漏,但是每当我启动我的程序时,我就会得到 ​​p>

==3476== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==3476== Bad permissions for mapped region at address 0xCFE3FF8
==3476==    at 0x005212e1: get_document_root (mongoose.c:1557)
==3476==


==3476== HEAP SUMMARY:
==3476== in use at exit: 2,134,492 bytes in 3,948 blocks
==3476== total heap usage: 5,473 allocs, 1,525 frees, 2,863,520 bytes allocated
==3476==

在完整的 valgrind 日志中,您在内存上没有无效的读取或写入。 我无法理解为什么它会崩溃。

【问题讨论】:

  • 您是否尝试查看 mongoose.c 的第 1557 行?
  • @Paul R 即行 root = next_option(conn->ctx->config[DOCUMENT_ROOT], document_root, NULL);来自code.google.com/p/mongoose/downloads/…
  • 太棒了-应该是一个容易修复的错误!
  • 但我没有发现任何意外。
  • 使用调试器 - 在该行设置断点 - 查看传递给 next_option 的参数。

标签: c++ memory-management valgrind memcheck


【解决方案1】:

由于自定义 404 页面而崩溃,并且该文件不存在。所以它无限地寻找那个文件并做缓冲区溢出。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-14
    • 2020-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多