Commit Graph

21776 Commits

Author SHA1 Message Date
Philip Withnall
d149f5ea08 Merge branch 'wip/smcv/show-execution-environment' into 'master'
CI: Show execution environment before we start

See merge request GNOME/glib!1360
2020-03-04 17:24:07 +00:00
Philip Withnall
28133feb4a Merge branch '2051-unix-output-stream-fsync' into 'master'
gunix{input|output}stream: Drop custom close_{async|finish}() methods

Closes #2051

See merge request GNOME/glib!1401
2020-03-04 15:35:47 +00:00
Philip Withnall
9166a0e0ad gtestutils: Clarify documentation for g_test_set_nonfatal_assertions()
It seems a bit unhelpful to list every single `g_assert_*()` macro, to
rephrase the documentation to use globs instead.

Add a missing word below.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-04 15:34:05 +00:00
Philip Withnall
9e45b95816 gtestutils: Add a new g_assert_no_errno() test macro
This is for use in testing POSIX-style functions like `rmdir()`, which
return an integer < 0 on failure, and return their error information in
`errno`.

The new macro prints `errno` and `g_strerror (errno)` on failure.

Includes a unit test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-04 15:32:25 +00:00
Philip Withnall
2510d5aae0 Merge branch 'wip/Jehan/g_param_is_valid_property_name' into 'master'
gobject: new g_param_is_valid_property_name() function.

See merge request GNOME/glib!1302
2020-03-04 15:30:38 +00:00
Simon McVittie
dff2e3b4c7 CI: Show execution environment before we start
This will help to debug CI issues that are related to us running in
a container that might have unusual capabilities, mount points,
filesystems etc., such as (probably) #2027, #2028, #2029.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2020-03-04 15:25:47 +00:00
Philip Withnall
d49393e94d gparam: Clarify that parameter names must be non-empty
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-04 14:46:28 +00:00
Jehan
13d1697b67 gobject: Add g_{param_spec,signal}_is_valid_name() functions
Making this validation code public allows projects to validate a
GParamSpec name before creating it. While hard-coded GParamSpec don't
need this, we can't afford crashing the main program for dynamically
generated GParamSpec from user-created data.

In such case, we will need to validate the param names and return errors
instead of trying to create a GParamSpec with invalid names.

Includes modifications from Philip Withnall and Emmanuele Bassi to
rearrange the new function addition and split it into one function for
GParamSpecs and one for GSignals.
2020-03-04 14:46:28 +00:00
Philip Withnall
fb1e416a32 gversionmacros: Add version macros for GLib 2.66
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-04 14:46:28 +00:00
Philip Withnall
604081971f build: Post-release version bump to 2.65.0
Ready for the new unstable release series.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-04 14:46:28 +00:00
Philip Withnall
8f16a89817 Merge branch '2038-tls-connection-annotations' into 'master'
gtlsconnection: Add missing (nullable) annotations

Closes #2038

See merge request GNOME/glib!1368
2020-03-04 14:15:07 +00:00
Philip Withnall
855e1de044 Merge branch 'wip/tbaederr/fallthrough' into 'master'
Replace fallthrough comments with G_GNUC_FALLTHROUGH

See merge request GNOME/glib!1406
2020-03-04 11:10:01 +00:00
Philip Withnall
51953dd857 Merge branch 'wip/baedert/fallthrough-clang' into 'master'
macros: Define G_GNUC_FALLTHROUGH for more compilers

See merge request GNOME/glib!1396
2020-03-04 11:08:26 +00:00
Timm Bäder
e5ab441b0d Replace fallthrough comments with G_GNUC_FALLTHROUGH
It's safer to do it this way and since we have G_GNUC_FALLTHROUGH now, w
e might as well replace the fallthrough comments.
2020-03-04 11:21:17 +01:00
Philip Withnall
b72acc9c6e Merge branch 'disable_mem-overflow_test_link_warning' into 'master'
tests: Disable link-time warning for mem-overflow

See merge request GNOME/glib!1405
2020-03-04 10:17:40 +00:00
nightuser
43dbf98687 tests: Disable link-time warning for mem-overflow
`mem-overflow` test disables GCC warning `alloc-size-larger-than` via
diagnostic pragma, but it's still emitted in the linkage stage when
LTO is enabled.

