Commit Graph

30970 Commits

Author SHA1 Message Date
Philip Withnall
ac55270b1b
docs: Fix a broken link in the CODEOWNERS documentation
I wish people would stop moving their documentation around without
adding redirects. This is not how the internet is supposed to work.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-17 11:38:26 +01:00
Philip Withnall
62bc1a500a
docs: Add CI runner maintainers to CODEOWNERS
I can never remember them on demand otherwise.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-17 11:38:11 +01:00
Philip Withnall
a8dbd7cad5 Merge branch 'data-input-stream-read-line-utf8-fix' into 'main'
gdatainputstream: Fix length return value on UTF-8 validation failure

See merge request GNOME/glib!4348
2024-10-12 12:19:10 +00:00
Philip Withnall
9f70c964a0
gdatainputstream: Fix length return value on UTF-8 validation failure
The method was correctly returning an error from
`g_data_input_stream_read_line_utf8()` if the line contained invalid
UTF-8, but it wasn’t correctly setting the returned line length to 0.
This could have caused problems if callers were basing subsequent logic
on the length and not the return value nullness or `GError`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

oss-fuzz#372819437
2024-10-12 13:02:27 +01:00
Philip Withnall
066fefafa0
tests: Use g_assert_*() rather than g_assert() in GDataInputStream tests
It won’t get compiled out with `G_DISABLE_ASSERT`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-12 12:56:00 +01:00
Philip Withnall
3f5997f65d Merge branch 'ebassi/gsettings-build-docs' into 'main'
docs: Add Meson to the GSettings build integration

See merge request GNOME/glib!4347
2024-10-11 09:39:53 +00:00
Emmanuele Bassi
e286c295ef docs: Add Meson to the GSettings build integration
We've long since moved to Meson for GLib and most of GNOME, but our
documentation still only describes integration with Autotools. Let's
rectify this.
2024-10-11 10:17:32 +01:00
Michael Catanzaro
aa02e723df Merge branch 'datainputstream-fuzz-tests' into 'main'
fuzzing: Add fuzz tests for GDataInputStream’s complex read methods

See merge request GNOME/glib!4345
2024-10-10 19:51:43 +00:00
Michael Catanzaro
67baaaded2 Merge branch 'date-docs-typo-fix' into 'main'
gdate: Fix minor typo in documentation comment

See merge request GNOME/glib!4346
2024-10-10 16:59:18 +00:00
Philip Withnall
450fa0a501
gdate: Fix minor typo in documentation comment
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-10 16:48:54 +01:00
Philip Withnall
7dfaa47832 Merge branch 'wip/chergert/gc-varianttypeinfo' into 'main'
gvarianttype: Garbage Collect GVariantTypeInfo

Closes #3472

See merge request GNOME/glib!4275
2024-10-10 12:44:59 +00:00
Philip Withnall
0175b5ff12
gvarianttypeinfo: Mark one-off leaks as ignored
These two data structures are allocated once and live for the lifetime
of the process, and are leaked on exit. That’s fine, and intentional.
Add `g_ignore_leak()` to them to make that a bit clearer, and
communicate the intent to asan.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3472
2024-10-10 13:21:32 +01:00
Christian Hergert
67532b4555 gvarianttype: Garbage Collect GVariantTypeInfo
The goal of this change is to avoid re-parsing `GVariantTypeInfo` on
every creation or parsing of a `GVariant` byte-buffer. Parsing presents
a non-trivial amount of overhead which can typically be elided.

It was discovered that many applications and tooling are re-generating
this information upon receiving a D-Bus message as they tend to process
messages serially, thus dropping the last reference count.

Previously, when the last reference count for a `GVariantTypeInfo` was
dropped we would finalize the parsed type information.

This change keeps `GVariantTypeInfo` alive in a Garbage Collected array.
The array is collected upon reaching a 32 entries. The number 32 was
chosen because it is larger than what I've seen active on various D-Bus
based applications-or-daemons.

Take a simple test case of using `GVariantBuilder` in a loop with a
debugoptimized build of GLib. A reduction in wallclock time can be
observed in the 35% to more than 70% based on the complexity of the
GVariant being created.

For cases like ibus-daemon, it was previously parsing `GVariantTypeInfo`
up to dozens of times per key-press/release cycle.

Closes: #3472
2024-10-10 13:17:47 +01:00
Philip Withnall
2732650bfb
fuzzing: Add fuzz tests for GDataInputStream’s complex read methods
While reading a single byte or uint16 from an input stream is fairly
simple and uncontroversial, the code to read a line or read up to any of
a set of stop characters is not so trivial. People may be using
`GDataInputStream` to parse untrusted input like this, so we should
probably test that it’s robust against a variety of input conditions.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-10 12:15:30 +01:00
Philip Withnall
26d8553af5 Merge branch 'win32-cleanup' into 'main'
Win32 cleanup: do not define STRICT

