NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Show HN: Heap Explorer (github.com)
dzaima 22 days ago [-]
Would be nice to mention how to determine those *_OFFSET constants. For reference, on my linux mint (glibc 2.39) system this gives them:

    gdb /lib/x86_64-linux-gnu/libc.so.6 -ex 'p &main_arena' -ex 'p malloc'
Also, can attach to an existing process via:

    sudo gdb -p <PID_OF_PROCESS> -ex 'call (void*) dlopen("/path/to/libheap_explorer.so", 2)' -ex 'p explore_heap()'
jamesy0ung 22 days ago [-]
If you are using a Mac, heapster is a different but also interesting tool for learning about what goes on inside the heap

https://blackwinghq.com/blog/posts/playing-with-libmalloc/

heinrichhartman 22 days ago [-]
Can you modify this to listen to a signal (e.g. SIGUSR) instead, for triggering the REPL?
bkallus 22 days ago [-]
I went with SIGINT because it's more fun to press ctrl-c than to pgrep and kill. If you'd rather use SIGUSR1, just change SIGINT to SIGUSR1 line 654.
heinrichhartman 22 days ago [-]
OK. RTFM. You already did! Wonderful.
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 02:56:58 GMT+0000 (Coordinated Universal Time) with Vercel.