<div dir="ltr">Hello,<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 18, 2017 at 8:30 PM, Roger Lipscombe <span dir="ltr"><<a href="mailto:roger@differentpla.net" target="_blank">roger@differentpla.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm attempting to figure out what binaries a particular process is<br>
holding onto. I have a core dump; I have a (seemingly) working gdb<br>
installation.<br></blockquote><div><br></div><div>If it is off-heap binaries that you are interested in I would use etp-offheapdump to get information from the process.</div><div><br></div><div>(gdb) etp-offheapdump $p->off_heap.first</div><div><div>[#Fun<0xa1e7c178,0xa20313a0,0x6,0>,</div><div> #Fun<0xa1e7c2e0,0xa2031360,0x1,0>,</div><div> #Fun<0xa1e7c268,0xa2031268,0x2,0>,</div><div> #RefcBinary<0x5,0xa2031140,0xb53c0f60,0xb53c0f78,0>,</div><div> #RefcBinary<0x3,0xa20310d0,0xb53c3468,0xb53c3480,0>,</div><div> #Fun<0xb5b11900,0xa20310a0,0x2,0x3>,</div><div> #Fun<0xb5b12350,0xa2031070,0x1,0>,</div><div> #Fun<0xb5b11f18,0xa2030d08,0x1,0>,</div><div> #RefcBinary<0x1,0xa2030c30,0xb53c1ac0,0xb53c1ad8,0>,</div><div> #Fun<0xb5b11900,0xa2030cd8,0x2,0x3>,</div><div> #Fun<0xb5b12350,0xa2030ca8,0x1,0>,</div><div> #Fun<0xb5b11f18,0xa2048608,0x1,0>,</div><div> #RefcBinary<0x1f,0xa20485a0,0xa1c405f0,0xa1c40608,0>,</div><div> #Fun<0xb5b11900,0xa2048668,0x2,0x3>,</div><div> #Fun<0xb5b12350,0xa2048638,0x1,0>,</div><div> #Fun<0xb5b11f18,0,0x1,0>].</div></div><div><br></div><div>The second to last value of the #RefcBinary should be a char * to the binary data.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I've found the Process I care about:<br>
<br>
    (gdb) set $p = (Process *)0x7f6be3d3f560<br>
    (gdb) etp-heapdump $p<br>
<br>
When I run etp-heapdump, I get a boatload of output.<br>
<br>
It starts with:<br>
<br>
% heapdump (22077):<br>
 0x7f6b93bb8028: | H:   5-tuple | A:0x0003aa4b | B:0x93bb8072 |<br>
A:0x0002abcb | C:0x93bb8090 | A:0x001a09cb | H:   2-tuple |<br>
<0.1805.000><br>
 0x7f6b93bb8068: | B:0x93bb80a2 | header     3 |   0x93bb8078 |<br>
0x93bb8080 |   0x93bb8088 | B:0x93bb80ba | C:0x93bb80d8 | header     2<br>
 0x7f6b93bb80a8: |   0x93bb80a8 |   0x93bb80b0 | header     3 |<br>
0x93bb80c0 |   0x93bb80c8 |   0x93bb80d0 | B:0x93bb80ea |    [] (NIL)<br>
 0x7f6b93bb80e8: | header     3 |   0x93bb80f0 |   0x93bb80f8 |<br>
0x93bb8100 | H:   2-tuple |           ok | <0.20777.000> | H:<br>
3-tuple<br>
<br>
How do I interpret this output?<br></blockquote><div><br></div><div>You have to have a good understanding of how the erlang term format works internally in order to understand what etp-heapdump prints. I believe that <a href="https://github.com/happi/theBeamBook">https://github.com/happi/theBeamBook</a> has a section describing how it works.</div><div><br></div><div>Lukas</div></div></div></div>