1
0
mirror of https://gitlab.gnome.org/GNOME/glib.git synced 2026-10-24 00:49:00 +03:00

33437 Commits

Author SHA1 Message Date
Philip Withnall
e05063ccc6 2.90.1
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2.90.1
2026-10-06 16:22:44 +01:00
Philip Withnall
094f8ed5f8 Merge branch 'wip/3v1n0/ci-sanitizer-tests' into 'main'
CI: Add address (asan) and thread sanitizer (tsan) jobs

Closes #3356

See merge request GNOME/glib!4062
2026-10-06 15:14:53 +00:00
Emmanuele Bassi
a117eb8fe2 Merge branch 'supp-tls-testutils-logging' into 'main'
glib.supp: Mark a TLS variable as not really a leak

See merge request GNOME/glib!5389
2026-10-06 16:05:43 +01:00
Marco Trevisan (Treviño)
997154cecc glib-private: Fix an implicit conversion 64-to-32 warning in clang
../glib/glib-private.h:112:10: warning: implicit conversion loses
  integer precision: 'long' to 'gboolean' (aka 'int')
  [-Wshorten-64-to-32]
  112 |   return G_UNLIKELY (__lsan_enable != NULL && __lsan_ignore_object != NULL);
      |   ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ../glib/gmacros.h:1285:27: note: expanded from macro 'G_UNLIKELY'
  1285 | #define G_UNLIKELY(expr) (__builtin_expect ((long) (_G_BOOLEAN_EXPR(expr)), 0))
       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2026-10-06 16:03:33 +01:00
Marco Trevisan (Treviño)
6e6d9e40d1 ci: Ensure we always upload the junit files for unstable tests too
So we can track what is still failing and what not
2026-10-06 16:03:33 +01:00
Marco Trevisan (Treviño)
a25e908f23 ci: Add a thread sanitizer scheduled job
Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/3356
2026-10-06 16:03:33 +01:00
Michael Catanzaro
0c9e428d8e Merge branch 'socket-address-null-array' into 'main'
tests: Avoid a ubsan warning about passing NULL to strncmp()

See merge request GNOME/glib!5388
2026-10-06 09:55:32 -05:00
Philip Withnall
ec84e18b27 glib.supp: Mark a TLS variable as not really a leak
This is like commit 49e512494f but for
valgrind and not LSAN.

It’s allocated once for the lifetime of each thread, so isn’t really a
leak.

This fixes valgrind reports as in
https://gitlab.gnome.org/GNOME/glib/-/jobs/7120333.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-10-06 12:43:44 +01:00
Philip Withnall
d60cd821b7 tests: Avoid a ubsan warning about passing NULL to strncmp()
The array data can be `NULL` if its length is zero.

This fixes the following CI failure:
```
322/425 glib:gio / socket-address                                              ERROR            0.08s   killed by signal 6 SIGABRT
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――
stderr:
../gio/tests/socket-address.c:201:19: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:160:33: note: nonnull attribute specified here
    #0 0x000000431715  (/builds/GNOME/glib/_build/gio/tests/socket-address+0x431715) (BuildId: 7c5e418267aa2008af8e77f4d04c31913e26aad7)
    #1 0x7fdabec8c862  (/builds/GNOME/glib/_build/glib/libglib-2.0.so.0+0x28c862) (BuildId: 12f0fded04a8c0437c073a267547f1cb487b1b1d)
    #2 0x7fdabec7e1b2  (/builds/GNOME/glib/_build/glib/libglib-2.0.so.0+0x27e1b2) (BuildId: 12f0fded04a8c0437c073a267547f1cb487b1b1d)
    #3 0x7fdabec7e533  (/builds/GNOME/glib/_build/glib/libglib-2.0.so.0+0x27e533) (BuildId: 12f0fded04a8c0437c073a267547f1cb487b1b1d)
    #4 0x7fdabec7e533  (/builds/GNOME/glib/_build/glib/libglib-2.0.so.0+0x27e533) (BuildId: 12f0fded04a8c0437c073a267547f1cb487b1b1d)
    #5 0x7fdabec7e533  (/builds/GNOME/glib/_build/glib/libglib-2.0.so.0+0x27e533) (BuildId: 12f0fded04a8c0437c073a267547f1cb487b1b1d)
    #6 0x7fdabec7bc89  (/builds/GNOME/glib/_build/glib/libglib-2.0.so.0+0x27bc89) (BuildId: 12f0fded04a8c0437c073a267547f1cb487b1b1d)
    #7 0x7fdabec7b785  (/builds/GNOME/glib/_build/glib/libglib-2.0.so.0+0x27b785) (BuildId: 12f0fded04a8c0437c073a267547f1cb487b1b1d)
    #8 0x00000042de31  (/builds/GNOME/glib/_build/gio/tests/socket-address+0x42de31) (BuildId: 7c5e418267aa2008af8e77f4d04c31913e26aad7)
    #9 0x7fdabd810447  (/lib64/libc.so.6+0x3447) (BuildId: dae6ae6929d69dca842288f5300af5a33d1bdcd7)
    #10 0x7fdabd81050a  (/lib64/libc.so.6+0x350a) (BuildId: dae6ae6929d69dca842288f5300af5a33d1bdcd7)
    #11 0x0000004015a4  (/builds/GNOME/glib/_build/gio/tests/socket-address+0x4015a4) (BuildId: 7c5e418267aa2008af8e77f4d04c31913e26aad7)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../gio/tests/socket-address.c:201:19
```

