d99kris/heapusage

No stacktrace under Raspbian / ARM

Closed this issue · 3 comments

I installed heapusage on a raspberry pi 3 (raspian) as an alternative of valgrind.
When I execute heapusage for my program, I get the following output :

root@raspberrypi:/home/pi/git/floppy-bird-S6-2016/robot/src# heapusage ./colourTrack -l confighello
==32437== Heapusage - https://github.com/d99kris/heapusage
==32437== 
==32437== HEAP SUMMARY:
==32437==     in use at exit: 17705401 bytes in 3339 blocks
==32437==   total heap usage: 21504 allocs, 22519 frees, 103836237 bytes allocated
==32437== 
==32437== 17705401 bytes in 3339 block(s) are lost, originally allocated at:
==32437== 
==32437== LEAK SUMMARY:
==32437==    definitely lost: 17705401 bytes in 3339 blocks
==32437== 

I supose there is an issue with the stack as there is no output log...

Heapusage hasn't been tested on ARM yet. Internally it uses backtrace() to get the call stack, and I understand ARM requires compilation with -funwind-tables in order for that to work.

As a quick fix you could try adding -funwind-tables in heapusage src/Makefile.am (both in libheapusage_la_CFLAGS and libheapusage_la_CXXFLAGS) and rebuild it, and also use it when compiling your own program.

I'll probably only get around to try this myself on ARM in a couple of days.

You're right, it works well by adding -funwind-tables in heapusage src/Makefile.am. I haven't had to add the flag in my own Makefile (the one to compile my program) to make it work.

Many thanks!

Great! Thanks for letting me know. I'll update heapusage's Makefile.am shortly.