See merge request GNOME/glib!4339
2024-10-09 16:01:57 +00:00
Philip Withnall
c8a4c58f20 Merge branch 'msvc-ci-2019-addendums' into 'main'
CI: Skip PCRE2 tests for now for 32-bit Visual Studio builds

See merge request GNOME/glib!4343
2024-10-09 14:25:19 +00:00
Philip Withnall
65b3311848 Merge branch 'vs2019-docs' into 'main'
docs: Update CI platforms list and Visual Studio recommendation

See merge request GNOME/glib!4335
2024-10-09 14:23:34 +00:00
Luca Bacci
13f20f1546 Win32: Do not define STRICT
It's defined automatically by system headers (both Windows SDK and mingw-w64)
2024-10-09 11:26:20 +02:00
Chun-wei Fan
6c06792f00 CI: Skip PCRE2 tests for 32-bit Visual Studio builds
...in the main tests that we expect to pass.

Due to an upstream issue in PCRE2-10.44, disable running the PCRE2 tests for
now, until the next release (or so) of PCRE2, as the issue has already been
resolved in upstream PCRE2 but has not made it to the PCRE2 release that we use
for our subprojects.
2024-10-09 12:39:33 +08:00
Michael Catanzaro
c70d98115b Merge branch 'signal-unsubscribe-cleanup' into 'main'
gio: Use g_steal_handle_id() with signal unsubscriptions

See merge request GNOME/glib!4341
2024-10-08 21:45:26 +00:00
Philip Withnall
7040162226 Merge branch 'fix-g_inet_address_new_from_string' into 'main'
simpleproxyresolver: Ignore host with scope id

See merge request GNOME/glib!4202
2024-10-08 13:48:32 +00:00
Gustav Johansson
a4a516a8ab simpleproxyresolver: Ignore host with scope id
Ignore host successfully when a ipv6 address contains a scope id.
2024-10-08 14:10:16 +01:00
Philip Withnall
0032ded759
gopenuriportal: Use g_steal_handle_id() for ownership transfers
This introduces no functional changes, but documents the intent a bit
better in the code where these signal IDs are stored in a struct.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-08 13:57:41 +01:00
Philip Withnall
6b15af3c4c
gio: Use g_steal_handle_id() with signal unsubscriptions
This makes no functional changes, but does tidy the code up a bit and
means `g_steal_handle_id()` gets a bit more testing.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-08 13:57:30 +01:00
Philip Withnall
da5ce72171 Merge branch 'msys2-ci' into 'main'
CI/MSYS2: Fix prefix for gobject-introspection

See merge request GNOME/glib!4338
2024-10-08 12:15:56 +00:00
Luca Bacci
f66d144091 test-msys2.sh: Remove unnecessary line
${MINGW_PREFIX}/bin is already in PATH
2024-10-08 13:37:31 +02:00
Luca Bacci
31bd6956f0 CI/MSYS2: Fix prefix for gobject-introspection
The right prefix is /c/msys64/${MSYSTEM}, without the final /usr.
Anyway let's simply use the MINGW_PREFIX environment variable.
2024-10-08 12:20:38 +02:00
Michael Catanzaro
bb0d3d2c1c Merge branch 'fuzz-string-replace-oom' into 'main'
fuzzing: Add input length limits on g_string_replace() test

See merge request GNOME/glib!4334
2024-10-07 21:54:19 +00:00
Philip Withnall
837d14d36a
docs: Update CI platforms list and Visual Studio recommendation
Follow up to !4318 because I didn’t think of it during review.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-07 15:09:03 +01:00
Philip Withnall
eb413097e5 Merge branch 'xnu-mcast-iface' into 'main'
gio: Fix multicast iface selection on macOS

Closes #3489

See merge request GNOME/glib!4333
2024-10-07 14:02:02 +00:00
Nirbheek Chauhan
469084c45b gio: Fix multicast iface selection on macOS
ip_mreqn.imr_ifindex is not used correctly by the XNU kernel, and
causes us to bind to the default interface; so fallback to ip_mreq
and set the iface source address (not SSM).

Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/3489
2024-10-07 14:02:02 +00:00
Philip Withnall
2fe82cb62d Merge branch 'msvc-ci-2019' into 'main'
CI: Use Visual Studio 2019 for the MSVC CI

See merge request GNOME/glib!4318
2024-10-07 13:57:51 +00:00
Philip Withnall
4416d9dcce Merge branch '3488-introspection-checks' into 'main'
build: Check for gobject-introspection-1.0 as well as g-ir-scanner

Closes #3488

