TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Heap Explorer

73 pointsby bkallus4 months ago
I wrote a little LD_PRELOAD library that makes it easy to inspect and interact with a running program&#x27;s glibc heap.<p>It&#x27;s fun to pause processes, free a bunch of their allocations, then resume them. Most of the time, the processes continue as though nothing happened, but sometimes they do interesting things :)

3 comments

dzaima3 months 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:<p><pre><code> gdb &#x2F;lib&#x2F;x86_64-linux-gnu&#x2F;libc.so.6 -ex &#x27;p &amp;main_arena&#x27; -ex &#x27;p malloc&#x27; </code></pre> Also, can attach to an existing process via:<p><pre><code> sudo gdb -p &lt;PID_OF_PROCESS&gt; -ex &#x27;call (void*) dlopen(&quot;&#x2F;path&#x2F;to&#x2F;libheap_explorer.so&quot;, 2)&#x27; -ex &#x27;p explore_heap()&#x27;</code></pre>
jamesy0ung3 months ago
If you are using a Mac, heapster is a different but also interesting tool for learning about what goes on inside the heap<p><a href="https:&#x2F;&#x2F;blackwinghq.com&#x2F;blog&#x2F;posts&#x2F;playing-with-libmalloc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blackwinghq.com&#x2F;blog&#x2F;posts&#x2F;playing-with-libmalloc&#x2F;</a>
heinrichhartman3 months ago
Can you modify this to listen to a signal (e.g. SIGUSR) instead, for triggering the REPL?
评论 #42967140 未加载
评论 #42967111 未加载