English 中文(简体)
Heap Consistency Checking on Embedded System
原标题:

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?

最佳回答

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 :)

问题回答

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.





相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签