Commit Graph

21436 Commits

Author SHA1 Message Date
Philip Withnall
ccbb2d8e8a gdbusnameowning: Subscribe to NameLost before calling RequestName
There was a slight race in name ownership: a gap between calling
`RequestName` (or receiving its reply) and subscribing to `NameLost`. In
that gap, another process could request and receive the name, and this
one wouldn’t know about it.

Fix that by subscribing to `NameAcquired` and `NameLost` before calling
`RequestName`, and then unsubscribing again if the subscriptions turn
out not to be necessary (if the process can’t own the requested name).

Spotted and diagnosed by Miika Karanki.

One of the tests needs an additional iteration of the main loop in order
to free all the signal closures before it can complete its checks.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1517
2020-02-16 10:00:31 +00:00
Philip Withnall
4d5900541b Merge branch 'patch-1' into 'master'
Fix oss-fuzz coverage link

See merge request GNOME/glib!1366
2020-02-16 09:05:05 +00:00
Asier Sarasua Garmendia
5ca0862e63 Update Basque translation 2020-02-15 12:18:47 +00:00
pdknsk
4ccaff05a9 Fix oss-fuzz coverage link 2020-02-15 08:23:25 +00:00
Fran Dieguez
8312a4c52f Update Galician translation 2020-02-14 20:40:23 +00:00
Philip Withnall
dff212effc Merge branch 'wip/tingping/socket-client-data-races-fix' into 'master'
gsocketclient: Refactor g_socket_client_connect_async()

Closes #1995, #1872, #1902, #1989, and #1871

See merge request GNOME/glib!1339
2020-02-14 19:10:59 +00:00
Philip Withnall
8f7faac10f Merge branch '1633-drop-gio-launch-desktop' into 'master'
gdesktopappinfo: Use `sh` rather than `gio-launch-desktop`

Closes #1633

See merge request GNOME/glib!1362
2020-02-14 19:00:29 +00:00
Patrick Griffis
2722620e32 Refactor g_socket_client_connect_async()
This is a fairly large refactoring. The highlights are:

- Removing in-progress connections/addresses from GSocketClientAsyncConnectData:

  This caused issues where multiple ConnectionAttempt's would step over eachother
  and modify shared state causing bugs like accidentally bypassing a set proxy.

  Fixes #1871
  Fixes #1989
  Fixes #1902

- Cancelling address enumeration on error/completion

- Queuing successful TCP connections and doing application layer work serially:

  This is more in the spirit of Happy Eyeballs but it also greatly simplifies
  the flow of connection handling so fewer tasks are happening in parallel
  when they don't need to be.

  The behavior also should more closely match that of g_socket_client_connect().

- Better track the state of address enumeration:

  Previously we were over eager to treat enumeration finishing as an error.

  Fixes #1872
  See also #1982

- Add more detailed documentation and logging.

Closes #1995
2020-02-14 18:15:20 +00:00
Philip Withnall
2b533ca99a gdesktopappinfo: Use sh rather than gio-launch-desktop
There were some problems about where to install `gio-launch-desktop` to
support multiarch systems without circular dependencies. Simon McVittie
suggested that, actually, given the current set of platforms supported
by `GDesktopAppInfo` (they’re all POSIX), we could just use `sh`.

That simplifies things nicely. `gio-launch-desktop` can always be
resurrected (and the multiarch debate continued and resolved) if needed
in future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1633
2020-02-14 18:09:18 +00:00
Philip Withnall
4a153abebe Merge branch 'wip/smcv/but-what-if-capabilities' into 'master'
Make tests pass if we are euid != 0 with capabilities

Closes #2029, #2028, and #2027

