Commit Graph

21286 Commits

Author SHA1 Message Date
Philip Withnall
c8c75dc7ad glib.supp: Fix some indentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
adb9264d12 glib.supp: Add leak types
Mark all the memcheck leaks as ‘reachable’, so the suppressions will not
apply if that memory is no longer reachable on exit(). This feature was
introduced in Valgrind 3.9, and is documented here:

http://valgrind.org/docs/manual/mc-manual.html#mc-manual.suppfiles

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
a6ecfeea4c tests: Don’t run Python tests under Valgrind
The Python runtime is not amenable to Valgrind, and leak checking is a
lot less relevant in Python compared to C.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #487
2019-09-02 14:16:33 +01:00
Philip Withnall
0cc745f6cb ci: Include stderr output in JUnit XML report
When running tests under valgrind, the valgrind summary is printed in
stderr, and the TAP output is printed in stdout. The valgrind summary is
useful to include in the GitLab test report, so append it to the
textual failure information for failed tests.

I can’t find a better XML element in the [JUnit
schema](https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd)
for representing it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #487
2019-09-02 14:16:33 +01:00
Philip Withnall
197eff3fc8 ci: Add valgrind memcheck support on Fedora
Add a separate CI job which runs memcheck on the unit tests. This is
done as a separate job from the main build, since we don’t want it to
interact with code coverage at all.

Currently, failure of this job is ignored. Issue #333 will eventually
fix that.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #487
2019-09-02 14:16:33 +01:00
Philip Withnall
8d19b95bd8 ci: Add valgrind to fedora Docker image
It will be used in an upcoming commit.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #487
2019-09-02 14:16:33 +01:00
Philip Withnall
e8ea2aebe7 gerror: Add a docs paragraph about not displaying errors verbatim in UI
It’s confusing and often doesn’t help the user. Match the error code and
come up with a more UI-appropriate error message.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
cf990faae5 2.61.3
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 13:58:31 +01:00
Philip Withnall
2118a8f73b tests: Fix skipping mkdir-with-parents-permission test
If the user has `CAP_DAC_OVERRIDE` or similar (for example, if running
the tests as root), the `mkdir-with-parents-permission` test is skipped.

The check for `CAP_DAC_OVERRIDE` was by creating a subdirectory of the
test directory. That subdirectory, however, was never removed, which
caused a ‘directory not empty’ error when trying to delete the test
directory.

Fix that by correctly deleting the subdirectory if skipping the test.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 13:35:44 +01:00
Emmanuele Bassi
4a089f9227 Merge branch 'ossfuzz-16101-iso8601-parsing' into 'master'
Improve ISO 8601 parsing by GDateTime

See merge request GNOME/glib!1017
2019-09-02 11:19:04 +00:00
Emmanuele Bassi
a0cbb32680 Merge branch '1309-delayed-settings-changed' into 'master'
gsettings: Add missing changed() call to delayed settings backend

Closes #1309

See merge request GNOME/glib!1046
2019-09-02 11:14:59 +00:00
Philip Withnall
b3b6830d9a Merge branch 'wip/lantw/gthread-set-thread-name-on-bsd' into 'master'
gthread: Set thread name on *BSD

Closes #1761

See merge request GNOME/glib!1072
2019-09-02 11:10:16 +00:00
Will Thompson
9b827e5674 gdbus-codegen: process C.UnixFD annotation in one place
This will make it simpler to enable this behaviour based on the method
signature.

https://gitlab.gnome.org/GNOME/glib/issues/1726
2019-09-02 06:54:37 +01:00
Marek Černocký
eca386cc97 Updated Czech translation 2019-09-02 02:49:46 +02:00
Aurimas Černius
7b26d427b0 Updated Lithuanian translation 2019-09-01 22:33:58 +03:00
Changwoo Ryu
199bb530c0 Update Korean translation 2019-09-01 09:00:32 +00:00
Balázs Úr
ffef6cf413 Update Hungarian translation 2019-09-01 05:39:54 +00:00
Philip Withnall
201c9deacf Merge branch 'patch-1' into 'master'
Adjust README formatting

See merge request GNOME/glib!1074
2019-08-30 07:16:26 +00:00
Philip Withnall
9c8c1c44eb Merge branch 'gtype-leak-suppression' into 'master'
glib.supp: add suppression for g_type_class_ref()

See merge request GNOME/glib!1075
2019-08-30 06:55:39 +00:00
Philip Withnall
202c07e904 Merge branch 'goption_add_sanity_checks_to_inputs' into 'master'
goption: add sanity check to input parameters

Closes #1057

