Commit Graph

27413 Commits

Author SHA1 Message Date
Gaël Bonithon
f74589f530 gkeyfile: Replace g_slice_*() with g_new*()/g_free_sized() 2023-04-20 16:52:19 +02:00
Marco Trevisan (Treviño)
d296e94559 appmonitor: Skip the test under OSX
Since commit c0ca3f99 this test is strictly depending on GDesktopAppInfo
that is not defined or available in macos, so skip the test as we do for
windows.

We could have done this at meson level too, but keeping it this way is
probably a better reminder that this should be adapted for such scenario
one day™

See: https://gitlab.gnome.org/GNOME/glib/-/jobs/2753753
2023-04-20 16:37:32 +02:00
Marco Trevisan
9f3c4ec940 Merge branch 'old-mac-sdk' into 'main'
gio: fix build on older macOS SDKs

See merge request GNOME/glib!3385
2023-04-20 13:12:06 +00:00
Peter Williams
bb19523a0a gio: fix build on older macOS SDKs
The merge request !2848 added code to automatically detect the module
prefix on macOS, with a test for the Mac #define TARGET_OS_OSX. However,
older versions of the SDK (at least 10.11) don't provide this #define,
leading to build failure. If the #define is missing, fall back to
checking TARGET_OS_MAC. On newer SDKs this symbol is also true for
watchOS, etc., but in those situations TARGET_OS_OSX is available.
2023-04-20 08:54:23 -04:00
Emmanuele Bassi
5f9f1104b9 Merge branch 'do-not-redefine-null-c++' into 'main'
gmacros: Do not redefine NULL on C++

Closes #2973

See merge request GNOME/glib!3387
2023-04-20 10:53:41 +00:00
Marco Trevisan (Treviño)
164f199afc gmacros: Do not redefine NULL on C++
Even though having NULL as nullptr should be the standard for newer C++
versions, it may break some headers, so let's not touch it for now.

Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2973
2023-04-19 23:03:43 +02:00
Marco Trevisan (Treviño)
7d5242d34e gmain: Do not dead-look if calling g_main_loop_run from a GSource
This should fail and warn but not leaving the context acquired and
locked.

Add tests.
2023-04-19 22:52:43 +02:00
Marco Trevisan (Treviño)
f8e440335c gmain: Avoid locking dance in g_main_loop_run()
We do it during initialization, this may be if necessary handled by GCond in
case we need to acquire the lock.
2023-04-19 22:04:13 +02:00
Marco Trevisan (Treviño)
e7c2ead41b gmain: Avoid some lock/unlock dance during g_main_context_iterate
A context iteration we're doing lots of lock/unlocks and that's fine to give
other threads contexts a chance to run, but we're doing it also just to call
other functions that require locking, and this can be avoided.

Other threads can still have a chance to run while releasing the ownership
of the context.
2023-04-19 21:58:22 +02:00
Marco Trevisan
aa72638301 Merge branch 'fix-gsocket-receive-from-annotation' into 'main'
gsocket: Explicitly mark size parameter as (in)

See merge request GNOME/glib!3382
2023-04-19 19:19:41 +00:00
Marco Trevisan (Treviño)
fe38a02c62 gmodule: Define a gmodule include dependency and use it in gio modules
Various gio modules include gmodule.h that requires the
gmodule-visibility.h to be already built.

To make this easier, just provide a dependency and use it where we are
building modules that do not depend on libgio_dep (that already includes
that).

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/2982
2023-04-19 21:10:29 +02:00
Anders Jonsson
d4708c180d Update Swedish translation 2023-04-19 16:58:48 +00:00
Przemyslaw Gorszkowski
74d49e447f Test g_signal_handlers_disconnect_matched for G_SIGNAL_MATCH_ID match
Signed-off-by: Przemyslaw Gorszkowski <pgorszkowski@igalia.com>
2023-04-18 12:50:55 +02:00
Marco Trevisan
9f111c3416 Merge branch 'valgrind-variable' into 'main'
meson: Add glib_valgrind_suppressions variable to glib pkg-config file

See merge request GNOME/glib!3361
2023-04-17 12:52:28 +00:00
Marco Trevisan (Treviño)
c2e46b3789 meson: cleanup pkg-config variables definitions
Use more readable and shorter syntax
2023-04-17 14:25:52 +02:00
Marco Trevisan (Treviño)
ade79bcb50 meson: Add tests for generated pkg-config files
Ensure things are generated as we expect and avoid we regress on that.
2023-04-17 14:25:52 +02:00
Philip Withnall
7c1ef5c9ec Merge branch 'no-usleep-on-0' into 'main'
gtimer: Avoid doing anything on g_usleep (0)