See merge request GNOME/glib!1363
2020-02-14 11:45:01 +00:00
Balázs Úr
d0c9855bd2 Update Hungarian translation 2020-02-13 18:44:21 +00:00
Simon McVittie
b9d04b37b0 tests: Cope with having CAP_DAC_OVERRIDE, even if not euid 0
Some CI platforms invoke these tests with euid != 0 but with
capabilities. Detect whether we have Linux CAP_DAC_OVERRIDE or other
OSs' equivalents, and skip tests that rely on DAC permissions being
denied if we do have that privilege.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: https://gitlab.gnome.org/GNOME/glib/issues/2027
Fixes: https://gitlab.gnome.org/GNOME/glib/issues/2028
2020-02-13 17:33:45 +00:00
Simon McVittie
6e28ce2860 tests: Don't assume that unprivileged uids are bound by RLIMIT_NPROC
Some CI platforms invoke tests as euid != 0, but with capabilities that
include CAP_SYS_RESOURCE and/or CAP_SYS_ADMIN. If we detect this,
we can't test what happens if our RLIMIT_NPROC is too low to create a
thread, because RLIMIT_NPROC is bypassed in these cases.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: https://gitlab.gnome.org/GNOME/glib/issues/2029
2020-02-13 17:33:45 +00:00
Emin Tufan Çetin
1c69f92535 Update Turkish translation 2020-02-12 17:38:01 +00:00
Philip Withnall
3847bc2e0e Merge branch 'fallback-setattr-failure' into 'master'
GThread - Check if sched_setattr is allowed by the system policies before depending on it

See merge request GNOME/glib!1356
2020-02-12 17:05:16 +00:00
Sebastian Dröge
9308ef9a4b GThread - Check if sched_setattr is allowed by the system policies before depending on it
On Fedora it's apparently not allowed so we'll have to fall back to the
thread-spawner thread in GThreadPool instead.
2020-02-12 17:56:11 +02:00
Philip Withnall
551576fb96 Merge branch 'main-context-freeing-of-sources' into 'master'
GMainContext - Fix memory leaks and memory corruption when freeing sources while freeing a context

See merge request GNOME/glib!1353
2020-02-12 15:26:06 +00:00
Sebastian Dröge
d6886d898f Merge branch 'docs-object-manager-example' into 'master'
docs: Don’t install object manager example separately

See merge request GNOME/glib!1359
2020-02-11 12:53:22 +00:00
Philip Withnall
760c8ccbe6 docs: Don’t install object manager example separately
The relevant parts of the generated example documentation are already
`xi:include`d into the `migrating-gdbus.xml` page, so are turned into
HTML there. Installing them separately means they also get installed
into `/usr/share/gtk-doc/html/gdbus-object-manager-example/`, which
seems redundant.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-11 11:47:03 +00:00
Sebastian Dröge
aaa7640f7c GMainContext - Add tests for !1353 and related situations 2020-02-11 10:53:56 +02:00
Sebastian Dröge
730a75fc8e GMainContext - Move mutex unlocking in destructor right before freeing the mutex
This does not have any behaviour changes but is cleaner. The mutex is
only unlocked now after all operations on the context are done and right
before freeing the mutex and the context itself.
2020-02-11 10:53:56 +02:00
Sebastian Dröge
aa20167d41 GMainContext - Fix memory leaks and memory corruption when freeing sources while freeing a context
Instead of destroying sources directly while freeing the context, and
potentially freeing them if this was the last reference to them, collect
new references of all sources in a separate list before and at the same
time invalidate their context so that they can't access it anymore. Only
once all sources have their context invalidated, destroy them while
still keeping a reference to them. Once all sources are destroyed we get
rid of the additional references and free them if nothing else keeps a
reference to them anymore.

This fixes a regression introduced by 26056558be in 2012.

The previous code that invalidated the context of each source and then
destroyed it before going to the next source without keeping an
additional reference caused memory leaks or memory corruption depending
on the order of the sources in the sources lists.

If a source was destroyed it might happen that this was the last
reference to this source, and it would then be freed. This would cause
the finalize function to be called, which might destroy and unref
another source and potentially free it. This other source would then
either
- go through the normal free logic and change the intern linked list
  between the sources, while other sources that are unreffed as part of
  the main context freeing would not. As such the list would be in an
  inconsistent state and we might dereference freed memory.
- go through the normal destroy and free logic but because the context
  pointer was already invalidated it would simply mark the source as
  destroyed without actually removing it from the context. This would
  then cause a memory leak because the reference owned by the context is
  not freed.