This changes explicitly set `link_args` for the test to disable the
warning.
2020-03-03 23:54:21 +03:00
Philip Withnall
46d343e734 garray: Clarify documentation in a few places
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1154
2020-03-03 14:32:37 +00:00
Milo Casagrande
66af0d2a7d Update Italian translation 2020-03-03 10:40:50 +00:00
Philip Withnall
b9e071f119 ci: Update Android Docker image for aarch64 CPU naming change
See !1376. Update the Docker image for Android after merging that
change.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-03-02 14:17:25 +00:00
Philip Withnall
0a2dc161c0 gunix{input|output}stream: Drop custom close_{async|finish}() methods
They were not actually asynchronous, and hence caused blocking in the
main thread. Deleting them means the default implementation of those
vfuncs is used, which runs the sync implementation in a thread — which
is what is wanted here.

Spotted by Benjamin Otte.

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

Fixes: #2051
2020-03-02 13:55:00 +00:00
Philip Withnall
b3b814f9c2 Merge branch 'wip/smcv/skip-low-mem' into 'master'
tests: Skip MemoryMonitor test if GObject-Introspection is too old

See merge request GNOME/glib!1397
2020-03-02 10:26:50 +00:00
Philip Withnall
e4a690f5dd gcancellable: Fix minor race between GCancellable and GCancellableSource
There’s a minor race condition between cancellation of a `GCancellable`,
and disposal/finalisation of a `GCancellableSource` in another thread.