See merge request GNOME/glib!3381
2023-04-17 11:44:36 +00:00
badcel
f510fa0227
gsocket: Explicitly mark size parameter as (in)
The generated gir file marks the size parameter as "out" by default. This is wrong in the context of a caller allocated buffer with a given size. Explicitly marking the size parameter as (in) fixes the issue.
2023-04-15 22:53:05 +02:00
Marco Trevisan (Treviño)
732e40dcfa gtimer: Avoid doing anything on g_usleep (0)
It's unlikely to happen, but still could be the case, so avoid do
anything.
2023-04-14 20:24:52 +02:00
Philip Withnall
7a5d4c2bb7 gfileutils: Fix potential integer overflow in g_get_current_dir()
In practice, this will never happen.

If `getcwd()` returns `ERANGE` whenever the working directory is ≥
`PATH_MAX`, though, the previous implementation of the loop would run
until `max_len == G_MAXULONG`, and would then overflow when adding `1`
to it for a nul terminator in the allocation.

Avoid that problem by always keeping `buffer_len` as a power of two, and
relying on `getcwd()` to write a nul terminator within the buffer space
it’s given. It seems to do this on all platforms we care about, because
the previous version of the code never explicitly wrote a nul terminator
anywhere.

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

Fixes: #98
2023-04-14 19:23:20 +01:00
Marco Trevisan (Treviño)
fcad56e313 meson: Add glib_valgrind_suppressions variable to glib pkg-config file
Various projects are running tests under valgrind, and they are using
the GLib suppresions to avoid false-positive results.

While this is stored in a well-known path for some years, and easy to
figure out from the GLib prefix, it's better to expose it through a
proper pkgconfig variable so that it's easy to get it from any build
system.
2023-04-14 19:20:51 +02:00
Philip Withnall
9d2f65576f Merge branch 'work-around-ucrt-spawn-env-issue' into 'main'
Work around an UCRT issue with _wspawn() functions taking an envp block

See merge request GNOME/glib!3289
2023-04-14 17:06:32 +00:00
Philip Withnall
d46405029c Merge branch 'ghash-gvariant-cheri-layout' into 'main'
Make GVariant/GHash opaque types compatible with CHERI

See merge request GNOME/glib!3146
2023-04-14 17:02:54 +00:00
Philip Withnall
da35056247 Merge branch 'registry-settings-root-key' into 'main'
gregistrysettingsbackend: Allow a different root key path

See merge request GNOME/glib!3306
2023-04-14 17:00:01 +00:00
Dario Saccavino
fee0a7679a gregistrysettingsbackend: Allow a different root key path 2023-04-14 17:00:01 +00:00
Philip Withnall
01d5b41afa Revert "gfileinfo: Temporarily downgrade missing attribute criticals to debugs"
This reverts commit 4cad66580b.

Downgrading the criticals was only temporary. Now we’ve branched for
GLib 2.78, the criticals can be reinstated early this cycle, so people
have the maximum time to fix latent bugs in their code.

Fixes: #2951
2023-04-14 17:55:37 +01:00
Philip Withnall
e86d8ccf28 Merge branch 'api-index' into 'main'
doc: Workaround missing API index

See merge request GNOME/glib!3308
2023-04-14 16:38:37 +00:00
Philip Withnall
cd118f9af0 Merge branch 'action-group-query-action' into 'main'
actiongroup: Add a compiler warning

See merge request GNOME/glib!3367
2023-04-14 16:32:54 +00:00
Luca Bacci
5d1046d3b2 Add test for UCRT issue workaround 2023-04-14 17:15:28 +01:00
Luca Bacci
911d091866 Work around an UCRT issue with _wspawn() functions taking an environment block argument
We were working around that with a call to chdir("."). Internally chdir()
sets up cmd shell-related environment variables, but only if the current
working directory belongs to a volume with a drive letter. For example,
if the current working directory is on a UNC volume like a network share,
the call to chdir() won't help.

Reference:
  https://developercommunity.visualstudio.com/t/UCRT-Crash-in-_wspawne-functions/10262748
2023-04-14 17:15:28 +01:00
Philip Withnall
353f2e4b3c Merge branch 'normalize-utf8-bounds-checking' into 'main'
g_utf8_normalize: don't read past the end of the buffer

See merge request GNOME/glib!3341
2023-04-14 16:14:54 +00:00
Xavier Claessens
8d27474631 doc: Workaround missing API index 2023-04-14 17:08:35 +01:00
Philip Withnall
8b45b81150 Merge branch 'pgorszkowski/add_signal_id_option_to_g_signal_handlers_block_matched' into 'main'
Support G_SIGNAL_MATCH_ID in g_signal_handlers_block/unblock/disconnect_matched()

