qchbai / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

make check fails on Ubuntu 11.10 #385

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. download google-perftools-1.8.3
2. ./configure
3. make
4. make check

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

...
src/system-alloc.cc:423] SbrkSysAllocator failed.
src/system-alloc.cc:423] MmapSysAllocator failed.
Testing tc_version()
PASS
PASS: tcmalloc_and_profiler_unittest
======================================
9 of 43 tests failed
Please report to opensource@google.com
======================================
make[1]: *** [check-TESTS] Error 1
make[1]: Leaving directory `/home/carles/google-perftools-1.8.3'
make: *** [check-am] Error 2

What version of the product are you using? On what operating system?
google-perftools-1.8.3
Ubuntu 11.10
uname -a
Linux CS-laptop 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011 
i686 i686 i386 GNU/Linux

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 
4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr 
--program-suffix=-4.6 --enable-shared --enable-linker-build-id 
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext 
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu 
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin 
--enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 
--with-tune=generic --enable-checking=release --build=i686-linux-gnu 
--host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

Please provide any additional information below.

I attach the configure and make check outputs. Then, if I "sudo make install" 
and try to use heap profile, I obtain 

Starting tracking the heap
Had other new/delete MallocHook-s set. Are you using the heap leak checker? Use 
--heap_check="" to avoid this conflict.

(but this is maybe my fault)

Original issue reported on code.google.com by carles.f...@gmail.com on 18 Dec 2011 at 6:05

Attachments:

GoogleCodeExporter commented 9 years ago
The errors all look like you're not able to get stacktraces properly.  How are 
you getting stack traces?  Did you run configure --enable-frame-pointers, or 
are you depending on libunwind?  It looks like the latter, based on how you 
said you ran configure above.  My guess is libunwind doesn't work properly with 
perftools on ubuntu 11.  That's not surprising; see the INSTALL file for more 
info about libunwind and perftools.

If you run ./configure --enable-frame-pointers, then these problems should go 
away.  See the INSTALL file (and the README) for more info.

Closing this WorkingAsIntended, even though it's not great, since we don't have 
it in our power to change libunwind to work better with perftools (we've tried!)

Original comment by csilv...@gmail.com on 19 Dec 2011 at 10:00

GoogleCodeExporter commented 9 years ago
Thanks so much for your answer!

Now I've done:
./configure --enable-frame-pointers
make
sudo make install

then I compile my program with

-fno-omit-frame-pointer -fno-builtin-malloc -fno-builtin-calloc 
-fno-builtin-realloc -fno-builtin-free 

and link it to  -lprofiler -ltcmalloc

Then, when setting CPUPROFILE I don't get stack traces, and  HEAPPROFILE turns 
on the heap tracking but then I get prof.0001.heap almost empty with no nodes.

Does it means that I cannot use perftools in Ubuntu 11.10 or is it just that 
I'm doing something wrong? 

Original comment by carles.f...@gmail.com on 20 Dec 2011 at 2:16

GoogleCodeExporter commented 9 years ago
No, it should work fine.  Does 'make check' pass in this case?  Is it possible 
your program just isn't using enough CPU or memory to show up in profilers?

Original comment by csilv...@gmail.com on 20 Dec 2011 at 4:14

GoogleCodeExporter commented 9 years ago
Hi, 

unfortunately, I'm unable to make perftools 1.8.3 work in Ubuntu 11.10. The 
'make check' does not pass regardless including --enable-frame-pointers or not 
when configuring, and I don't get results when activating CPUPROFILE or 
HEAPPROFILE.

I have replicated this in Ubuntu 10.04 and it works; I can get stack traces and 
nice diagrams with pprof. 

Original comment by carles.f...@gmail.com on 20 Dec 2011 at 11:08

GoogleCodeExporter commented 9 years ago
Hmm, weird.  Unfortunately, I don't have access to an ubuntu 11 machine, but 
will try to track one day.  If you're able to debug this in any way, it would 
be very helpful!  Probably stacktrace_unittest would be the easiest case to 
look at.

Original comment by csilv...@gmail.com on 20 Dec 2011 at 11:21

GoogleCodeExporter commented 9 years ago
OK, I got an ubuntu 11 instance on vmware.  I ran the perftools 'make check' 
and it failed in much the way you saw (though not totally -- the stacktrace 
unittest worked, for instance).  Then I ran 'make distclean' and did it again, 
and the run completed successfully.

Can you try that -- running 'make check' again, or maybe doing 'make distclean' 
and then rerunning from the configure step?  I don't know why that would help, 
but it seems to have, for me.

Another thing you can try is ./configure ... CXXFLAGS=-g.  See how things work 
for you with optimization turned off.

Original comment by csilv...@gmail.com on 21 Dec 2011 at 4:16

GoogleCodeExporter commented 9 years ago
I installed a fresh ubuntu 11.10 and run
./configure --enable-frame-pointers
make
make check

... 9 of 43 tests failed

make distclean
./configure --enable-frame-pointers
make
make check

... 9 of 43 tests failed

./configure --enable-frame-pointers CXXFLAGS=-g
make
make check

.. and the run gets frozen at Testing ./heap-checker_unittest with 
HEAPCHECK=normal 

I will continue looking at this. 

Original comment by carles.f...@gmail.com on 22 Dec 2011 at 12:43

GoogleCodeExporter commented 9 years ago
Yeah, you're definitely seeing different failures than I was.  I don't know 
what's different about our configurations -- except mine is running under 
vmware -- but clearly something is.

Original comment by csilv...@gmail.com on 22 Dec 2011 at 1:43

GoogleCodeExporter commented 9 years ago
I installed Ubuntu 11.10 on Virtual Box, and updated everything. I tried with 
google-perftools1.9 and problems persist:

./configure --enable-frame-pointers
make
make check

... 10 of 43 tests failed

and then I did it again:

make distclean
./configure --enable-frame-pointers
make
make check

9 of 43 tests failed

Curious...

Original comment by carles.f...@gmail.com on 24 Dec 2011 at 12:01

GoogleCodeExporter commented 9 years ago
Well, given that you used a fresh install, I have to imagine that others are 
going to have the same problem.  I wonder what it is, and why I couldn't 
reproduce it.  I'm home for the holidays now, but will look into it when I'm 
back.  In the meantime, feel free to dig into it yourself!

Original comment by csilv...@gmail.com on 24 Dec 2011 at 12:07

GoogleCodeExporter commented 9 years ago
I am unable to reproduce this issue as well. Is this still an issue for you? I 
suspect that this is not a widespread problem otherwise we would have seen many 
more reports of this issue. Or perhaps most have moved on to newer versions. 
Can you give gperftools-2.0 a try on your setup?

Original comment by chapp...@gmail.com on 2 Mar 2012 at 7:15

GoogleCodeExporter commented 9 years ago
On my Ubuntu 11.10 (32bit, but it appears to be running on 64bit hardware - 
there's "lm" in flags in /proc/cpuinfo)

It also fails 9 testcases, though --enable-frame-pointers didn't seem to change 
anything (i.e. still 9 test cases failing).

Original comment by d.kulin...@gmail.com on 2 Mar 2012 at 7:29

GoogleCodeExporter commented 9 years ago
Hi,

thanks for the follow up. I've tried gperftools-2.0 in Ubuntu 11.10 and it 
built smoothly :-)

Best regards,
Carles

Original comment by carles.f...@gmail.com on 4 Mar 2012 at 12:54

GoogleCodeExporter commented 9 years ago
Hmmmm ... I just built gperftools on a freshly installed Ubuntu 11.10 and I am 
seeing the same 'make check' results as d.kulinski. I am actually kind of 
surprised that we haven't seen more noise on this issue. I'll look deeper into 
the issue.

Original comment by chapp...@gmail.com on 22 Apr 2012 at 1:41

GoogleCodeExporter commented 9 years ago
So I also built 1.10, 1.9, and 1.8.3 agaisnt Ubuntu 11.10 and they all fail the 
same unit tests. I also built the same packages and ran unit tests on a RedHat 
machine (CentOS release 5.7) and they all passed. So this appears to be an 
issue with something internally that has changed with Ubuntu 11.x. When I run 
the heap profiler unit tests all of the profiles seem to be empty other than 
the maps related context. So I suspect that it has something to do with hooks 
not being overridden correctly. Unfortunately this also means that the heap 
profiler and checker are not functional at all currently for Ubuntu 11.x users.

Original comment by chapp...@gmail.com on 3 May 2012 at 2:43

GoogleCodeExporter commented 9 years ago
Well... to answer the question why there was not as much noise on this. The 
reason was that the binary packages could be installed on that version so as 
long people were able to use it it wasn't much of an issue that it didn't 
compile.

Original comment by derek4...@gmail.com on 3 May 2012 at 6:56

GoogleCodeExporter commented 9 years ago
I have found the underlying issue here. It looks like as of gcc 4.6 
-fomit-frame-pointer is automatically enabled when optimizations like -O2 are 
specified. To confirm you can run:

echo 'int main() {return 0;}' > test.c && gcc -v -Q -march=native -O2 test.c -o 
test && rm test.c test | grep omit

I manually added -fno-omit-frame-pointer to the Makefile and did a clean build 
and everything worked as expected. So it looks like the fix here is going to be 
explicitly making the configure option --enable-frame-pointers the default and 
have it apply to all relevant targets.

Original comment by chapp...@gmail.com on 4 May 2012 at 5:44

GoogleCodeExporter commented 9 years ago

Original comment by chapp...@gmail.com on 4 May 2012 at 5:27

GoogleCodeExporter commented 9 years ago

Original comment by chapp...@gmail.com on 4 May 2012 at 5:39

GoogleCodeExporter commented 9 years ago
this has now been committed to the main trunk and will be in the next release.

Original comment by chapp...@gmail.com on 16 May 2012 at 1:29

GoogleCodeExporter commented 9 years ago
Issue 407 has been merged into this issue.

Original comment by chapp...@gmail.com on 11 Mar 2013 at 2:04