Commit Graph

27855 Commits

Author SHA1 Message Date
Alessandro Bono
272ec5dbca tests/gsubprocess: Don't rely on PTRACE_O_EXITKILL presence
The PTRACE_O_EXITKILL symbol was introduced in glibc 2.23. CentOS7
has glibc 2.17. Use the symbol only if it is defined.
2023-09-19 12:37:23 +02:00
Rūdolfs Mazurs
5a67a8f6c5 Update Latvian translation 2023-09-18 14:10:08 +00:00
Rafael Fontenelle
af912ba017 Update Brazilian Portuguese translation
(cherry picked from commit 13bc82d016)
2023-09-18 01:28:01 +00:00
Daniel Rusek
9e36642bbb Update Czech translation 2023-09-17 12:58:56 +00:00
Artur S0
508dba1ed8 Update Russian translation 2023-09-16 09:29:27 +00:00
Boyuan Yang
fb7a5eee97 Update Chinese (China) translation 2023-09-15 08:28:12 +00:00
Pavel Sobolev
cabc494073
Make sure the GTask is freed on a graceful disconnect
This fixes the memory leak in the case the connection has been
successfully closed by the peer.
2023-09-14 15:42:24 +03:00
Philip Withnall
56daac02d1 gthread: Fix optional/nullable annotations for g_once_init_*()
The pointer argument must not be `NULL` (though it can point to a
location which is zero/null-valued), so this should be `(not optional)`
not `(not nullable)`.

Spotted in !3577.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2023-09-13 14:18:55 +01:00
Luca Bacci
13c5256fd7 gthread-win32: Fix size argument passed to RaiseException
https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code?view=vs-2022#set-a-thread-name-by-throwing-an-exception
2023-09-13 14:04:26 +02:00
Luca Bacci
19d06340cf gthread-win32: Check for specific exception code
https://learn.microsoft.com/en-us/cpp/code-quality/c6320?view=msvc-170
2023-09-13 14:04:26 +02:00
Luca Bacci
f4b53cacbf gthread-win32: No need to raise thread name exception if the debugger is not present
As outlined in [1], raising the exception without a debugger attached
isn't of any use, as the thread name won't be stored anywhere.
The system doesn't trap such exception, only debuggers.

This also fixes a TOCTTOU issue between the IsDebuggerPresent() check
and the RaiseException() call.

References:
 [1] - https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-set-a-thread-name-in-native-code?view=vs-2022#set-a-thread-name-by-throwing-an-exception
2023-09-13 14:04:26 +02:00
Luca Bacci
fb3f1733c3 gthread-win32: Print critical if we cannot register fallback handler for the thread name exception 2023-09-13 14:04:26 +02:00
Luca Bacci
d60ca9aa38 gthread-win32: Register fallback handler for thread name as last
Many ASAN implementations install Vectored Exception Handlers that
must be the first in the sequence. As we don't really care about
ordering, let's place our handler as last.

References:
 - https://developercommunity.visualstudio.com/t/asan-problems-when-manual-exception-handling/1242524
 - https://source.chromium.org/chromium/chromium/src/+/main:components/browser_watcher/extended_crash_reporting.cc;l=150;drc=4ced8912
2023-09-13 14:04:11 +02:00
Philip Withnall
f51f40c440 Merge branch 'find-test-program-freebsd' into 'main'
Fix test_find_program on FreeBSD

See merge request GNOME/glib!3580
2023-09-13 11:21:07 +00:00
Philip Withnall
1f9aafe5d5 Merge branch 'cheri-int-cast-warning-fix' into 'main'
Fixes for integer cast warnings when targeting CHERI

See merge request GNOME/glib!3579
2023-09-13 11:19:30 +00:00
Milo Casagrande
771b4ed865 Update Italian translation 2023-09-13 07:25:53 +00:00
Alex Richardson
25ae9f59e8 Fix test_find_program on FreeBSD
On FreeBSD /home is generally a symlink to /usr/home, so the relative
resolves to /usr/bin instead of /bin and `sh` can only be found in /bin
on FreeBSD. Fix this by resolving symlinks in the CWD first.
2023-09-12 21:51:15 -07:00
Alexandre Franke
d1ba2b421f Update French translation 2023-09-12 20:11:16 +00:00
Alex Richardson
2787e59a77 CHERI: silence two pedantic warnings
When building for CHERI with additional warning flags, implicitly
converting uintptr_t to an integer type that can't store a pointer
results in a compiler warnings. Silence two of these by adding
explicit casts.
2023-09-12 10:23:20 -07:00
Alex Richardson
403f7a10dc GSIZE_TO_POINTER(): appease stricter compilers
Some compilers (e.g. CHERI LLVM) warn when casting a non-intptr_t integer
type to a pointer. The GSIZE_TO_POINTER() macro thus triggers warnings
which can be silence by casting to guintptr before gpointer.

NB: This macro must not be used to create valid pointers from a integer.
2023-09-12 10:23:20 -07:00
Philip Withnall
8af4f494b1 Merge branch 'avoid-temporarily-oob-pointer' into 'main'
guniprop.c: Avoid creating (temporarily) out-of-bounds pointers

See merge request GNOME/glib!3576
2023-09-12 10:36:15 +00:00
Philip Withnall
0398518d5e Merge branch '3105-threaded-resolver-refs' into 'main'
gthreadedresolver: Fix race between source callbacks and finalize

Closes #3105

