[gnome-love] Help - libc hooks



Hello,

I need a little help with my work. I made some hooks into libc's malloc() and friends, following the tutorial from http://www.gnu.org/software/libtool/manual/libc/Hooks-for-Malloc.html and I tested them with gedit and pidgin.

From the output, some interesting lines caught my attention:

...
USED    0x810a430    1024
USED    0x810aad8    6
USED    0x810aae8    16
USED    0x810ab00    6
USED    0x810ab10    12
FREE    0x810a2c8    352
USED    0x810a2c8    352
USED    0x810a430    1024
...
(this was from gedit; notice the first and last lines)

...
USED    0x8131460    8
USED    0x8131900    16
USED    0x8131218    16
FREE    0x8131218    16
USED    0x8131430    8
USED    0x8131df8    28
USED    0x8131218    16
USED    0x8131de8    8
USED    0x8131460    8
USED    0x8131460    8
...
(this was from pidgin, also weird)

Here is my code: http://github.com/asoare/bprof/tree/master ( my_malloc_hook.c ).
In the above output, USED means malloc and FREE means, obviously, free.

I think there is a bug in my_malloc_hook.c, but i cannot find it. I would really appreciate it if you could give me a hint.

Thank you.

--
Andrei Soare

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]