嵌入式系统堆一致性检查

发布于 2024-09-02 05:21:04 字数 361 浏览 2 评论 0原文

我遇到这样的崩溃:

#0  0x2c58def0 in raise () from /lib/libpthread.so.0
#1  0x2d9b8958 in abort () from /lib/libc.so.0
#2  0x2d9b7e34 in __malloc_consolidate () from /lib/libc.so.0
#3  0x2d9b6dc8 in malloc () from /lib/libc.so.0

我猜这是堆损坏问题。 uclibc 没有 mcheck/mprobe。 Valgrind 似乎不支持 MIPS,我的应用程序(多线程)依赖于硬件特定的驱动程序。有什么建议来检查堆的一致性并检测损坏吗?

I get a crash like this:

#0  0x2c58def0 in raise () from /lib/libpthread.so.0
#1  0x2d9b8958 in abort () from /lib/libc.so.0
#2  0x2d9b7e34 in __malloc_consolidate () from /lib/libc.so.0
#3  0x2d9b6dc8 in malloc () from /lib/libc.so.0

I guess it is a heap corruption issue. uclibc does not have mcheck/mprobe. Valgrind does not seem to MIPS support and my app (which is multi-threaded) depends on hw specific drivers. Any suggestions to check the consistency of the heap and to detect corruption?

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

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

发布评论

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

评论(2

简单 2024-09-09 05:21:04

我会使用替代的malloc()(另请参阅这个答案)可以很容易地变成更详细。我并不是说您需要垃圾收集,但您似乎确实需要该链接提供的额外日志记录设施。

如果是堆损坏,收集器也会被它阻塞,并给你更有意义的消息。使用起来应该不会太困难,得到你需要的,然后停止使用(特别是如果你只是让它拦截malloc())。

它不会像 Valgrind 那样将问题归零,但至少它是一个选择:)

I would use a replacement malloc() (see also this answer) that can easily be made to be more verbose. I'm not saying you need garbage collection, but you do seem to need the additional logging facilities that the link provides.

If it is heap corruption, the collector is going to choke on it as well, and give you more meaningful messages. It should not be too difficult to use, get what you need, then stop using (especially if you just let it intercept malloc()).

Its not going to zero in on the problem like Valgrind does, but at least its an option :)

寄人书 2024-09-09 05:21:04

您可以编写冒充硬件的存根驱动程序,这应该让您可以在功能更齐全的环境中构建和测试程序。

You could write stub drivers that pretend to be the hardware, which should let you build and test your program in a more full-featured environment.

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