See merge request GNOME/glib!1073
2019-08-30 06:50:45 +00:00
Claudio Saavedra
6e4a02b9bc glib.supp: add suppression for g_type_class_ref()
This suppression is not caught by glib.supp, so add it:

==21145== 32 bytes in 1 blocks are possibly lost in loss record 1,456 of 2,584
==21145==    at 0x4837B65: calloc (vg_replace_malloc.c:762)
==21145==    by 0x495825E: g_malloc0 (gmem.c:129)
==21145==    by 0x4A6B6EB: type_class_init_Wm (gtype.c:2134)
==21145==    by 0x4A6D22A: g_type_class_ref (gtype.c:2950)
==21145==    by 0x4A6D1DD: g_type_class_ref (gtype.c:2942)
==21145==    by 0x4A5C9C6: g_param_spec_enum (gparamspecs.c:2085)
2019-08-30 09:27:31 +03:00
Roger
13c115e608 adjust formatting 2019-08-30 04:58:28 +00:00
Aurélien Zanelli
f178d1bc27 goption: add sanity check to input parameters
To avoid dereferencing bad pointers.

Closes issue #1057
2019-08-30 01:07:58 +02:00
Nirbheek Chauhan
9456cec53e Merge branch 'wip/lantw/meson-move-libdl_dep-to-the-top-level' into 'master'
meson: Move libdl_dep to the top level

See merge request GNOME/glib!1071
2019-08-29 18:45:36 +00:00
Ting-Wei Lan
f489b6f922 gthread: Set thread name on *BSD
Add support for setting thread name on FreeBSD, DragonFlyBSD, OpenBSD,
and NetBSD.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1761
2019-08-30 01:29:04 +08:00
Ting-Wei Lan
fe3c16608a meson: Move libdl_dep to the top level
Instead of letting each directory to find its way to link with libdl,
it is easier to put the check in the top level, so its result can be
used by all directories.

It is a follow-up of https://gitlab.gnome.org/GNOME/glib/merge_requests/810.
2019-08-29 23:25:40 +08:00
Philip Withnall
db66bc7944 Merge branch 'bugfix/install-gnativesocketaddress' into 'master'
Install header files for GNativeSocketAddress and bump version requirement.

Closes #1854

See merge request GNOME/glib!1022
2019-08-29 13:05:27 +00:00
Mihai Moldovan
bd4c16b356 gio: actually install and reference gnativesocketaddress.h.
The header file was installed when building using autotools, but was
inadvertently omitted in the meson targets.

Luckily, ABI is not impacted, since gnativesocketaddress.c was always
compiled and linked into libgio.

Fixes: #1854
2019-08-29 14:32:55 +02:00
Mihai Moldovan
5e18888a94 gio: Housekeeping: sync up and sort gio_{sources,headers} lists 2019-08-29 14:32:55 +02:00
Philip Withnall
ca60cd3314 tutorial: Add private members to example code in tutorial
Add the private members referred to in the property setting/getting
example, and a finalize function for them, to make the tutorial code
more self-contained.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1858
2019-08-29 09:20:01 +01:00
Philip Withnall
22b59c91ad tutorial: Stop referring to ->priv for example class
The class has used `G_DECLARE_FINAL_TYPE` for a while now, so doesn’t
have a `priv` struct. Private members are declared inline.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1858
2019-08-29 09:19:03 +01:00
Philip Withnall
61912bffb5 tutorial: Improve type safety of property usage in GObject tutorial
This means that if you compile with `-Wswitch-enum`, the compiler will
warn you about properties which you’ve forgotten to handle in
`set_property()` or `get_property()`.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1858
2019-08-29 09:12:18 +01:00
Philip Withnall
fea016399c Merge branch 'fix_documentation' into 'master'
gsubprocesslauncher.c: fix documentation

See merge request GNOME/glib!1068
2019-08-29 07:18:40 +00:00
Sergio Costas
09e094a676 gsubprocesslauncher.c: fix documentation
The gobject introspection comments have a reference to an incorrect
class: they have, as 'self', the GSubprocess class instead of
GSubprocessLauncher.

This patch fixes this.
2019-08-29 00:15:03 +02:00
Philip Withnall
bae51732d1 Merge branch 'update-libffi-wrap-location' into 'master'
libffi.wrap: Meson port has moved to FDO gitlab

See merge request GNOME/glib!1066
2019-08-28 08:41:34 +00:00
Matthew Waters
6971528f65 gmacros: mark functions generated by autoptr macros as unused
clang will warn with -Wunused-function if the g_autoptr macros are
ever used inside a .c file.  This would break a lot of -Werror builds
with clang.

