Trouble running valgrind

916 views
Skip to first unread message

Greg Spencer

unread,
Sep 9, 2011, 5:10:45 PM9/9/11
to chromium-dev
I'm having trouble running valgrind  on my Goobuntu workstation using the instructions here: 

I built chrome using:
GYP_DEFINES='werror= target_arch=ia32 debug_extra_cflags="-g -fno-inline -fno-omit-frame-pointer -fno-builtin" release_extra_cflags="-g -fno-inline -fno-omit-frame-pointer -fno-builtin" release_valgrind_build=1 debug_optimize=1 release_optimize=1 mac_debug_optimization=1 mac_release_optimization=1' gclient runhooks --force
make -j16 chrome unit_tests

But when I try and run chrome under valgrind, I get the following:
(chromium_75634) -- src > sh ./tools/valgrind/valgrind.sh out/Debug/chrome
Using valgrind binaries from /usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64
+ PATH=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/bin:.:/home/gspencer/depot_tools:/usr/bin:/usr/bin/X11:/usr/sbin:/sbin:/usr/local/bin:/usr/local/symlinks:/usr/local/scripts:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/bin:/home/gspencer/.cheats/cmd
+ export VALGRIND_LIB=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ VALGRIND_LIB=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ export VALGRIND_LIB_INNER=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ VALGRIND_LIB_INNER=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ G_SLICE=always-malloc
+ NSS_DISABLE_UNLOAD=1
+ NSS_DISABLE_ARENA_FREE_LIST=1
+ G_DEBUG=fatal_warnings
+ GTEST_DEATH_TEST_USE_FORK=1
+ valgrind --trace-children=yes --suppressions=./tools/valgrind/memcheck/suppressions.txt '--db-command=/usr/bin/gdb32 -nw %f %p' --db-attach=yes --malloc-fill=41 --free-fill=41 --num-callers=30 out/Debug/chrome
valgrind: mmap(0x108000, 72445952) failed in UME with error 22 (Invalid argument).
valgrind: this can be caused by executables with very large text, data or bss segments.

I found the following valgrind bug that seems to be what I'm running into, and I'm wondering if anyone else has a workaround. (The Chromium bug referenced in that valgrind bug has been "fixed", but mainly because it was a bot problem, and not a valgrind problem.)


My default linker on my machine is Gold, but I believe that the valgrind.sh script runs prebuilt 32-bit valgrind binaries that are not linked with Gold, so that shouldn't be a problem.

Thanks!

David Reveman

unread,
Sep 9, 2011, 5:39:27 PM9/9/11
to gspe...@google.com, chromium-dev
I'm having the same problem. Haven't found a solution to it.

--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Emmanuel Saint-loubert

unread,
Sep 9, 2011, 5:42:46 PM9/9/11
to rev...@chromium.org, gspe...@google.com, chromium-dev

+1 :-(

Matt Mueller

unread,
Sep 9, 2011, 5:45:15 PM9/9/11
to rev...@chromium.org, gspe...@google.com, chromium-dev
Tried a release build?

"NOTE: Valgrind for some tests is currently broken on debug builds. If
you get an mmap() error, try using a Chromium release build. [8 Sept
2011]"

Stéphane Marchesin

unread,
Sep 9, 2011, 6:01:30 PM9/9/11
to ma...@google.com, rev...@chromium.org, gspe...@google.com, chromium-dev
Why not valgrind the 64 bit build instead? It wouldn't suffer from the
same address space limitations. I see that it's got noisy output, but
better than no output I guess.

Stéphane

oshima

unread,
Sep 9, 2011, 6:10:20 PM9/9/11
to rev...@chromium.org, gspe...@google.com, chromium-dev
I think you're hitting http://crbug.com/94874

On Fri, Sep 9, 2011 at 2:39 PM, David Reveman <rev...@chromium.org> wrote:
I'm having the same problem. Haven't found a solution to it.


On Fri, Sep 9, 2011 at 5:10 PM, Greg Spencer <gspe...@chromium.org> wrote:
I'm having trouble running valgrind  on my Goobuntu workstation using the instructions here: 

I built chrome using:
GYP_DEFINES='werror= target_arch=ia32 debug_extra_cflags="-g -fno-inline -fno-omit-frame-pointer -fno-builtin" release_extra_cflags="-g -fno-inline -fno-omit-frame-pointer -fno-builtin" release_valgrind_build=1 debug_optimize=1 release_optimize=1 mac_debug_optimization=1 mac_release_optimization=1' gclient runhooks --force
make -j16 chrome unit_tests
 
But when I try and run chrome under valgrind, I get the following:
(chromium_75634) -- src > sh ./tools/valgrind/valgrind.sh out/Debug/chrome
Using valgrind binaries from /usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64
+ PATH=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/bin:.:/home/gspencer/depot_tools:/usr/bin:/usr/bin/X11:/usr/sbin:/sbin:/usr/local/bin:/usr/local/symlinks:/usr/local/scripts:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/bin:/home/gspencer/.cheats/cmd
+ export VALGRIND_LIB=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ VALGRIND_LIB=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ export VALGRIND_LIB_INNER=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ VALGRIND_LIB_INNER=/usr/local/space/depot/chrome/src/third_party/valgrind/linux_x64/lib/valgrind
+ G_SLICE=always-malloc
+ NSS_DISABLE_UNLOAD=1
+ NSS_DISABLE_ARENA_FREE_LIST=1
+ G_DEBUG=fatal_warnings
+ GTEST_DEATH_TEST_USE_FORK=1
+ valgrind --trace-children=yes --suppressions=./tools/valgrind/memcheck/suppressions.txt '--db-command=/usr/bin/gdb32 -nw %f %p' --db-attach=yes --malloc-fill=41 --free-fill=41 --num-callers=30 out/Debug/chrome
valgrind: mmap(0x108000, 72445952) failed in UME with error 22 (Invalid argument).
valgrind: this can be caused by executables with very large text, data or bss segments.


Are you using valgrind.sh? Looks like your'e working on issue in unit_tests, so you should be able to just use "tools/valgrind/chrome_tests.sh -t unit_tests", which shouldn't have this issue.
If you just want to test, there are valgrind bots (linux_valgrind, linux_chromeos_valgrind, mac_valgrind) that you can use. Note that this doesn't run ui_tests as it takes looooong time and useless
if you're working on issue in ui_tests, unfortunately.

- oshima

Greg Spencer

unread,
Sep 9, 2011, 7:05:25 PM9/9/11
to oshima, rev...@chromium.org, chromium-dev
Looks like I can run it under a release build.  And, yes, I can work on my problem with unit_tests, but I still think it's a good idea to be able to run Chrome in valgrind for other issues.

Thanks for the help.

-Greg.

Timur Iskhodzhanov

unread,
Sep 13, 2011, 6:37:37 AM9/13/11
to mar...@google.com, ma...@google.com, rev...@chromium.org, gspe...@google.com, chromium-dev
http://crbug.com/64930

It's not working well enough on 64-bit builds unfortunately :(

Reply all
Reply to author
Forward
0 new messages