See merge request GNOME/glib!4329
2024-10-07 13:46:04 +00:00
Chun-wei Fan
cba1d820d9 CI: Only run the VS2019-x86 CI job weekly or on request
As per suggested by Philip, as the Visual Studio CI jobs are the slowest to
be picked up and to be completed.
2024-10-07 14:56:56 +08:00
Chun-wei Fan
c4799982d6 CI: Add a 32-bit Visual Studio 2019 config
This way, we can continue to test whether 32-bit builds continue to work
with Visual Studio builds. Note that this uses the x64-to-x86 cross compiler.
2024-10-07 14:56:56 +08:00
Chun-wei Fan
0f0d5df4e5 CI: Use Visual Studio 2019 for the MSVC CI
...and add ability to select target platform for calling vcvarsall.bat,
so that we can accomodate 32-bit builds and possibly ARM64 builds in the
CI if we need to.
2024-10-07 14:56:55 +08:00
Philip Withnall
c94cbf2368 Merge branch 'wip/chergert/gdatainputstream-memchr' into 'main'
gio/gdatainputstream: use memchr() when possible

See merge request GNOME/glib!4327
2024-10-05 22:09:34 +00:00
Philip Withnall
276889ac85
fuzzing: Add input length limits on g_string_replace() test
Limit the input size. With a short @find, and a long `init` and `replace`
it’s quite possible to hit OOM. We’re not interested in testing that — it’s
up to the caller of `g_string_replace()` to handle that. 1KB on each of the
inputs should be plenty to find any string parsing or pointer arithmetic
bugs in `g_string_replace()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

oss-fuzz#371233785
2024-10-05 23:01:58 +01:00
Philip Withnall
74e37a483f Merge branch 'ebassi/gir-inline' into 'main'
gir: Ignore function-inline and method-inline elements

See merge request GNOME/glib!4331
2024-10-05 21:11:13 +00:00
Christian Hergert
760a6f6477 gio/tests: add test for single escape character
Converts the existing test to a loop and adds another test case which
tests a single stop character, \0 in this case.
2024-10-04 12:46:11 -07:00
Nirbheek Chauhan
decd9bb1ca Merge branch 'fix_woa64_1' into 'main'
Meson: fix support for aarch64-w64-mingw32 (Windows on ARM64)

Closes #3490

See merge request GNOME/glib!4330
2024-10-04 17:07:44 +00:00
Carlo Bramini
2986cd3793 Meson: fix support for aarch64-w64-mingw32 (Windows on ARM64)
This patch fixes a build error when compiling with GCC cross compiler for Windows on ARM64.
See issue #3490 for details.

Signed-off-by: Carlo Bramini carlo_bramini@users.sourceforge.net
Fixes: #3490
Closes #3490
2024-10-04 11:43:45 +02:00
Emmanuele Bassi
20134e6942 gir: Ignore function-inline and method-inline elements
Static inlines are available in the GIR, but they do not translate to
ABI, so they cannot go in the typelib. We handle them just like function
macros.
2024-10-03 18:35:38 +02:00
Philip Withnall
fb4f2e5578 Merge branch 'wip/chergert/c-utf8' into 'main'
glib/utf8: Use SIMD for UTF-8 validation

Closes #3481

See merge request GNOME/glib!4319
2024-10-03 15:07:17 +00:00
Philip Withnall
72384894b8
gutf8: Remove dead branch condition
This arm of the condition is always true, because 0x00 has been checked
in the previous branch.

This is not going to improve performance, but does mean we now have full
branch coverage of the code via our unit tests, which gives some
assurance that it’s all good.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3481
2024-10-03 15:46:01 +01:00
Philip Withnall
36e4bb9872
tests: Add some more UTF-8 validation corner cases
The move to c-utf8 for validation has exposed a few new branches where
our existing (fairly comprehensive) UTF-8 validation test suite didn’t
check things.

Add unit tests for those branches, so we keep code coverage.

I’ve validated (with an independent UTF-8 decoder) that the test vectors
are correctly marked as valid/invalid in the test data (so the tests
aren’t just blindly coded to match the behaviour of the new validator
code).

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3481
2024-10-03 15:43:35 +01:00
Philip Withnall
e570263483
tests: Add basic unit tests for g_str_is_ascii()
It turns out it’s not actually been explicitly tested before, even
though it has full code coverage through being called by other code
which is tested.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-10-03 14:31:02 +01:00
Philip Withnall
7f8f0842d0 Merge branch 'wip/pwithnall/reenable-freebsd-fatal-warnings' into 'main'
ci: Re-enable fatal warnings for FreeBSD CI

See merge request GNOME/glib!4307
2024-10-03 12:56:21 +00:00
Philip Withnall
04abc6b6c1
build: Check for gobject-introspection-1.0 as well as g-ir-scanner
Both are needed in practice to build the GIR files.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Fixes: #3488
2024-10-03 13:39:30 +01:00
Christian Hergert
e7e5ddd2ae gio/gdatainputstream: use memchr() when possible
Scanning for stop chars can require looking through a considerable amount
of input data. In the case there is a single stop character, use memchr()
which can be optimized by the compiler to look at word size or greater
amounts of data at a time.
2024-10-02 13:33:17 -07:00