https://gitlab.gnome.org/GNOME/glib/-/jobs/7120334

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-10-06 12:35:19 +01:00
Philip Withnall
6f873bc0e6 Merge branch 'update-translation-nn-from-main-38bddd30-b9fe-11f1-bfd2-0a580a8205d0' into 'main'
Update Norwegian Nynorsk translation

See merge request GNOME/glib!5382
2026-10-06 10:30:41 +00:00
Philip Withnall
54180074ae Merge branch 'update-translation-nb-from-main-842fd77a-c154-11f1-be74-0a580a80004e' into 'main'
Update Norwegian Bokmål translation

See merge request GNOME/glib!5387
2026-10-06 10:30:06 +00:00
Kjartan Maraas
f6611fb576 Update Norwegian Bokmål translation 2026-10-06 07:07:19 +00:00
Roy-Magne Mo
b82223d867 Update Norwegian Nynorsk translation 2026-09-26 23:01:54 +00:00
Philip Withnall
36c60f069c Merge branch 'update-translation-de-from-main-a04d0baa-b8ec-11f1-868e-0a580a830423' into 'main'
Update German translation

See merge request GNOME/glib!5380
2026-09-26 16:30:08 +00:00
Christian Kirbach
36fa7efc97 Update German translation 2026-09-25 14:23:31 +00:00
Philip Withnall
404a67944c Merge branch 'RHEL-216314' into 'main'
Clarify various inconsistencies with g_socket_address_new_from_native()

See merge request GNOME/glib!5376
2026-09-24 17:44:06 +00:00
Philip Withnall
a91f19bb85 Merge branch 'RHEL-217141' into 'main'
fileutils: Check the mode before creating the file

See merge request GNOME/glib!5375
2026-09-24 17:44:03 +00:00
Benjamin Otte
7bc0696d48 socketaddress: Add check for new_from_native(x, TOO_BIG)
Test that if there are too many bytes passed in, the extra bytes
are ignored.
2026-09-24 13:08:52 +00:00
Benjamin Otte
2b6997df6b socketaddress: Add a sanity check for clarity
G_STRUCT_OFFSET (struct sockaddr_un, sun_path) == sizeof (struct sockaddr)
should hold, and therefor the compiler should optimize it away, but it's
not required. So be clear and add it.
2026-09-24 13:08:52 +00:00
Benjamin Otte
026c263a53 socketaddress: Ensure correct behavior for embedded nul
If g_socket_address_new_from_native (addr, sizeof (sockaddr_un)) gets
called, the size of the path will be UNIX_PATH_MAX even if it is
a null-terminated string.

Ensure that we return UNIX_PATH_MAX - 1 (because we force null
ternmination) as the path length in this case.
2026-09-24 13:08:52 +00:00
Benjamin Otte
82378dc348 socketaddress: Ensure non-nul-terminated paths work properly
When passing a filename of length UNIX_PATH_MAX via sockaddr_un it will
not be null-terminated. This will cause g_unix_socket_address_new() to
fail as it expects a null-terminated string.

Use g_unix_socket_address_new_with_type() instead as it allows passing a
length.

