core: Add valgrind framework, plug various memory leaks
This commit is contained in:
1 parent
7ce587da30
commit
8d926c3e36
13 files changed
+252
-47
No files matched your search
+9
-5
@@ -32,6 +32,10 @@ if test -n "${OT_TESTS_DEBUG}"; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
if test -n "$OT_TESTS_VALGRIND"; then
|
||||
CMD_PREFIX="env G_SLICE=always-malloc valgrind -q --leak-check=full --num-callers=30 --suppressions=${SRCDIR}/ostree-valgrind.supp"
|
||||
fi
|
||||
|
||||
die () {
|
||||
if test -z "$OT_TESTS_SAVE_TEMPS"; then
|
||||
test -f "$test_tmpdir/.test$$" && rm -rf "$test_tmpdir"
|
||||
@@ -70,7 +74,7 @@ setup_test_repository () {
|
||||
mkdir repo
|
||||
cd repo
|
||||
ot_repo="--repo=`pwd`"
|
||||
export OSTREE="ostree ${ot_repo}"
|
||||
export OSTREE="${CMD_PREFIX} ostree ${ot_repo}"
|
||||
if test "$mode" = "archive"; then
|
||||
$OSTREE init --archive
|
||||
else
|
||||
@@ -110,20 +114,20 @@ setup_fake_remote_repo1() {
|
||||
mkdir ostree-srv
|
||||
cd ostree-srv
|
||||
mkdir gnomerepo
|
||||
ostree --repo=gnomerepo init --archive
|
||||
${CMD_PREFIX} ostree --repo=gnomerepo init --archive
|
||||
mkdir gnomerepo-files
|
||||
cd gnomerepo-files
|
||||
echo first > firstfile
|
||||
mkdir baz
|
||||
echo moo > baz/cow
|
||||
echo alien > baz/saucer
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "A remote commit" -m "Some Commit body"
|
||||
${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "A remote commit" -m "Some Commit body"
|
||||
mkdir baz/deeper
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "Add deeper"
|
||||
${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "Add deeper"
|
||||
echo hi > baz/deeper/ohyeah
|
||||
mkdir baz/another/
|
||||
echo x > baz/another/y
|
||||
ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "The rest"
|
||||
${CMD_PREFIX} ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "The rest"
|
||||
cd ..
|
||||
rm -rf gnomerepo-files
|
||||
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
{
|
||||
g_type_init_with_debug_flags calloc
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
...
|
||||
fun:g_type_init_with_debug_flags
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_add_interface_static malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_type_add_interface_static
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_add_interface_dynamic malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_type_add_interface_dynamic
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_class_ref malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_type_class_ref
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_register_dynamic malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_type_register_dynamic
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_init_with_debug_flags malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_type_init_with_debug_flags
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_init_with_debug_flags realloc
|
||||
Memcheck:Leak
|
||||
fun:realloc
|
||||
...
|
||||
fun:g_type_init_with_debug_flags
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_test_add_vtable malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_test_add_vtable
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_test_init
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_test_init
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_register_static malloc
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_type_register_static
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_register_static realloc
|
||||
Memcheck:Leak
|
||||
fun:realloc
|
||||
...
|
||||
fun:g_type_register_static
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_register_fundamental never freed
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:g_type_register_fundamental
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_type_class_ref never finalized
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
fun:g_malloc0
|
||||
fun:g_type_class_ref
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
DBusGValue qdata
|
||||
Memcheck:Leak
|
||||
fun:realloc
|
||||
fun:g_realloc
|
||||
fun:g_type_set_qdata
|
||||
fun:_dbus_g_value_types_init
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
gettext conditional jump
|
||||
Memcheck:Cond
|
||||
fun:__GI___strcasecmp_l
|
||||
fun:__gconv_open
|
||||
fun:_nl_find_msg
|
||||
fun:__dcigettext
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
gettext uninitialized value
|
||||
Memcheck:Value8
|
||||
fun:__GI___strcasecmp_l
|
||||
fun:__gconv_open
|
||||
fun:_nl_find_msg
|
||||
fun:__dcigettext
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
font config invalid reads
|
||||
Memcheck:Addr4
|
||||
...
|
||||
fun:FcConfigParseAndLoad
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
dynamic loader conditional jump
|
||||
Memcheck:Cond
|
||||
fun:index
|
||||
fun:expand_dynamic_string_token
|
||||
fun:_dl_map_object
|
||||
fun:map_doit
|
||||
fun:_dl_catch_error
|
||||
fun:do_preload
|
||||
fun:dl_main
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
g_vfs_get_local
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:g_vfs_get_local
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
_g_io_modules_ensure_loaded
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:_g_io_modules_ensure_loaded
|
||||
...
|
||||
}
|
||||
|
||||
{
|
||||
_g_io_module_get_default
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:_g_io_module_get_default
|
||||
...
|
||||
}
|
||||
@@ -131,12 +131,12 @@ echo "ok metadata content"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo2
|
||||
ostree --repo=repo2 init
|
||||
ostree --repo=repo2 pull-local repo
|
||||
${CMD_PREFIX} ostree --repo=repo2 init
|
||||
${CMD_PREFIX} ostree --repo=repo2 pull-local repo
|
||||
echo "ok pull-local"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
ostree --repo=repo2 checkout test2 test2-checkout-from-local-clone
|
||||
${CMD_PREFIX} ostree --repo=repo2 checkout test2 test2-checkout-from-local-clone
|
||||
cd test2-checkout-from-local-clone
|
||||
assert_file_has_content yet/another/tree/green 'leaf'
|
||||
echo "ok local clone checkout"
|
||||
@@ -223,9 +223,9 @@ echo "ok checkout link cache"
|
||||
cd ${test_tmpdir}
|
||||
rm -rf shadow-repo
|
||||
mkdir shadow-repo
|
||||
ostree --repo=shadow-repo init
|
||||
ostree --repo=shadow-repo config set core.parent $(pwd)/repo
|
||||
${CMD_PREFIX} ostree --repo=shadow-repo init
|
||||
${CMD_PREFIX} ostree --repo=shadow-repo config set core.parent $(pwd)/repo
|
||||
rm -rf test2-checkout
|
||||
parent_rev_test2=$(ostree --repo=repo rev-parse test2)
|
||||
ostree --repo=shadow-repo checkout "${parent_rev_test2}" test2-checkout
|
||||
${CMD_PREFIX} ostree --repo=shadow-repo checkout "${parent_rev_test2}" test2-checkout
|
||||
echo "ok checkout from shadow repo"
|
||||
@@ -38,12 +38,12 @@ echo "ok content"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo2
|
||||
ostree --repo=repo2 init
|
||||
ostree --repo=repo2 pull-local repo
|
||||
${CMD_PREFIX} ostree --repo=repo2 init
|
||||
${CMD_PREFIX} ostree --repo=repo2 pull-local repo
|
||||
echo "ok local clone"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
ostree --repo=repo2 checkout test2 test2-checkout-from-local-clone
|
||||
${CMD_PREFIX} ostree --repo=repo2 checkout test2 test2-checkout-from-local-clone
|
||||
cd test2-checkout-from-local-clone
|
||||
assert_file_has_content baz/cow moo
|
||||
echo "ok local clone checkout"
|
||||
|
||||
+8
-8
@@ -26,10 +26,10 @@ echo '1..4'
|
||||
setup_fake_remote_repo1
|
||||
cd ${test_tmpdir}
|
||||
mkdir repo
|
||||
ostree --repo=repo init
|
||||
ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
|
||||
ostree-pull --repo=repo origin main
|
||||
ostree --repo=repo fsck
|
||||
${CMD_PREFIX} ostree --repo=repo init
|
||||
${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
|
||||
${CMD_PREFIX} ostree-pull --repo=repo origin main
|
||||
${CMD_PREFIX} ostree --repo=repo fsck
|
||||
echo "ok pull"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
@@ -43,10 +43,10 @@ cd ${test_tmpdir}
|
||||
ostree --repo=$(pwd)/ostree-srv/gnomerepo pack
|
||||
rm -rf repo
|
||||
mkdir repo
|
||||
ostree --repo=repo init
|
||||
ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
|
||||
ostree-pull --repo=repo origin main
|
||||
ostree --repo=repo fsck
|
||||
${CMD_PREFIX} ostree --repo=repo init
|
||||
${CMD_PREFIX} ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
|
||||
${CMD_PREFIX} ostree-pull --repo=repo origin main
|
||||
${CMD_PREFIX} ostree --repo=repo fsck
|
||||
echo "ok pull packed"
|
||||
|
||||
cd ${test_tmpdir}
|
||||
|
||||
Reference in new issue
Block a user