summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-06-08 14:57:46 +0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-06-09 19:56:35 +0300
commit8bbb7216367890b9a8d0e5bc7899d180e3af1e87 (patch)
treed887e2658b0769918cb641c734189a6402102170
parentfd8753748267de7c7a729c53e714ba6f55fa06b4 (diff)
downloadqtlocation-mapboxgl-8bbb7216367890b9a8d0e5bc7899d180e3af1e87.tar.gz
[Qt][build] Updated valgrind supression and make it a target for Qt
-rw-r--r--Makefile10
-rwxr-xr-xconfigure1
-rw-r--r--platform/qt/scripts/configure.sh2
-rwxr-xr-xscripts/valgrind.sh16
-rw-r--r--scripts/valgrind.sup159
5 files changed, 151 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index ad1ebba793..3f8332938e 100644
--- a/Makefile
+++ b/Makefile
@@ -239,6 +239,13 @@ run-qt-app: qt-app
run-qt-qml-app: qt-qml-app
cd $(QT_OUTPUT_PATH)/$(BUILDTYPE) && ./qquickmapboxgl
+test-valgrind-qt: $(QT_MAKEFILE) node_modules
+ $(QT_ENV) $(MAKE) -j$(JOBS) -C $(QT_OUTPUT_PATH) test
+ ./scripts/valgrind.sh $(QT_OUTPUT_PATH)/$(BUILDTYPE)/test --gtest_catch_exceptions=0 --gtest_filter=-*.Load
+
+run-valgrind-qt-app: qt-app
+ ./scripts/valgrind.sh $(QT_OUTPUT_PATH)/$(BUILDTYPE)/qmapboxgl --test -platform offscreen
+
#### Linux targets #####################################################
LINUX_OUTPUT_PATH = build/linux-$(shell uname -m)
@@ -270,9 +277,6 @@ test: $(LINUX_MAKEFILE)
run-glfw-app: glfw-app
cd $(LINUX_OUTPUT_PATH)/$(BUILDTYPE) && ./mapbox-glfw
-run-valgrind-glfw-app: glfw-app
- cd $(LINUX_OUTPUT_PATH)/$(BUILDTYPE) && valgrind --leak-check=full --suppressions=../../../scripts/valgrind.sup ./mapbox-glfw
-
ifneq (,$(shell which gdb))
GDB = gdb -batch -return-child-result -ex 'set print thread-events off' -ex 'run' -ex 'thread apply all bt' --args
endif
diff --git a/configure b/configure
index 69acbde010..67148de714 100755
--- a/configure
+++ b/configure
@@ -123,6 +123,7 @@ print_flags webp static_libs cflags ldflags
print_flags jni.hpp cflags
print_flags earcut cflags
print_flags benchmark static_libs cflags ldflags
+print_flags valgrind
CONFIG+=" }
}
diff --git a/platform/qt/scripts/configure.sh b/platform/qt/scripts/configure.sh
index 4b855f7c58..5f31c853d2 100644
--- a/platform/qt/scripts/configure.sh
+++ b/platform/qt/scripts/configure.sh
@@ -28,6 +28,8 @@ if [ "$MASON_PLATFORM" == "osx" ]; then
CONFIG+=" 'opengl_ldflags%': ['-framework OpenGL', '-framework CoreFoundation'],"$LN
}
else
+ VALGRIND_VERSION=latest
+
function print_opengl_flags {
CONFIG+=" 'opengl_cflags%': $(quote_flags $(pkg-config gl x11 --cflags)),"$LN
CONFIG+=" 'opengl_ldflags%': $(quote_flags $(pkg-config gl x11 --libs)),"$LN
diff --git a/scripts/valgrind.sh b/scripts/valgrind.sh
new file mode 100755
index 0000000000..009e18c432
--- /dev/null
+++ b/scripts/valgrind.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+set -e
+set -o pipefail
+
+PARAMS="\
+ --leak-check=full \
+ --show-leak-kinds=definite \
+ --errors-for-leak-kinds=definite \
+ --error-exitcode=1 \
+ --gen-suppressions=all \
+ --suppressions=scripts/valgrind.sup"
+
+export VALGRIND_LIB=$(.mason/mason prefix valgrind latest)/lib/valgrind
+
+$(.mason/mason prefix valgrind latest)/bin/valgrind $PARAMS $@
diff --git a/scripts/valgrind.sup b/scripts/valgrind.sup
index fcde049d9c..f21f54be54 100644
--- a/scripts/valgrind.sup
+++ b/scripts/valgrind.sup
@@ -1,91 +1,182 @@
{
- Valgrind gets confused with buffers managed by the graphics driver
+ Graphics driver buffers
Memcheck:Leak
...
- obj:/usr/*/dri/r600_dri.so
+ obj:*/r600_dri.*
+ obj:*/r600_dri.*
+ obj:*/r600_dri.*
...
}
{
- GLFW _glfwCreateCursor()
+ Graphics driver buffers
Memcheck:Leak
- match-leak-kinds: reachable
...
- obj:/usr/*/libX11.so.6.3.0
+ obj:*/i965_dri.*
+ obj:*/i965_dri.*
+ obj:*/i965_dri.*
...
- fun:_glfwCreateCursor
+}
+{
+ Graphics driver buffers
+ Memcheck:Leak
+ ...
+ obj:*/nouveau_dri.*
+ obj:*/nouveau_dri.*
+ obj:*/nouveau_dri.*
...
}
{
- GLFW _glfwPlatform*()
+ Ubuntu 16.04 - GLFW
Memcheck:Leak
- match-leak-kinds: reachable
...
- fun:_glfwPlatform*
+ fun:glfwInit
...
}
{
- Buffer managed by OpenGL?
+ Ubuntu 16.04 - GLFW
Memcheck:Cond
...
- fun:_ZN4mbgl*Uniform*
+ fun:glfwInit
...
- fun:_ZN8GLFWView10invalidateEv
+}
+{
+ Ubuntu 16.04 - Qt + glib
+ Memcheck:Cond
+ fun:g_utf8_offset_to_pointer
...
}
{
- Buffer managed by OpenGL?
+ Ubuntu 16.04 - Qt + glib
Memcheck:Cond
- fun:_ZNSt7__equalILb0EE5equalIPKfS3_EEbT_S4_T0_
...
- fun:_ZN4mbgl7Painter11renderLayerERKNS_10StyleLayerEPKNS_4Tile2IDEPKSt5arrayIfLm16EE
+ fun:g_signal_emit_valist
+ ...
+ fun:*QApplicationPrivate*
+ ...
+}
+{
+ Ubuntu 16.04 - Qt + X11
+ Memcheck:Param
+ writev(vector[...])
+ ...
+ obj:*/libxcb.*
+ fun:xcb_flush
+ ...
}
{
- Valgrind doesn't like our make_unique (C++14 polyfill)
+ Ubuntu 16.04 - Qt + X11
Memcheck:Leak
- match-leak-kinds: reachable
- fun:malloc
...
- fun:_ZN4mbgl4util11make_unique*
+ fun:_XmbTextListToTextProperty
+ ...
+ fun:*QWidget*setVisible*
...
}
{
- dlopen doing its magic
+ Ubuntu 16.04 - Qt + Fontconfig
Memcheck:Leak
- match-leak-kinds: reachable
...
- fun:_dl_open
+ obj:*/libfontconfig.*
+ obj:*/libfontconfig.*
+ ...
+ fun:FcFontRenderPrepare
...
}
{
- X11 false positive
+ Ubuntu 16.04 - Qt + Fontconfig
Memcheck:Leak
- match-leak-kinds: reachable
...
- obj:/usr/*/libX11.so.6.3.0
+ obj:*/libfontconfig.*
+ obj:*/libfontconfig.*
...
- fun:_XrmInitParseInfo
+ fun:FcPatternAddInteger
...
}
{
- OpenSSL false positive
+ Ubuntu 16.04 - Qt + Fontconfig
Memcheck:Leak
...
- fun:CRYPTO_malloc
+ obj:*/libfontconfig.*
+ obj:*/libfontconfig.*
+ ...
+ fun:FcConfigParseAndLoad
...
}
{
- OpenSSL false positive
+ Ubuntu 16.04 - Qt + Dbus
Memcheck:Leak
...
- fun:CRYPTO_realloc
+ fun:dbus_connection_send_with_reply
...
+ fun:*QWidget*
}
{
- Libcurl false positive
+ Ubuntu 16.04 - Qt + Dbus
+ Memcheck:Leak
+ ...
+ fun:px_proxy_factory_get_proxies
+ obj:*/libQt5Network.*
+}
+{
+ Ubuntu 16.04 - Qt
Memcheck:Leak
- fun:malloc
...
- obj:/usr/*/libcurl.so.4.3.0
- fun:curl_multi_socket_action
+ fun:*QGuiApplicationPrivate*createEventDispatcher*
+ fun:*QCoreApplication*init*
+ ...
+}
+{
+ Ubuntu 16.04 - Qt
+ Memcheck:Leak
+ ...
+ fun:*QWidget*setWindowTitle*
+ ...
+}
+{
+ Ubuntu 16.04 - Qt
+ Memcheck:Leak
+ ...
+ fun:*QNetworkConfigurationManagerPrivate*updateConfigurations*
+ ...
+}
+{
+ Ubuntu 16.04 - Mysterious leak when running utests
+ Memcheck:Leak
+ fun:calloc
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+}
+{
+ Ubuntu 16.04 - Mysterious leak when running utests
+ Memcheck:Leak
+ fun:malloc
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+ obj:*
+}
+{
+ Ubuntu 14.04 - Travis CI bot using swrast
+ Memcheck:Cond
+ fun:do_stencil_test
+ fun:_swrast_stencil_and_ztest_span
+ fun:_swrast_write_rgba_span
+ fun:draw_wide_line
...
}