Code Monkey home page Code Monkey logo

Comments (7)

yanqi27 avatar yanqi27 commented on July 20, 2024

It shouldn't be difficult. You may look into the following files and compare with glibc's malloc.c of version 2.13. I don't have the environment to test and verify and hence didn't include this version.

  • src/heap_ptmalloc.h
  • src/heap_ptmalloc.cpp

from core_analyzer.

rahulgopi avatar rahulgopi commented on July 20, 2024

Thank you Michael. I looked at the malloc_state in glibc-2.13 and it looks very different. Adding this fails the copy methods as the struct members are very different from the rest.

#define MALLOC_STATE_MAGIC 0x444c4541l
#define MALLOC_STATE_VERSION (0_0x100l + 1l) /_ major*0x100 + minor */

struct malloc_state {
long magic;
long version;
mbinptr av[NAV * 2 + 2];
char* sbrk_base;
int sbrked_mem_bytes;
unsigned long trim_threshold;
unsigned long top_pad;
unsigned int n_mmaps_max;
unsigned long mmap_threshold;
int check_action;
unsigned long max_sbrked_mem;
unsigned long max_total_mem;
unsigned int n_mmaps;
unsigned int max_n_mmaps;
unsigned long mmapped_mem;
unsigned long max_mmapped_mem;
int using_malloc_checking;
};

from core_analyzer.

yanqi27 avatar yanqi27 commented on July 20, 2024

Could you try the branch glibc-2.13? I include this glibc version in core analyzer. Let me know if it works for you or not.

from core_analyzer.

rahulgopi avatar rahulgopi commented on July 20, 2024

Thank you very much Michael. It worked fine on one core. Another one, failed to obtain &main_arena from gdb. It complains variable doesnt exist. I have to look into the core / gdb further , again not an issue with core_analyzer.
Thank you again for adding support for glibc-2.13.

from core_analyzer.

rahulgopi avatar rahulgopi commented on July 20, 2024

Hi Michael,
I am trying to decode a core file. When I try to get the & or main_arena or mp_ from gdb, it is not finding the symbol. I also tried to attach to the running process and see if the symbol is there, but same result

(gdb) p malloc
$1 = {<text variable, no debug info>} 0x7fe50263d2b0
(gdb) p &main_arena
No symbol "main_arena" in current context.
(gdb) p &mp_
No symbol "mp_" in current context.

binary is not stripped.
file bcq
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped

Greatly appreciate any insights.

from core_analyzer.

yanqi27 avatar yanqi27 commented on July 20, 2024

@rahulgopi
Since you get one core file working, you may want to check the environment of the core that doesn't work. main_arena and mp_ are variables in libc.so.

from core_analyzer.

yanqi27 avatar yanqi27 commented on July 20, 2024

I will reopen it when user data is available.

from core_analyzer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.