Mark such functions as explicitly unsed so clang will not warn about
them.
2019-08-28 18:08:29 +10:00
Matthew Waters
90f93a64f2 gtype: mark the inline functions in G_DECLARE_*_TYPE() as UNUSED
clang will warn about static inline functions where gcc will not.  Fixes
-Werror=unused-function with clang in dependant projects.
2019-08-28 18:08:29 +10:00
Nirbheek Chauhan
e0e4968dca Merge branch 'allow_NULL_argument_to_parse_strv' into 'master'
GOption: Allow NULL arguments to parse_strv

Closes #873

See merge request GNOME/glib!1064
2019-08-27 13:17:39 +00:00
Christian Persch
9d513beeca GOption: Allow NULL arguments to parse_strv
Close issue #873
2019-08-27 14:44:29 +02:00
Nirbheek Chauhan
a521fbddfe libffi.wrap: Meson port has moved to FDO gitlab 2019-08-27 18:13:11 +05:30
Philip Withnall
68b4dfd430 Merge branch 'gsettingsbackend-thread-safe-watches' into 'master'
GSettingsBackend - Fix thread-safety during destruction of GSettings instances...

Closes #1870

See merge request GNOME/glib!1040
2019-08-27 09:35:21 +00:00
Nirbheek Chauhan
7092b11bf4 Merge branch 'upate-win32-readme' into 'master'
Update win32 readme, add myself to codeowners

See merge request GNOME/glib!1059
2019-08-27 08:49:00 +00:00
Sebastian Dröge
d3ae4b1d30 GSettingsBackend - Fix thread-safety during destruction of GSettings instances while notifications are emitted
g_settings_backend_watch() uses a weak notify for keeping track of
the target. There's an explanation why this is supposed to be safe but
that explanation is wrong.

The following could happen before:

1. We have the target stored in the watch list
2. The last reference to the target is dropped in thread A and we end up
   in g_settings_backend_watch_weak_notify() right before the mutex
3. g_settings_backend_dispatch_signal() is called from another thread B
   and gets the mutex before 2.
4. g_weak_ref_init() is called on the target from thread B, which at
   this point has a reference count of exactly one (see g_object_unref()
   where it calls the weak notifies)
5. Thread A continues at 3. and drops the last reference and destroys
   the object. Now the GWeakRef from 4. points to a destroyed object. Note
   that GWeakRefs would be cleared before the weak notifies are called
6. At some later point another thread g_weak_ref_get() is called by
   g_settings_backend_invoke_closure() and accesses an already destroyed
   object with refcount 0 from the GWeakRef created in 4. by thread B (or
   worse, already freed memory that was reused).

Solve this by actually storing a GWeakRef of the target in the watch
list and only access the target behind it via the GWeakRef API, and then
pass a strong reference to the notification dispatch code.

The weak notify is only used to remove the (potentially with empty
GWeakRef) target from the list of watches and the only place that
compares the target by pointer instead of going through the GWeakRef
API.

Fixes https://gitlab.gnome.org/GNOME/glib/issues/1870
2019-08-27 11:09:08 +03:00
Nirbheek Chauhan
7952a74721 CODEOWNERS: Add myself as co-owner of Windows stuff
because I am a sucker for punishment.
2019-08-27 12:57:32 +05:30
Nirbheek Chauhan
184cbbcfd7 README.win32: Update and convert to markdown 2019-08-27 12:57:32 +05:30
Philip Withnall
1c41e348ae Merge branch '1819-file-for-uri-null' into 'master'
Resolve "Invalid characters in Open Location dialog crashes GIMP"

Closes #1819

See merge request GNOME/glib!966
2019-08-27 05:41:24 +00:00
Philip Withnall
562ac9de43 gwinhttpvfs: Fall back to wrapped VFS if creating a HTTP file fails
If we fail to create a GWinhttpFile for a URI (for example, because it’s
an invalid URI or is badly encoded), don’t just return NULL. Instead,
fall back to the wrapped VFS which might be able to handle it instead.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1819
2019-08-27 08:21:26 +03:00
Philip Withnall
4b0421a730 gwinhttpfile: Document constructor as potentially returning NULL
It can return NULL if the URI was badly encoded or couldn’t be handled
by Windows’ API.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1819
2019-08-27 08:21:26 +03:00
Philip Withnall
e24503a8e9 gvfs: Add an assertion to check that get_file_for_uri() is never NULL
It cannot return a NULL value, as none of its callers have error
handlng. Add an assertion to check the values returned by the VFS
implementations.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1819
2019-08-27 08:21:25 +03:00
Philip Withnall
29388470f8 Merge branch 'easy-uwp-patches' into 'master'
Some (probably) easy uwp patches

See merge request GNOME/glib!1057
2019-08-26 20:18:45 +00:00