Testcase included.
2026-09-24 13:08:52 +00:00
Benjamin Otte
3f0ec7af7c unixsocketaddress: Allow full lengths for path addresses
Allow addresses of type G_UNIX_SOCKET_ADDRESS_PATH to be UNIX_PATH_MAX
characters long.

Previously they could only be UNIX_PATH_MAX - 1 characters long which
lead to an inconsistency with the UNIX APIs.

There is no implementation reason for this but correctness, where I
feared that AI exploit finders might find an exploit for this and wanted
to get ahead.

Testcase adapted for this usecase.
2026-09-24 13:08:52 +00:00
Benjamin Otte
5e55178fec unixsocketaddress: Ensure path length gets constructed properly
Ensure that no matter which way an address gets constructed, the path
length has the expected value.

Extensive testcase included.
2026-09-24 13:08:52 +00:00
Benjamin Otte
62976c4354 fileutils: Check the mode before creating the file
... so we don't create a file with elevated permissions if not
necessary.

This avoids a potential race where a temporary file is created with
higher priviliges than the result, which is technically a data leak.

Fixes: 45a36e52b5
2026-09-24 12:57:14 +00:00
Emmanuele Bassi
af4e32bc7e Merge branch 'file-enumerator-docs' into 'main'
gfileenumerator: Reformat docs to fully use gi-docgen and match style guide

See merge request GNOME/glib!5374
2026-09-23 14:15:47 +01:00
Philip Withnall
4335e15da8 gfileenumerator: Reformat docs to fully use gi-docgen and match style guide
https://developer.gnome.org/documentation/guidelines/devel-docs.html#writing-api-references

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Helps: #3250
2026-09-22 18:38:48 +01:00
Philip Withnall
5a124d1e66 Merge branch '4060-standard-name' into 'main'
glocalfile: Request standard::name when enumerating files

Closes #4060

See merge request GNOME/glib!5372
2026-09-22 16:45:48 +00:00
Emmanuele Bassi
8e455a2eef Merge branch 'supp-trace-malloc' into 'main'
tools: Add another variant of an existing suppression to glib.supp

See merge request GNOME/glib!5306
2026-09-22 17:38:25 +01:00
Emmanuele Bassi
2f48b5cd94 Merge branch 'regex-docs' into 'main'
gregex: Fix some trivial typos in the docs

See merge request GNOME/glib!5373
2026-09-22 17:35:17 +01:00
Philip Withnall
f8ff3d0261 Merge branch 'fix-gcharsetconverter-invalid-iconv' into 'main'
gcharsetconverter: Avoid closing invalid iconv descriptors

See merge request GNOME/glib!5370
2026-09-22 15:20:36 +00:00
Philip Withnall
ce0433dd99 gregex: Fix some trivial typos in the docs
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-09-22 15:11:52 +01:00
Philip Withnall
0761f49fa1 gfileenumerator: Document STANDARD_NAME requirement for iterate()
It requires a `standard::name` to be available in order to be able to
iterate.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-09-22 15:02:11 +01:00
Philip Withnall
a354c7895b Merge branch 'fix-inotify-shared-wd-4055' into 'main'
inotify: don't remove shared kernel watch while still in use

Closes #4055