Fixes https://github.com/gtk-rs/glib/issues/583 while still keeping
https://bugzilla.gnome.org/show_bug.cgi?id=661767 fixes.
2020-02-11 10:53:56 +02:00
Sebastian Dröge
b06c48de75 GMainContext - Fix GSource iterator if iteration can modify the list
We first have to ref the next source and then unref the previous one.
This might be the last reference to the previous source, and freeing the
previous source might unref and free the next one which would then leave
use with a dangling pointer here.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/2031
2020-02-11 10:53:52 +02:00
Christian Kirbach
5140c6c2fd Update German translation
(cherry picked from commit ec0983438a)
2020-02-09 14:02:31 +00:00
Claude Paroz
d550ff4c1a Updated French translation 2020-02-09 10:08:29 +01:00
sicklylife
6df9fa8524 Update Japanese translation 2020-02-08 20:44:12 +00:00
Bruce Cowan
78f3a6df8b Update British English translation 2020-02-08 13:06:04 +00:00
Aurimas Černius
637601f628 Updated Lithuanian translation 2020-02-08 14:27:13 +02:00
sicklylife
30d470f40d Update Japanese translation 2020-02-07 20:17:01 +00:00
sicklylife
c3cf0b4da2 Update Japanese translation 2020-02-07 20:12:30 +00:00
Sebastian Dröge
0f264eb97e Merge branch 'autolist-docs' into 'master'
glist: Add docs examples of how to combine with g_steal_pointer()

See merge request GNOME/glib!1355
2020-02-07 15:36:26 +00:00
Philip Withnall
336b2a8d97 Merge branch 'test-for-1340' into 'master'
GThreadPool - Add test for !1340

See merge request GNOME/glib!1354
2020-02-07 15:26:18 +00:00
Sebastian Dröge
c8d4154e3d GThreadPool - Add test for !1340
And two other basic threadpool tests.
2020-02-07 16:24:48 +02:00
Philip Withnall
6bd29c2db9 glist: Add docs examples of how to combine with g_steal_pointer()
As suggested by Simon McVittie and triggered by Marco Trevisan.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

See: https://gitlab.gnome.org/GNOME/glib/merge_requests/818
2020-02-07 14:09:41 +00:00
Philip Withnall
bf6c018475 Merge branch 'wip/hadess/update-docker-packages' into 'master'
ci: Update Docker packages

See merge request GNOME/glib!1281
2020-02-07 14:02:58 +00:00
Rafael Fontenelle
fbe5f2a167 Update Brazilian Portuguese translation 2020-02-06 23:51:49 +00:00
sicklylife
0ea992a9d8 Update Japanese translation 2020-02-05 17:49:06 +00:00
Anders Jonsson
12d4f95530 Update Swedish translation 2020-02-05 16:33:58 +00:00
Kukuh Syafaat
840e6d3970 Update Indonesian translation 2020-02-05 11:31:56 +00:00
sicklylife
bde3c7979d Update Japanese translation 2020-02-04 17:49:00 +00:00
sicklylife
4a9c3643a1 Update Japanese translation 2020-02-04 17:46:48 +00:00
Bastien Nocera
1cc2f51382 ci: Bump Fedora Docker image version
To incorporate changes from the previous 4 commits.
2020-02-04 17:52:16 +01:00
Bastien Nocera
b7586da9bf tests: Fix timeouts not working in GMemoryMonitor tests
The loops should continue iterating if the timeout is non-zero and we're
still waiting for the updated value. Otherwise, if things break, we'll
be waiting until we receive a value that never arrives.
2020-02-04 17:28:07 +01:00
Bastien Nocera
4fe2c7ffdb ci: Update Fedora image before installing new items
This fixes some scriptlets crashes during package installation.
2020-02-04 17:28:07 +01:00
Bastien Nocera
6ff2a181bd ci: Install build deps for extra modules in Docker image
Rather than bringing build dependencies for gobject-introspection
and xdg-desktop-portal manually, install them in the Docker image.
2020-02-04 17:28:07 +01:00
Bastien Nocera
4aa14d5770 ci: Require some updated packages Fedora Docker image
Rather than installing those updates manually.
2020-02-04 17:28:07 +01:00
Bastien Nocera
36aacb8ae3 ci: Expand podman support
If podman is used, as is usually the case on a Fedora Workstation
installation, make sure not to use "sudo" as that's not needed.

Also ask podman's backend (buildah) to create Docker compatible images
through an environment variable rather than a command-line argument.

See https://gitlab.gnome.org/GNOME/glib/merge_requests/1255
2020-02-04 17:27:39 +01:00
Daniel Mustieles
ee53245c14 Updated Spanish translation 2020-02-04 12:19:37 +01:00
Philip Withnall
7f4cb36e8e 2.63.5
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-03 14:26:39 +00:00
Philip Withnall
f6abc575e2 Merge branch 'wip/oholy/gio-info-mount' into 'master'
gio-tool-info: Print unix mount information where available

See merge request GNOME/glib!1345
2020-02-03 13:14:15 +00:00