rogerhu/gdb-heap

No symbol "main_arena" in current context.

annemacedo-tw opened this issue · 2 comments

I currently have a docker setup with GDB, like this

I'm trying to debug a python3 app, I have python3-dbg installed on the docker container with GDB.

[Current thread is 1 (LWP 9335)]
Traceback (most recent call last):
  File "<string>", line 5, in <module>
  File "/home/gdb-heap/gdbheap.py", line 17, in <module>
    from heap.commands import register_commands
  File "/home/gdb-heap/heap/commands.py", line 21, in <module>
    from heap.glibc import glibc_arenas
  File "/home/gdb-heap/heap/glibc.py", line 445, in <module>
    glibc_arenas = GlibcArenas()
  File "/home/gdb-heap/heap/glibc.py", line 415, in __init__
    self.main_arena = self.get_main_arena()
  File "/home/gdb-heap/heap/glibc.py", line 420, in get_main_arena
    return gdb.parse_and_eval("main_arena")
gdb.error: No symbol "main_arena" in current context.
/home/gdb-heap-commands:7: Error in sourced command file:

Seems similar to hugsy/gef#81

The commit that mostly flags an exception for the link you mentioned is here: SakiiR/gef@c373f0c

Are you generating the core dump from inside/outside the container? Are you using gdb with access to the debug version of libc as well?

https://stackoverflow.com/questions/37960788/why-there-isnt-main-arena-in-libc-so-symbol-table-while-there-is-one-in-malloc

Hey @rogerhu .

I'm generating the core dump from inside the container. I believe I was using gdb with debug libc.