Thread A                               Thread B
 g_cancellable_cancel(C)
 →cancellable_source_cancelled(C, S)
                                       g_source_unref(S)
                                       cancellable_source_dispose(S)
 →→g_source_ref(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
`cancellable_source_cancelled()`.

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
set.

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 <withnall@endlessm.com>

Fixes: #1841
2020-02-29 20:15:39 +00:00
Philip Withnall
4093321c9a 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 <withnall@endlessm.com>
2020-02-28 16:06:46 +00:00
Sebastian Dröge
2cad4fb5bf Merge branch 'wip/hadess/avoid-all-remote-files-crash' into 'master'
gcontenttype: Fix crash in _get_generic_icon_name()

See merge request GNOME/glib!1398
2020-02-28 14:49:51 +00:00
Bastien Nocera
a7181ad397 gcontenttype: Fix crash in _get_generic_icon_name()
Guard against NULL type being passed to
g_content_type_get_generic_icon_name() just as we protect
g_content_type_get_description(), otherwise it will cause a crash.

See https://gitlab.gnome.org/GNOME/gtk/issues/2482
2020-02-28 15:09:50 +01:00
Simon McVittie
08a4a2e6f4 Merge branch 'installed-tests' into 'master'
tests: Move memory_monitor_tests under installed_tests_enabled

See merge request GNOME/glib!1395
2020-02-28 14:02:32 +00:00
Jan Alexander Steffens (heftig)
7bdcfcf73a
tests: Move memory_monitor_tests under installed_tests_enabled
So they're not installed when the latter is disabled.
2020-02-28 14:10:25 +01:00
Simon McVittie
fdbd9ed7f7 tests: Skip MemoryMonitor test if GObject-Introspection is too old
Distributions will likely want to update GLib before
GObject-Introspection, to avoid circular dependencies.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-02-28 12:42:36 +00:00
Timm Bäder
5f38ae5ffc macros: Define G_GNUC_FALLTHROUGH for more compilers
Some compilers have __GNUC__ defined as a value less than 6, but do
support implicit-fallthrough via __attribute__((fallthrough)). Define
G_GNUC_FALLTHROUGH for those that support __has_attribute.
2020-02-28 09:34:38 +01:00
Philip Withnall
369626e310 2.64.0
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-27 16:11:22 +00:00
Sebastian Dröge
21471b4258 Merge branch '2049-array-crash' into 'master'
garray: Fix copying an array with reserved elements

Closes #2049

See merge request GNOME/glib!1390
2020-02-27 15:20:52 +00:00
Philip Withnall
d22c762221 garray: Fix copying an array with reserved elements
Spotted by Mohammed Sadiq. `g_array_copy()` was doing a `memcpy()` of
the data from the old array to the new one, based on the reserved
elements in the old array (`array->alloc`). However, the new array was
allocated based on the *assigned* elements in the old array
(`array->len`).

So if the old array had fewer assigned elements than allocated elements,
`memcpy()` would fall off the end of the newly allocated data block.
This was particularly obvious when the old array had no assigned
elements, as the new array’s data pointer would be `NULL`.

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

Fixes: #2049
2020-02-27 14:48:36 +00:00
Philip Withnall
423b2bbc95 gsocks5proxy: Fix SOCKS5 username/password authentication
It was checking for the main SOCKS5 version number, rather than the
subnegotiation version number. The username/password authentication
protocol is described in https://tools.ietf.org/html/rfc1929.

Spotted and diagnosed by lovetox.

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

Fixes: #1986
2020-02-27 12:16:41 +00:00
Philip Withnall
67610c7c0f Merge branch 'shell-ci-fixes' into 'master'
ci: Correctly propagate exit status in run-style-check-diff.sh

See merge request GNOME/glib!1387
2020-02-27 11:20:14 +00:00
Philip Withnall
5292efdc75 Merge branch 'sam/use-g-define-quark' into 'master'
Update GError docs to use G_DEFINE_QUARK

See merge request GNOME/glib!1389
2020-02-27 11:07:58 +00:00
Philip Withnall
c5d661b4c4 build: Fix shellcheck warnings in various old build and test scripts
Most of these scripts can probably just be deleted (see issue #2045),
but for now it was easier to just mechanically fix the shellcheck
warnings in them, rather than think about whether we actually needed the
script.

Fixes done using shellcheck 0.7.0 with default options. I haven’t tested
any of the changes.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-27 10:33:45 +00:00
Philip Withnall
00dfb1de0f ci: Ensure run-check-todos.sh exits on the first error it encounters
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-27 10:33:45 +00:00
Philip Withnall
23d26cfe7e ci: Fix various shellcheck warnings in the shell scripts
I haven’t tested any of them. This is entirely mechanical. I used
shellcheck 0.7.0 with default options.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-27 10:33:45 +00:00
Sam Thursfield
dcbaae4fa2 Update GError docs to use G_DEFINE_QUARK 2020-02-26 20:06:13 +01:00
Simon McVittie
70c5fd53e9 Merge branch 'test-dbus-posix_spawn' into 'master'
gtestdbus: Use posix_spawn() to spawn dbus-daemon

See merge request GNOME/glib!1388
2020-02-26 13:57:47 +00:00
Marek Černocký
2bd7ade25d Updated Czech translation 2020-02-26 14:07:19 +01:00
Philip Withnall
eb867c3d2f gtestdbus: Use posix_spawn() to spawn dbus-daemon
This speeds up tests which use `GTestDBus` significantly.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-26 10:45:45 +00:00
Alan Mortensen
c01517644b Updated Danish translation 2020-02-25 20:45:40 +01:00
Emmanuele Bassi
f55ff88531 Merge branch 'document-generated-headers-caveats-for-genmarshal-too' into 'master'
docs: Document generated headers caveats for genmarshal

See merge request GNOME/glib!1386
2020-02-25 11:45:41 +00:00
Philip Withnall
95479256df ci: Correctly propagate exit status in run-style-check-diff.sh
Spotted by Daniel Stone: the addition of the `echo` commands in commit
65541f1ad meant that the exit status from `clang-format-diff.py` was
being lost.

The incorrect use of `set +e` rather than `set -e` meant that
intermediate commands could fail without the failure being noticed.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-25 11:11:42 +00:00
Sebastian Dröge
cf72043ade Merge branch 'warning-fixes' into 'master'
Some minor clang warning fixes

See merge request GNOME/glib!1384
2020-02-24 21:52:57 +00:00
Nirbheek Chauhan
3732f9bd07 docs: Document generated headers caveats for genmarshal
And also link to the Meson FAQ that explains why this is needed so
people aren't just cargo-culting code.
2020-02-25 03:14:50 +05:30
Philip Withnall
276fff2b96 Merge branch 'issue-1783' into 'master'
Document Meson use for GLib tools

Closes #1783

See merge request GNOME/glib!861
2020-02-24 17:25:38 +00:00
Philip Withnall
37a3da891b tests: Add some assertions to avoid unused variable warnings on Clang
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-24 16:18:58 +00:00
Philip Withnall
99a325356d tests: Fix a compiler warning about string+int arithmetic
Clang warns about string+int not appending to the string (to try and
catch newbie mistakes). While this test didn’t expect that to happen, it
was substituting the same constant string in multiple places for no good
reason. Switch to a single static const string, which should also fix
the compiler warning.

We have to define the string length since it’s used in various
stack-allocated array lengths. This is the easiest fix without more
major refactoring of the test to be less 90s.

Also make things a bit more static.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2020-02-24 16:18:58 +00:00