- 18 Aug, 2020 3 commits
-
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Sebastian Dröge authored
Backport !1620 “gvariant: Ensure GVS.depth is initialised” to glib-2-64 See merge request !1621
-
Philip Withnall authored
When byteswapping the depth was accidentally left uninitialised. Coverity CID: #1430636 Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
- 17 Aug, 2020 2 commits
-
-
Sebastian Dröge authored
Backport !1617 “Ensure g_subprocess_communicate_async() never blocks” to glib-2-64 See merge request !1618
-
It turns out that our async write operation implementation is broken on non-O_NONBLOCK pipes, because the default async write implementation calls write() after poll() said there were some space. However, the semantics of pipes is that unless O_NONBLOCK is set then the write *will* block if the passed in write count is larger than the available space. This caused a deadlock in #2182 due to the loop-back of the app stdout to the parent, but even without such a deadlock it is a problem that we may block the mainloop at all. In the particular case of g_subprocess_communicate() we have full control of the pipes after starting the app, so it is safe to enable O_NONBLOCK (i.e. we can ensure all the code using the fd after this can handle non-blocking mode). This fixes #2182
-
- 06 Aug, 2020 2 commits
-
-
Sebastian Dröge authored
Backport !1607 “meson: Don't use gnulib for printf on iOS” to glib-2-64 See merge request !1608
-
iOS and tvOS use the same printf family as macOS, and these all have been available on macOS for a long time. Closes #1868
-
- 06 Jul, 2020 2 commits
-
-
Emmanuele Bassi authored
Backport !1563 “gdesktopappinfo: Fix unnecessarily copied and leaked URI list” to glib-2-64 See merge request !1565
-
When an app is spawned using g_desktop_app_info_launch_uris_with_spawn it will expand the various token in the app's commandline with the URIs of the files to open. The expand_macro() function that is used for this advances the pointer to the URI list to show up to which entries it used. To not loose the pointer to the list head a duplicate of the URI list was actually passed to expand_macro(). However, it's not necessary to create a copy of the URI list for that as expand_macro() will only change which element the pointer will point to. This behaviour actually caused the duplicated list to be leaked as the the list pointer is NULL once all URIs are used up by expand_macro() and thus nothing was freed at the end of the function.
-
- 02 Jul, 2020 3 commits
-
-
Sebastian Dröge authored
Backport !1517 “GWin32RegistryKey: Move assertions” to glib-2-64 See merge request !1520
-
Sebastian Dröge authored
Backport !1468 “glib-compile-resources: Fix exporting on Visual Studio” to glib-2-64 See merge request !1519
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
- 25 Jun, 2020 1 commit
-
-
- 24 Jun, 2020 10 commits
-
-
Sebastian Dröge authored
Backport !1544 “Resolve "calling malloc in fork child is undefined-behaviour"” to glib-2-64 See merge request !1547
-
Philip Withnall authored
Allocate a working buffer before calling `fork()` to avoid calling `malloc()` in the async-signal-safe context between `fork()` and `exec()`, where it’s not safe to use. In this case, the buffer is used to assemble a wrapper around `argv` so it can be run under `/bin/sh`. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Fixes: #2140
-
Philip Withnall authored
Allocate a working buffer before calling `fork()` to avoid calling `malloc()` in the async-signal-safe context between `fork()` and `exec()`, where it’s not safe to use. In this case, the buffer is used to assemble elements from `PATH` with the binary from `argv[0]` to try executing them. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #2140
-
Philip Withnall authored
Query the environment before calling `fork()` so that it doesn’t have to be called in the async-signal-safe context between `fork()` and `exec()`. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #2140
-
Philip Withnall authored
They’re not safe to call in an async-signal-safe context on Linux. `sysconf()` is safe to call on FreeBSD and OpenBSD (at least), so continue doing that. This will reduce performance in the (already low performance) fallback case where `/proc` is inaccessible to a forked process on Linux, while spawning a subprocess. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #2140
-
Philip Withnall authored
Use the error handling infrastructure which already exists for other failures in the async-signal-safe context. `g_assert()` is unlikely to have caused problems in practice because it is only async-signal-unsafe when the assertion condition fails. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #2140
-
Philip Withnall authored
While `g_ascii_isdigit()` *is* currently async-signal-safe, it’s going to be hard to remember to keep it that way if the implementation changes in future. It seems more robust to just reimplement it here, given that it’s not much code. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #2140
-
Philip Withnall authored
Use normal `close()` instead, which is guaranteed to be async-signal-safe. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #2140
-
Philip Withnall authored
Functions called between `fork()` and `exec()` have to be async-signal-safe. Add a comment to each function which is called in that context, and `FIXME` comments to the non-async-signal-safe functions which end up being called as leaves of the call graph. The following commits will fix those `FIXME`s. See `man 7 signal-safety`. Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #2140
-
Philip Withnall authored
In almost all cases, rewording the documentation/comments made things more specific and a little clearer. Signed-off-by:
Philip Withnall <withnall@endlessm.com> See: !1544 (comment 846645)
-
- 22 Jun, 2020 1 commit
-
-
Matej Urbančič authored
-
- 09 Jun, 2020 1 commit
-
-
Nirbheek Chauhan authored
Backport !1522 “meson: Fix gnulib printf checks” to glib-2-64 See merge request !1523
-
- 08 Jun, 2020 1 commit
-
-
Some typos, and accidental usage of the strings `'true'` / `'false'` instead of the booleans `true` / `false`.
-
- 05 Jun, 2020 2 commits
-
-
While these assertions look right at the first glance, they actually crash the program. That's because GObject insists on initializing all construct-only properties to their default values, which results in g_win32_registry_key_set_property() being called multiple times with NULL string, once for each unset property. If "path" is actually set by the caller, a subsequent call to set "path-utf16" to NULL will fail an assertion, since absolute_path is already non-NULL. With assertions moved the set-to-NULL calls bail out before an assertion is made.
-
Have the generated .c code decorate the prototypes with "G_MODULE_EXPORT" instead of "extern" when --internal is not being used, so that we also export the symbols from the generated code on Visual Studio-style compilers. If --internal is used, we decorate the prototypes with "G_GNUC_INTERNAL", as we did before. Note that since the generated .c code does not attempt to include the generated headers (if one is also generated), the gnerated headers are still generated as they were before.
-
- 22 May, 2020 2 commits
-
-
Sebastian Dröge authored
Backport !1504 “win32 gpoll: Fix wait for at least one thread to return” to glib-2-64 See merge request !1507
-
When timeout grater than 0 in g_poll function, the WaitForMultipleObjects call will wait for all the threads to return, but when only one thread got an event the others will sleep until the timeout elapses, and causes a stall. Triggering the stop event in g_poll in this case is useless as it is triggered when all the threads where already signaled or timed-out. Closes: #2107
-
- 20 May, 2020 1 commit
-
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
- 19 May, 2020 4 commits
-
-
Philip Withnall authored
Backport !1493 “meson: Remove stray ], in O_DIRECTORY check” to glib-2-64 See merge request !1495
-
A stray ], was leftover from the autotools -> meson conversion. Remove it. Signed-off-by:
Chris Packham <chris.packham@alliedtelesis.co.nz>
-
Sebastian Dröge authored
Backport !1439 “Fix stpcpy() detection“ to glib-2-64 See merge request !1501
-
See https://github.com/mesonbuild/meson/issues/3672 and https://github.com/mesonbuild/meson/issues/5628 for explanations of cases where meson misdetects functions due to clang builtins (that always are available, regardless of whether the platform actually provides them). The same also happens on GCC 10, which added support for __has_builtin.
-
- 17 May, 2020 3 commits
-
-
- 14 May, 2020 2 commits
-
-
Emmanuele Bassi authored
Backport !1440 -Wformat-nonliteral fixes to glib-2-64 See merge request !1470
-
Emmanuele Bassi authored
Backport !1448 memory monitor test dependency fixes to glib-2-64 See merge request !1471
-