Closes #2980

See merge request GNOME/glib!3376
2023-04-14 15:56:09 +00:00
Philip Withnall
f2f322005d Merge branch 'update-annotations' into 'main'
Explicitly mark size parameter as (in)

See merge request GNOME/glib!3371
2023-04-14 15:55:38 +00:00
Philip Withnall
3f390d5598 Merge branch '2307-mainloop-test-asan' into 'main'
tests: Re-enable mainloop test under AddressSanitizer

Closes #2307

See merge request GNOME/glib!3329
2023-04-14 15:55:06 +00:00
Philip Withnall
58cb296416 Merge branch 'feature/sum_apparent_size_only_for_files_and_symlinks' into 'main'
Align `G_FILE_MEASURE_APPARENT_SIZE` behaviour with `du` from GNU coreutils 9.2

Closes #2965

See merge request GNOME/glib!3358
2023-04-14 15:54:19 +00:00
Philip Withnall
11bdd6fcc4 Merge branch 'wip/jtojnar/wl-are-compiler-flags' into 'main'
build/gmodule-2.0.pc: Move compiler flags from Libs to Cflags

See merge request GNOME/glib!3356
2023-04-14 15:52:56 +00:00
Todd Carson
c82f9adb19 Test g_utf8_normalize() handling of invalid UTF-8 inputs
Add three classes of test case for which g_utf8_normalize() should
safely return NULL:
 - Strings ending with a truncated multibyte character which would
   extend past the NUL terminator
 - Strings ending with a multibyte character which extends past the
   length limit provided by the max_len argument
 - Strings containing an invalid multibyte character in any position
2023-04-14 16:52:16 +01:00
Todd Carson
7f4726d151 g_utf8_normalize: don't read past the end of the buffer
_g_utf8_normalize_wc() could read past the end of the provided buffer if
it ends with a truncated multibyte character. If max_len is -1, it can
continue reading until it encounters either a NUL or unreadable
memory. Avoid this with extra bounds checks prior to g_utf8_get_char()
to ensure that it does not read past either max_len or a NUL
terminator.
2023-04-14 16:52:10 +01:00
Philip Withnall
d5a7982eeb Merge branch 'fuzz-normalize-utf8' into 'main'
Add fuzzing harness for g_utf8_normalize()

See merge request GNOME/glib!3342
2023-04-14 15:50:48 +00:00
Todd Carson
0cfa300c00 Add fuzzing harness for g_utf8_normalize() 2023-04-14 15:50:47 +00:00
Philip Withnall
715c8064be Merge branch 'meson-system-libintl-detection' into 'main'
meson: Fix detection of a system-provided proxy-libintl

See merge request GNOME/glib!3352
2023-04-14 15:50:20 +00:00
Philip Withnall
088e2a4f5a Merge branch 'socket-nonblock' into 'main'
gsocket/inotify/gwakeup: Use SOCK_NONBLOCK and O_NONBLOCK to avoid fcntl() syscalls where possible

See merge request GNOME/glib!3347
2023-04-14 15:49:52 +00:00
Philip Withnall
17295bd0b0 Merge branch 'move-msvc-recommended-pragmas' into 'main'
meson: Move msvc_recommended_pragmas.h to a subdirectory

See merge request GNOME/glib!3340
2023-04-14 15:49:21 +00:00
Philip Withnall
1ebfe32c06 Merge branch 'gio-tool-info-strings' into 'main'
gio-tool-info: Fix a duplicate attribute name in the UI

See merge request GNOME/glib!3337
2023-04-14 15:48:43 +00:00
Philip Withnall
5611851eb9 Merge branch 'bsd-libelf-enabled' into 'main'
meson: allow -Dlibelf=enabled without pkg-config

See merge request GNOME/glib!3335
2023-04-14 15:48:20 +00:00
Philip Withnall
8a2fbe78d2 Merge branch 'post-release-version-stuff' into 'main'
build: Post-release version bump

See merge request GNOME/glib!3378
2023-04-14 15:46:08 +00:00
Philip Withnall
e993e27782 docs: Add 2.78 release series documentation pages to the build
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-04-14 16:09:34 +01:00
Philip Withnall
f06bc48685 build: Post-release version bump
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-04-14 16:09:33 +01:00
Philip Withnall
56bc6bcad2 Merge branch '1264-gdbus-double-unref' into 'main'
gdbusconnection: Fix double unref on timeout/cancel sending a message

Closes #1264

See merge request GNOME/glib!3291
2023-04-14 14:57:32 +00:00