Package: glib2.0 / 2.64.4-1


Package Version Patches format
glib2.0 2.64.4-1 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
glib compile resources Fix exporting on Visual Studio.patch | (download)

gio/glib-compile-resources.c | 20 15 + 5 - 0 !
1 file changed, 15 insertions(+), 5 deletions(-)

 glib-compile-resources: fix exporting on visual studio

Have the generated .c code decorate the prototypes with "G_MODULE_EXPORT"
instead of "extern" when --internal is not being used, so that we also
export the symbols from the generated code on Visual Studio-style
compilers.  If --internal is used, we decorate the prototypes with
"G_GNUC_INTERNAL", as we did before.

Note that since the generated .c code does not attempt to include the
generated headers (if one is also generated), the gnerated headers are
still generated as they were before.

gdesktopappinfo Fix unnecessarily copied and leaked URI l.patch | (download)

gio/gdesktopappinfo.c | 3 1 + 2 - 0 !
1 file changed, 1 insertion(+), 2 deletions(-)

 gdesktopappinfo: fix unnecessarily copied and leaked uri list

When an app is spawned using g_desktop_app_info_launch_uris_with_spawn
it will expand the various token in the app's commandline with the
URIs of the files to open. The expand_macro() function that is used for
this advances the pointer to the URI list to show up to which entries
it used.

To not loose the pointer to the list head a duplicate of the URI list
was actually passed to expand_macro(). However, it's not necessary to
create a copy of the URI list for that as expand_macro() will only
change which element the pointer will point to.

This behaviour actually caused the duplicated list to be leaked as the
the list pointer is NULL once all URIs are used up by expand_macro()
and thus nothing was freed at the end of the function.

tests Use g_assert_ in cancellable test rather than g_ass.patch | (download)

gio/tests/cancellable.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 tests: use g_assert_*() in cancellable test rather than g_assert()

`g_assert()` is compiled out if `G_DISABLE_ASSERT` is defined, and
`g_assert_*()` gives more detailed failure messages.

Signed-off-by: Philip Withnall <>
gcancellable Fix minor race between GCancellable and GCan.patch | (download)

gio/gcancellable.c | 43 43 + 0 - 0 !
gio/tests/cancellable.c | 77 77 + 0 - 0 !
2 files changed, 120 insertions(+)

 gcancellable: fix minor race between gcancellable and
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

There’s a minor race condition between cancellation of a `GCancellable`,
and disposal/finalisation of a `GCancellableSource` in another thread.

Thread A                               Thread B
 →cancellable_source_cancelled(C, S)
 →→# S is invalid at this point; crash

Thankfully, the `GCancellable` sets `cancelled_running` while it’s
emitting the `cancelled` signal, so if `cancellable_source_dispose()` is
called while that’s high, we know that the thread which is doing the
cancellation has already started (or is committed to starting) calling

Fix the race by resurrecting the `GCancellableSource` in
`cancellable_source_dispose()`, and signalling this using
`GCancellableSource.resurrected_during_cancellation`. Check for that
flag in `cancellable_source_cancelled()` and ignore cancellation if it’s

The modifications to `resurrected_during_cancellation` and the
cancellable source’s refcount have to be done with `cancellable_mutex`
held so that they are seen atomically by each thread. This should not
affect performance too much, as it only happens during cancellation or
disposal of a `GCancellableSource`.

Signed-off-by: Philip Withnall <>
01_gettext desktopfiles.patch | (download)

glib/gkeyfile.c | 83 83 + 0 - 0 !
1 file changed, 83 insertions(+)

 call gettext if .desktop file does not have inline translations

Patch from OpenSUSE via Ubuntu, original author unknown. Martin Pitt and
Vincent Untz appear to be the main authors.

Reworked slightly by Philip Withnall to avoid exposing new public API
for the non-standard keys.

0001 timer test use volatile for locals.patch | (download)

glib/tests/timer.c | 4 2 + 2 - 0 !
1 file changed, 2 insertions(+), 2 deletions(-)

 timer test: use 'volatile' for locals

GCC seems to be failing to follow the letter of the C spec by allowing extra
precision in floating point values to persist across assignments which are
optimised away.

Force its hand by using 'volatile' on the locals in question.

gwakeuptest Be less parallel unless invoked with m slow.patch | (download)

glib/tests/gwakeuptest.c | 17 13 + 4 - 0 !
1 file changed, 13 insertions(+), 4 deletions(-)

 gwakeuptest: be less parallel unless invoked with -m slow

This is a workaround for test failures on the reproducible-builds
infrastructure, where a multi-threaded stress-test sometimes takes longer
to finish on x86_64 than it would have done on slow architectures like
arm and mips on the official Debian autobuilders. It is not clear why.

This change will make this test more likely to pass, but less likely to
detect bugs.

Signed-off-by: Simon McVittie <>
debian/02_gettext desktopfiles ubuntu.patch | (download)

glib/gkeyfile.c | 20 20 + 0 - 0 !
1 file changed, 20 insertions(+)

 provide backwards compatibility for 01_gettext-desktopfiles.patch
 for X-{Debian,Ubuntu}-Gettext-Domain

