Alper Akcan : ~/projects/libhmemory

News

Projects

Documents

Contact

RSS Feed

Donations (SF)

 
libhmemory
What is?

hmemory is a memory error detector for c/c++ programs.

project is hosted at GitHub. and a detailed documentation can be found at README.md

Documents

hmemory

hmemory is a memory error detector for c/c++ programs.

  1. overview
  2. configuration
  3. error reports
  4. test cases
  5. usage example
  6. contact
  7. license

1. overview

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 - addrcheck, or 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

2. configuration

  1. compile-time options
  2. run-time options

2.1. compile-time options

hthread configuration parameters can be set using make flags, please check example section for demonstration.

  • HTHREAD_ENABLE_CALLSTACK

    default 1

    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.

  • HTHREAD_REPORT_CALLSTACK

    default 1

    dump callstack info (function call history) for error point.

  • HTHREAD_ASSERT_ON_ERROR

    default 1

    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 export function.

please check example section for demonstration.

  • hthread_report_callstack

    default 1

    dump callstack info (function call history) for error point.

  • hthread_assert_on_error

    default 1

    terminate the process on any pthreads api misuse and/or lock order violation.

3. error reports

4. test cases

5. usage example

6. contact

if you are using the software and/or have any questions, suggestions, etc. please contact with me at alper.akcan@gmail.com

7. license

Copyright (C) 2008-2013 Alper Akcan alper.akcan@gmail.com

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.

Downloads

File Name
        
Date
        
File Size

 
libhmemory-git-snapshot.zip        unkown        unkown bytes

(CL) alper akcan
http://www.valgrind.org   hacker emblem   Valid HTML 4.01!   Viewable With Any Browser   [Valid Rss]   Open Source