See merge request GNOME/glib!5369
2026-09-22 13:50:54 +00:00
Philip Withnall
6f6b740f87 gio-tool-list: Request standard::name when enumerating files
As required by the docs for `g_file_enumerate_children()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2026-09-22 12:05:43 +01:00
Philip Withnall
45d79ce5a9 glocalfile: Request standard::name when enumerating files
As required by the docs for `g_file_enumerate_children()`.

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

Fixes: #4060
2026-09-22 12:04:04 +01:00
Petr Sumbera
2537c015ce gcharsetconverter: Avoid closing invalid iconv descriptors
g_iconv_open() returns (GIConv) -1 on failure, but finalization
treated that sentinel as a valid descriptor. This can crash native iconv
implementations which do not tolerate it, including Solaris.

Preserve NULL as the not-initialized state, skip both invalid descriptor
values during finalization, and add coverage for unsupported charsets and
initialization which fails before opening a converter.
2026-09-22 09:24:01 +00:00
Philip Withnall
4c6109f974 Merge branch 'update-translation-nn-from-main-feb5023c-b46a-11f1-9424-0a580a82020e' into 'main'
Update Norwegian Nynorsk translation

See merge request GNOME/glib!5368
2026-09-21 20:59:59 +00:00
Kashyap Ekbote
3457cf6642 inotify: don't remove shared kernel watch while still in use
inotify watches are keyed by inode, so watching a directory (or file)
through two different paths that resolve to the same inode - e.g. a real
path and a symlink alias - returns the same watch descriptor (wd). The
backend already tracks this by keeping a GList of watched dirs/files per
wd.

However, when a monitor was cancelled, _ip_stop_watching() (and likewise
ip_watched_file_stop()) called _ik_ignore() -> inotify_rm_watch() as soon
as that particular path had no subscribers, without checking whether any
other path still shared the same wd. This tore down the single kernel
watch out from under the still-active monitors on the other path: they
kept reporting g_file_monitor_is_cancelled() == FALSE but silently
stopped receiving events.

Only remove the kernel watch once no other watched directory/file still
references the wd, by removing our own entry from the wd hash first and
issuing _ik_ignore() only when the list has become empty.

Add a regression test covering cancellation of a directory monitor
established through a symlink alias.

Fixes: https://gitlab.gnome.org/GNOME/glib/-/issues/4055
2026-09-20 10:02:36 +05:30
Roy-Magne Mo
c694683c9a Update Norwegian Nynorsk translation 2026-09-19 20:45:34 +00:00
Philip Withnall
b6d9457b45 Merge branch 'update-translation-nn-from-main-50ec631a-b1a5-11f1-961f-0a580a82055a' into 'main'
Update Norwegian Nynorsk translation

See merge request GNOME/glib!5364
2026-09-16 10:45:13 +00:00
Roy-Magne Mo
e47bd7d24a Update Norwegian Nynorsk translation 2026-09-16 08:05:18 +00:00
Matthias Clasen
9066cbfcd7 Merge branch 'RHEL-216604' into 'main'
unicode: Don't read past limits

See merge request GNOME/glib!5360
2026-09-15 16:53:22 +00:00
Matthias Clasen
c77f1f36d2 unicode: Add overflow precondition checks for str + len
g_utf8_strup(), g_utf8_strdown() and g_utf8_casefold() compute
str + len when len is non-negative, which could overflow if str
is near the end of the address space. Add g_return_val_if_fail
checks to prevent this.

Related: RHEL-216604
2026-09-15 12:11:14 -04:00
Matthias Clasen
b33d4a8124 unicode: Fix test_strupdown_length for Windows
On Windows, setlocale() alone is not sufficient for GLib to detect
locale-specific casing rules — SetThreadLocale() is also needed.
Add SetThreadLocale() calls for Turkish and Lithuanian locales,
matching the pattern used in test_turkish_strupdown.

Also drop the .UTF-8 suffix from locale names, since it is not
available on Windows.
2026-09-15 12:11:14 -04:00
Matthias Clasen
25600674c0 unicode: Don't read past limits
g_utf8_strdup and g_utf8_strdown take a len argument, but they
can be tricked into reading past that limit, e.g. when doing
lookahead for a combining dot, or when the text section before
the limit ends with a greek iota below (U+0345). Prevent this
by passing the limit to the helper functions that are used
in these cases (append_mark and has_more_above).

Tests included. The tests were produced and validated with
the help of AI.

Related: RHEL-216604
2026-09-15 12:10:30 -04:00
Philip Withnall
2d8677395f Merge branch 'RHEL-216132' into 'main'
unicode: Prevent overflow in normalization

See merge request GNOME/glib!5361
2026-09-15 14:52:38 +00:00
Philip Withnall
ffc2362f31 Merge branch 'RHEL-221493' into 'main'
gmarkup: Be careful in error paths

See merge request GNOME/glib!5362
2026-09-15 14:49:25 +00:00
Philip Withnall
4699315caa Merge branch 'RHEL-215289' into 'main'
gresource: Avoid underflow

See merge request GNOME/glib!5363
2026-09-15 14:49:00 +00:00
Philip Withnall
5ea82815ce Merge branch 'RHEL-214768' into 'main'
unicode: Fix error handling in normalization

See merge request GNOME/glib!5359
2026-09-15 13:41:38 +00:00
Philip Withnall
12d14eed31 Merge branch 'wip/lantw/ci-Replace-FreeBSD-13-with-FreeBSD-14' into 'main'
ci: Replace FreeBSD 13 with FreeBSD 14

See merge request GNOME/glib!5358
2026-09-15 07:20:38 +00:00