Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hooked allocator frame not found, returning empty trace message is displayed in heapprofiler #410

Closed
alk opened this issue Aug 23, 2015 · 5 comments

Comments

@alk
Copy link
Contributor

alk commented Aug 23, 2015

Originally reported on Google Code with ID 407

What steps will reproduce the problem?
1. i built gperf 2.0 in the cross compile environment for arm
2. there is no issue to use tcmalloc and cpu profiler
3. but, when i use heap profiler, there is an error like below
   "Hooked allocator frame not found, returning empty trace"

What is the expected output? What do you see instead?

<expected output>
Dumping heap profile to ./mybin.hprof.0161.heap (1 MB allocated cumulatively, 1 MB
currently in use)

<current output>
Hooked allocator frame not found, returning empty trace

i tried to use ./configure --enable-frame-pointers, but same error is happened again

What version of the product are you using? On what operating system?
O/S : linux 2.6.36
perf : 2.0

Please provide any additional information below.
- i used scratchbox2 to build tcmalloc for arm


Reported by bokun.choi on 2012-02-27 10:45:43


- _Attachment: [libprofiler.so.0.3.0](https://storage.googleapis.com/google-code-attachments/gperftools/issue-407/comment-0/libprofiler.so.0.3.0)_ - _Attachment: [libtcmalloc.so.4.1.0](https://storage.googleapis.com/google-code-attachments/gperftools/issue-407/comment-0/libtcmalloc.so.4.1.0)_
@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

I did almost exact the same thing you have done and got exact the same problem, but
my OS is Linux 2.6.32.12-0.7 with  Intel X64, buiding with g++.


Reported by meng.mobile on 2012-03-01 13:20:53

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

The function generating this message seems to have a comment regarding this issue. Refer
to the comment at the end of the function MallocHook_GetCallerStackTrace in the file
src/malloc_hook.cc. If that doesn't work then I would do the following:

1. Set a breakpoint in this function using gdb and generate a full backtrace.
2. Instrument this function to print out the backtrace as it is generating it.

From the results above we should be able to further determine where things are going
wrong.

-Dave

Reported by chappedm on 2012-03-02 16:16:43

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

I added callstack


(gdb)  b MallocHook_GetCallerStackTrace
Breakpoint 2 at 0x401afd60: file src/malloc_hook.cc, line 655.
(gdb) c
Continuing.

Breakpoint 2, MallocHook_GetCallerStackTrace (result=0xbecd66b8, max_depth=32, skip_count=4)
at src/malloc_hook.cc:655
1: x/i $pc
=> 0x401afd60 <MallocHook_GetCallerStackTrace(void**, int, int)+8>:
    ldr r10, [pc, #404] ; 0x401afefc <MallocHook_GetCallerStackTrace(void**, int, int)+420>

(gdb) bt full
#0  MallocHook_GetCallerStackTrace (result=0xbecd66b8, max_depth=32, skip_count=4)
at src/malloc_hook.cc:655
        stack =           {0x400fa020,
          0x0,
          0x1,
          0x2d5,
          0x0,
          0x400fa020,
          0x40197c7e,
          0x40197c7e,
          0x401917e4,
          0x40190d04,
          0x1,
          0x4018dfb4,
          0x400fa1d8,
          0xe16ee263,
          0xbecd6714,
          0x401912d4,
          0x400fa020,
          0x40197c7e,
          0xffffffff,
          0xbecd66fc,
          0x401d5560,
          0x400cb4c0,
          0x41025000,
          0x400cb000,
          0x400fa020,
          0x4a690,
          0x4018b000,
          0xbecd6824,
          0x4100db38,
          0x0,
          0x1,
          0x1,
          0x0,
          0xbecd6734,
          0x401912d4,
          0xbecd6700,
          0x401d5560,
          0x15588,
          0xbecd66b8,
          0x1,
          0x3e8,
          0x3e8,
          0x0,
          0xc4000}
        depth = <value optimized out>
#1  0x401b7914 in RecordAlloc (ptr=0xc4000, size=1000) at src/heap-profiler.cc:303
        stack =           {0x0,
          0x400fa1d8,
          0x41025000,
          0x0,
          0x40190d04,
          0x400fa020,
          0xbecd679c,
          0xffffffff,
          0xbecd6768,
          0xc4000,
          0x400cb4c0,
          0x41025000,
          0x400cb000,
          0x400fa020,
          0x4ac28,
          0x4018b000,
          0xbecd6824,
          0x4100db38,
          0x0,
          0x1,
          0x1,
          0x0,
          0x400fa020,
          0x40190d04,
          0x400cb4c0,
          0xc4000,
          0x3e8,
          0xbecd675c,
          0x928e0,
          0x928e0,
          0xc4000,
          0x0,
          0x3e8}
        depth = <value optimized out>
#2  NewHook (ptr=0xc4000, size=1000) at src/heap-profiler.cc:326
No locals.
#3  0x401b00f4 in MallocHook::InvokeNewHookSlow (p=0xc4000, s=1000) at src/malloc_hook.cc:525
        i = <value optimized out>
        hooks =           {0x401b78e4 <NewHook(void const*, size_t)>,

          0x928e0 <std::ostreambuf_iterator<wchar_t, std::char_traits<wchar_t> > std::money_put<wchar_t,
std::ostreambuf_iterator<wchar_t, std::char_traits<wchar_t> > >::_M_insert<false>(std::ostreambuf_iterator<wchar_t,
std::char_traits<wchar_t> >, std::ios_base&, wchar
_t, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
const&) const+1756>,
          0xc4000,
          0,
          0x3e8,
          0xbecd6824,
          0x41014018}
        num_hooks = 1
#4  0x401bf12c in InvokeNewHook (size=1000) at src/malloc_hook-inl.h:161
        hook = <value optimized out>
#5  tc_malloc (size=1000) at src/tcmalloc.cc:1493
        result = 0xc4000
#6  0x00008ad0 in main () at multithread_heapprofiler.c:99
        pAtr = 0x8b44 "\370E-\351"
        p_thread =           {34748,
          35144,
          35732,
          1104460656,
          0}
        status = 0
        j = 0
        rotate = 0

Reported by bokun.choi on 2012-03-05 09:23:43

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

I found the same problem with GCC 4.7 on Fedora 17. I got it to work by manually editing
the makefile to add -fno-omit-frame-pointers, as per revision 150.

Reported by michael.barton10 on 2012-06-19 14:10:28

@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

-fno-omit-frame-pointers is now explicitly specified for i386 as gcc changed the default
to omit. Code is on the trunk at the present time waiting for release. Refer to issue-385.

Reported by chappedm on 2013-03-11 02:04:25

@alk alk closed this as completed Feb 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant