hmemory is a memory error detector for c/c++ programs.
- error reports
- test cases
- usage example
hmemory is a lightweight memory error detector for c/c++ programs, specifically designed for embedded systems.
main use case may include embedded systems where valgrind -
memcheck support is not available.
and has benefits of:
- has a negligible effect run-time speed
- does not require any source code change
- operating system and architecture independent
- easy to use
can detect errors of:
- double/invalid free
- mismatched use of malloc versus free
- writing before or end of malloc'd blocks
- invalid realloc
- overlapping src and dst pointers in memcpy
- memory leaks
- compile-time options
- run-time options
2.1. compile-time options
hthread configuration parameters can be set using make flags, please check example section for demonstration.
enable/disable reporting call trace information on error, useful but depends on libbdf, libdl, and
backtrace function from glibc. may be disabled for toolchains which does not support backtracing.
dump callstack info (function call history) for error point.
terminate the process on any pthreads api misuse and/or lock order violation.
2.2. run-time options
hthread reads configuration parameters from environment via getenv function call. one can either set/change environment
variables in source code of monitored project via setenv function call, or set them globally in running shell using
please check example section for demonstration.
3. error reports
4. test cases
5. usage example
if you are using the software and/or have any questions, suggestions, etc. please contact with me at
Copyright (C) 2008-2013 Alper Akcan firstname.lastname@example.org
This work is free. It comes without any warranty, to the extent permitted
by applicable law. You can redistribute it and/or modify it under the terms
of the Do What The Fuck You Want To Public License, Version 2, as published
by Sam Hocevar. See the COPYING file for more details.