- 24 Jul, 2020 1 commit
-
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <withnall@endlessm.com> Helps: #422
-
- 08 Jul, 2020 2 commits
-
-
Sergio Gelato authored
Correct an off-by-one error in hex_unescape_string()'s computation of the output string length. (Turned into a git-format patch by Philip Withnall. Original patch submitted on the Debian bug tracker, bug#962912.)
-
Sergio Gelato authored
It's safe to assume an escaped string doesn't contain embedded null bytes, but raw memory buffers (as returned by getxattr()) require more care. If the length of the data to be escaped is known, use that knowledge instead of invoking strlen(). (Turned into a git-format patch by Philip Withnall. One minor formatting tweak. Original patch submitted on the Debian bug tracker, bug#962912.) Fixes: #422
-
- 07 Jul, 2020 8 commits
-
-
Philip Withnall authored
tests: limit number of threads to something reasonable. See merge request !1564
-
Harald van Dijk authored
Creating 1000 threads with the default stack size of 8 MiB will fail on architectures with a 32-bit address space. Move up the existing THREADS macro and use that instead, but change its definition to 1000 if pointers are larger than 32 bits. Signed-off-by:
Harald van Dijk <harald@gigawatt.nl>
-
Philip Withnall authored
Add initial sysprof support See merge request !1551
-
Philip Withnall authored
And improve them externally, where not otherwise set, by setting them from the function name passed to `g_task_set_source_tag()`, if called by third party code. This should make profiling and debug output from GLib more useful. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
Use this to replace the much-hated `g_debug()` which told people that `posix_spawn()` (the fast path) wasn’t being used for various reasons. If people want to make their process spawning faster now, they’ll have to use a profiling tool like sysprof to check their program’s performance. Shocking. I think I was wrong to put this `g_debug()` in there in the first place — it hasn’t served its purpose of making people speed up their spawn paths to use `posix_spawn()`, it’s only cluttered up logs and frustrated people. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
`complete_in_idle_cb()` shows up in a lot of sysprof traces, so it’s quite useful to include the most specific contextual information we can in it. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
This allows you to see how long each `GMainContext` iteration and each `GSource` `check`/`prepare`/`dispatch` takes. It provides more detail than sysprof’s speedtrack plugin can provide, since it has access to more internal GLib data. Use it with `sysprof-cli`, for example: ``` sysprof-cli --use-trace-fd -- my-test-program ``` Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
Add some internal wrappers around sysprof tracing, so that it can be used throughout GLib without exposing all the details of sysprof internally. This adds an optional dependency on `libsysprof-capture-4`. sysprof support is disabled without it. This depends on the GLib dependency of `libsysprof-capture` being dropped in sysprof!30, which has bumped the soname of `libsysprof-capture` and added subproject support. The next few commits will add marks that trace out each `GMainContext` iteration and each `GSource` `check`/`prepare`/`dispatch` call. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
- 05 Jul, 2020 1 commit
-
-
Nirbheek Chauhan authored
gdesktopappinfo: Fix unnecessarily copied and leaked URI list See merge request !1563
-
- 04 Jul, 2020 1 commit
-
-
Felix Riemann authored
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.
-
- 03 Jul, 2020 2 commits
-
-
Philip Withnall authored
gconvert: Use a pointer array in extract_uris See merge request !1561
-
Peter Bloomfield authored
Use a GPtrArray instead of a GSList in g_uri_list_extract_uris().
-
- 02 Jul, 2020 1 commit
-
-
Florentina Mușat authored
-
- 01 Jul, 2020 9 commits
-
-
Sebastian Dröge authored
Fix buffer read overflows in GUri See merge request !1559
-
Philip Withnall authored
There is a limited (1 or 2 byte) read off the end of the buffer if its final or penultimate byte is `%` and it’s not nul-terminated after that. If the buffer *is* nul-terminated then the first `g_ascii_isxdigit()` call safely returns `FALSE` and the code moves on. Fix it by adding an additional check, and some unit tests to catch the behaviour. This bug is present in libsoup, which `GUri` is based on, but not exploitable due to how the external API only exposes nul-terminated strings. See libsoup!126 for the fix there. oss-fuzz#23815 oss-fuzz#23818 Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
They have different `%`-encoding behaviour, and probably both deserve to be tested. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
Modify the existing test function to run each test twice: once nul-terminated and once with a length specified. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
This introduces no functional changes, but will make it easier to add more tests in future. It splits the unescaping tests out so the different types of unescaping (string, bytes, segment) are tested separately, since they have different limitations. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
Modify the existing test function to run each test twice: once nul-terminated and once with a length specified. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
This introduces no functional changes, but will make it easier to add more tests in future. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
Remove c-format from the string that is not c-formatted See merge request !1555
-
- 30 Jun, 2020 4 commits
-
-
Philip Withnall authored
fuzzing: Another fix for g_uri_parse() test See merge request !1556
-
Philip Withnall authored
This should test a few more code paths. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Philip Withnall authored
This fixes commit b2a6a9a4. Doh. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Daniel Mustieles García authored
-
- 29 Jun, 2020 7 commits
-
-
Daniel Mustieles García authored
-
Yuri Chornoivan authored
-
Yuri Chornoivan authored
-
Sebastian Dröge authored
GUri build fixes See merge request !1554
-
Philip Withnall authored
The fuzzer will produce arbitrary binary blobs, which might not be nul-terminated. `g_uri_parse()` has no length argument, so relies on receiving a nul-terminated string as input. Guarantee that. This should fix fuzzing build failures like https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=23750. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
Piotr Drąg authored
-
Philip Withnall authored
It seems that `sig_atomic_t` is not the same width as `int` on FreeBSD, which is causing CI failures: ``` ../glib/gmain.c:5206:3: error: '_GStaticAssertCompileTimeAssertion_73' declared as an array with a negative size g_atomic_int_set (&any_unix_signal_pending, 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../glib/gatomic.h:100:5: note: expanded from macro 'g_atomic_int_set' G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gint)); \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Fix that by only using `sig_atomic_t` if the code is *not* using atomic primitives (i.e. in the fallback case). `sig_atomic_t` is only a typedef around an integer type and is not magic. Its typedef is chosen by the platform to be async-signal-safe (i.e. read or written in one instruction), but not necessarily thread-safe. Signed-off-by:
Philip Withnall <withnall@endlessm.com>
-
- 28 Jun, 2020 1 commit
-
-
Aurimas Černius authored
-
- 25 Jun, 2020 3 commits
-
-
Yuri Chornoivan authored
-
Daniel Șerbănescu authored
-
Philip Withnall authored
tests: Fix intermittent failure in GCancellableSource test Closes #1764 See merge request !1539
-