See merge request GNOME/glib!3575
2023-09-12 10:25:13 +00:00
Alex Richardson
ed6cc1ddb2 guniprop.c: Avoid creating (temporarily) out-of-bounds pointers
This is detected by UBSan on CHERI systems (e.g. Arm Morello) and could
result in non-derefenceable pointers when compiled without optimizations.
2023-09-11 22:50:05 -07:00
Philip Withnall
82c764ce2e gthreadedresolver: Fix race between source callbacks and finalize
I had thought that because `g_source_destroy()` was called for the two
sources (cancel and timeout) in the `GTask` finalize function for a
threaded resolver operation, that it would be fine to use a plain
pointer in the source callbacks to point to the `GTask`.

That turns out to not be true: because the source callbacks are executed
in the GLib worker thread, and the `GTask` can be finalized in another
thread, it’s possible for a source callback (e.g. `cancelled_cb()`) to
be scheduled in the worker thread, then for the `GTask` to be finalized,
and then the source callback to continue execution and find itself
doing a use-after-free.

Fix that by using a weak ref to the `GTask` in the source callbacks,
rather than a plain pointer.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: #3105
2023-09-11 16:02:15 +01:00
Matej Urbančič
cfab7d1d48 Update Slovenian translation 2023-09-11 13:47:39 +00:00
badcel
784b8f5cc9
Update GOptionContext annotations 2023-09-11 13:42:10 +02:00
badcel
7ae41b9427
Update GDir annotations 2023-09-11 13:38:26 +02:00
badcel
01b1570bb5
Update GAsyncQueue annotations 2023-09-11 13:38:03 +02:00
badcel
f5860b0f4a
Update annotations for GHmac 2023-09-11 13:31:39 +02:00
badcel
5546757b2f
Update GStringChunk annotations 2023-09-11 12:52:39 +02:00
badcel
bd7bd87c8e
Update GTimer annotations 2023-09-11 11:55:45 +02:00
badcel
47c7eda5e0
Update GRand annotations 2023-09-11 11:33:47 +02:00
Daniel Mustieles
a4a356e137 Updated Spanish translation 2023-09-11 10:16:42 +02:00
Jordi Mas i Hernandez
28e6e27acf Update Catalan translation 2023-09-11 06:51:39 +00:00
Philip Withnall
3c543ef69f
2.78.0
Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2023-09-08 14:42:18 +01:00
Ekaterine Papava
e1ea1c549a Update Georgian translation 2023-09-08 12:09:06 +00:00
Asier Sarasua Garmendia
69e2007f68 Update Basque translation 2023-09-07 15:32:54 +00:00
Luca Bacci
a76de5e039 gconstructor.h: Drop support for Visual C++ 2005
It's not supported anymore, remove dedicated code
2023-09-07 14:52:11 +02:00
Ekaterine Papava
d1660d06bd Update Georgian translation 2023-09-07 01:22:10 +00:00
Anders Jonsson
0cc4109dc8 Update Swedish translation 2023-09-06 23:09:36 +00:00
Michael Catanzaro
a366189062 Merge branch 'keyfile-invalid-escapes' into 'main'
gkeyfile: Temporarily re-allow invalid escapes when parsing strings

Closes #3095

See merge request GNOME/glib!3565
2023-09-06 14:02:58 +00:00
Philip Withnall
a2a5d91354 Merge branch 'fix-gutils-user-database' into 'main'
Fix gutils-user-database unit test

See merge request GNOME/glib!3564
2023-09-06 12:11:49 +00:00
Sebastian Wilhelmi
f7d930a58b Fix gutils-user-database unit test
The gutils-user-database.c is broken in two ways and currently doesn't test anything:

* It only overrides getpwuid, where the implementation used getpwnam_r if it exist, which should be every system for at least 20 years.
* It only partly cargo-culted setting the environment for the local and installed tests, but failed to actually set the environment for either.
2023-09-06 12:11:49 +00:00
Bruce Cowan
9e979ce749 Update British English translation
(cherry picked from commit 3cc56a0e8e)
2023-09-06 11:33:45 +00:00
Philip Withnall
4a96727642 gkeyfile: Temporarily re-allow invalid escapes when parsing strings
Before commit 71b7efd08a, `GKeyFile`
incorrectly allowed invalid escape sequences: it would treat the
sequence as a literal, set a `GError`, but not return failure from the
function. So if a caller was explicitly checking for returned `GError`s,
they could detect the invalid escape; but if they were just checking the
function’s return value, they’d miss it.

This is not correct use of `GError`, and the [Desktop Entry
Spec](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s04.html)
doesn’t allow for invalid escape sequences to be accepted. So it’s wrong
in both ways.

However, the commit above changed this behaviour without realising it,
quite close to the 2.78 stable release deadline. There are numerous key
files in the wild which use invalid escape sequences, and it’s too late
in the cycle to ‘break’ parsing of all of them.

So, for now, revert to the old behaviour for invalid escape sequences,
and give people another cycle to adapt to the changes. This will likely
mean they end up calling `g_key_file_get_value()` rather than
`g_key_file_get_string()`. See
https://gitlab.gnome.org/GNOME/glib/-/issues/3098 for tracking
re-enabling the error handling for invalid escape sequences.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: #3095
See: #3098
2023-09-06 12:08:56 +01:00
Andika Triwidada
efc74ca36c Update Indonesian translation 2023-09-06 06:35:00 +00:00
Changwoo Ryu
346196e6aa Update Korean translation 2023-09-06 04:17:39 +00:00
Balázs Úr
e2c37bd78b Update Hungarian translation 2023-09-05 18:35:27 +00:00
Michael Catanzaro
fcba22cfb9 Merge branch 'pr/fix_install_tags' into 'main'
meson: fix `gnetworking.h` install tag

See merge request GNOME/glib!3561
2023-09-04 12:58:59 +00:00
Philip Withnall
37309f165e Merge branch 'gdbplugin' into 'main'
gdb: Workaround optimized out quark_seq_id

See merge request GNOME/glib!3559
2023-09-04 11:29:57 +00:00