Ubuntu-specific. 01_gettext-desktopfiles.patch was changed to use
X-GNOME-, so this is necessary until all our .desktop files are converted.

debian/03_disble_glib_compile_schemas_warning.patch | (download)

gio/glib-compile-schemas.c | 4 4 + 0 - 0 !
1 file changed, 4 insertions(+)

 disable confusing (to users) warning about deprecated schema paths

Disable a warning when compiling schemas which are installed
into 'deprecated' locations. Users see this very often due to
glib-compile-schemas being called from libglib2.0-0's trigger and it is
not very useful for them.

debian/06_thread_test_ignore_prctl_fail.patch | (download)

glib/tests/thread.c | 9 8 + 1 - 0 !
1 file changed, 8 insertions(+), 1 deletion(-)

 do not fail the /thread/thread4 test if prlimit() fails

This happens on the Debian buildds.

[smcv: Use g_test_skip()]

debian/61_glib compile binaries path.patch | (download)

gio/ | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 adjust path to glib-compile-schemas in the pkg-config file

This is because gio-querymodules and glib-compile-schemas have been put in
a private, versioned directory in libglib2.0-0 to avoid a dependency loop.

debian/closures test Skip on arm unless flaky tests are allowed.patch | (download)

gobject/tests/closure-refcount.c | 8 8 + 0 - 0 !
1 file changed, 8 insertions(+)

 closures test: skip on arm* unless flaky tests are allowed

Choosing the right number of iterations to avoid either taking literally
hours on some hardware, or getting spurious failures when one thread
starves another, seems to be too hard to get right in practice.
Make this test opt-in so that its failures aren't release-critical.
We can run it as a separate autopkgtest that is marked flaky.

Signed-off-by: Simon McVittie <>
debian/Disable some tests on slow architectures which keep faili.patch | (download)

glib/tests/mainloop.c | 16 16 + 0 - 0 !
glib/tests/timeout.c | 9 9 + 0 - 0 !
2 files changed, 25 insertions(+)

 disable some tests on slow architectures which keep failing the

[smcv: Modified to use g_test_skip() instead of omitting those test cases
completely, and allow them to be re-enabled with a Debian-specific
environment variable]

Co-authored-by: Simon McVittie <>
debian/Skip test which performs some unreliable floating point c.patch | (download)

glib/tests/timer.c | 6 6 + 0 - 0 !
1 file changed, 6 insertions(+)

 skip test which performs some unreliable floating point comparisons

[smcv: Modified to use g_test_skip() instead of omitting those test cases
completely, and allow them to be re-enabled with a Debian-specific
environment variable]

Co-authored-by: Simon McVittie <>
debian/Skip unreliable gdbus threading tests by default.patch | (download)

gio/tests/gdbus-threading.c | 6 6 + 0 - 0 !
1 file changed, 6 insertions(+)

 skip unreliable gdbus-threading tests by default

test_threaded_singleton() test to reproduce a race condition between
last-unref of the global singleton GDBusConnection and g_bus_get_sync().

test_method_calls_in_thread() checks that multiple threads can all make
method calls to the same proxy.

However, test setup intermittently times out with:

    # GLib-GIO-DEBUG: run 0: refcount is 2, sleeping
    Bail out! GLib-GIO-FATAL-ERROR: connection had too many refs

The current theory upstream is that this might be a reference leak in

Furthermore, test teardown is now often failing when destroying the test

Demote these tests to be run as part of the "flaky" autopkgtests, but
not at build time or in the part of the autopkgtest run that gates
progress into testing.

debian/gmenumodel test Mark as flaky.patch | (download)

gio/tests/gmenumodel.c | 6 6 + 0 - 0 !
1 file changed, 6 insertions(+)

 gmenumodel test: mark as flaky

This test has not had a great history of reliability.

Signed-off-by: Simon McVittie <>
debian/gvariant test Don t run at build time on mips.patch | (download)

glib/tests/gvariant.c | 8 8 + 0 - 0 !
1 file changed, 8 insertions(+)

 gvariant test: don't run at build-time on mips

DEB_ALLOW_FLAKY_TESTS is not quite right here, because we don't know
that the test would fail if left for long enough - the problem is that
it doesn't get there, because generating random floating-point numbers
is very slow on some of our mips hardware. However, it has the right
practical effect.

Signed-off-by: Simon McVittie <>
debian/taptestrunner Stop looking like an executable script.patch | (download)

gobject/tests/ | 1 0 + 1 - 0 !
1 file changed, 1 deletion(-)

 taptestrunner: stop looking like an executable script

This file is installed as non-executable but starts with the #! that
indicates an executable script, causing warnings from Debian's Lintian
tool. In fact it is imported as a Python module rather than being run
as an executable, so there is no need for the #! line.

Signed-off-by: Simon McVittie <>
debian/testfilemonitor Skip if we are avoiding flaky tests.patch | (download)

gio/tests/testfilemonitor.c | 34 33 + 1 - 0 !
1 file changed, 33 insertions(+), 1 deletion(-)

 testfilemonitor: skip if we are avoiding flaky tests


Signed-off-by: Simon McVittie <>