Commit Graph

21407 Commits

Author SHA1 Message Date
Philip Withnall
8f52d2cb02 gboxed: Fix two potential NULL pointer dereferences
I don’t think these could be hit in practice due to the guarantees of
the type system, but the static analyser doesn’t know that — so make the
assertions clearer to shut it up.

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

Helps: #1767
2019-09-05 14:17:11 +01:00
Philip Withnall
8fe58ffe12 gdbusdaemon: Fix unused variable warning
Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1767
2019-09-05 14:17:08 +01:00
Philip Withnall
d99653f6fe gdbusdaemon: Add sanity checks on name refcounting
This should make the code a bit easier to reason about, and squash some
static analysis warnings.

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

Helps: #1767
2019-09-05 14:17:05 +01:00
Philip Withnall
df647a583d tests: Fix a couple of static analysis warnings in autoptr tests
The static analyser can’t yet work out how `g_autofree` works, so
disable those tests.

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

Helps: #1767
2019-09-05 14:17:02 +01:00
Philip Withnall
0b4162e714 build: Disable dtrace probes under static analysis
The macros for the probes confuse the static analyser, and are often
called with arguments which the analyser things shouldn’t be used any
more (for example, the address of a block of memory which has just been
freed).

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

Helps: #1767
2019-09-05 14:16:58 +01:00
Philip Withnall
18a232be89 glib: Various minor scan-build fixes
These squash various warnings from `scan-build`. None of them are
legitimate bugs, but some of them do improve code readability a bit.

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

Helps: #1767
2019-09-05 13:51:27 +01:00
Rafael Fontenelle
7a33239bab Update Brazilian Portuguese translation 2019-09-05 05:26:09 +00:00
Philip Withnall
8c9bf7f741 Merge branch 'gobject_init-suppression' into 'master'
glib.supp: make gobject_init() calloc also of the possible kind

See merge request GNOME/glib!1086
2019-09-04 18:24:22 +00:00
Claudio Saavedra
9cc863e59a glib.supp: make gobject_init() calloc also of the possible kind
It's currently marked only as reachable but Valgrind also finds it as
possible:

==18842== 96 bytes in 1 blocks are possibly lost in loss record 2,029 of 2,284
==18842==    at 0x4837B65: calloc (vg_replace_malloc.c:762)
==18842==    by 0x49614AD: g_malloc0 (gmem.c:129)
==18842==    by 0x4A7013B: type_node_any_new_W (gtype.c:439)
==18842==    by 0x4A70609: type_node_fundamental_new_W (gtype.c:550)
==18842==    by 0x4A7855A: gobject_init (gtype.c:4406)
==18842==    by 0x4A78672: gobject_init_ctor (gtype.c:4493)
2019-09-04 16:36:39 +03:00
Steve Frécinaux
11dce0fd2f docs: fix a misunderstanding in g_type_add_interface_*
The previous documentation said this:
  g_type_add_interface_static:
    "Adds the static interface_type to instantiable_type"
  g_type_add_interface_dynamic:
    "Adds the dynamic interface_type to instantiable_type"

The above suggests that if one is adding a static interface to a dynamic
object, one should use g_type_add_interface_static because the interface
is static, but the code and usage (with the newly added
G_IMPLEMENTS_INTERFACE_DYNAMIC) imply that this is wrong, and that
what matters is whether the *instanciable_type* is dynamic or not.

Hence this patch moves the "static" and "dynamic" words close to
"instantiable_type".

Closes issue #259
2019-09-04 11:58:21 +02:00
Fabio Tomat
ef47ecd665 Update Friulian translation 2019-09-03 09:13:57 +00:00
Will Thompson
4aba03562b gdbus-codegen: emit GUnixFDLists if an arg has type 'h'
Previously, if a method was not annotated with org.gtk.GDBus.C.UnixFD
then the generated code would never contain GUnixFDList parameters, even
if the method has 'h' (file descriptor) parameters. However, in this
case, the generated code is essentially useless: the method cannot be
called or handled except in degenerate cases where the file descriptors
are missing or ignored.

Check the argument types for 'h', and if present, generate code as if
org.gtk.GDBus.C.UnixFD annotation were specified.

This change will break any existing code which refers to the (useless)
wrappers for such methods. The workaround for such code is to add the
org.gtk.GDBus.C.UnixFD annotation, which will cause the same generated
code to be emitted before and after this change.

If this is found to cause widespread problems, we can explore a
different approach (perhaps emitting a warning from the code generator,
or annotating the symbols as deprecated).

https://gitlab.gnome.org/GNOME/glib/issues/1726
2019-09-02 20:47:20 +01:00
Philip Withnall
3e6fe8cd27 Merge branch 'fix-sizeof-check' into 'master'
garray: Fix reference to GLIB_SIZEOF_INT

See merge request GNOME/glib!1084
2019-09-02 15:17:23 +00:00
Alexander Larsson
4f5a2c19e4 garray: Fix reference to GLIB_SIZEOF_INT
This doesn't ever get set. SIZEOF_INT is set though, so use that instead.
2019-09-02 16:05:07 +02:00
Sebastian Dröge
daa308dd6e Merge branch '487-ci-memcheck' into 'master'
Add CI job for running tests under Valgrind

Closes #487

See merge request GNOME/glib!169
2019-09-02 13:52:35 +00:00
Alexander Larsson
5afd574e91 Use the GObject hole on 64bit arches for some flags to improve performance
This uses a 32bit hole in the GObject structure on 64bit arches
as a flag field which can be optionally used for some preformance hints.

Currently there is a flag that gets set any time you connect to a signal
on a GObject which is used as early bailout for signal emissions, and using
the flags field instead of a user-data for checking if a GObject is
under construction.
2019-09-02 15:48:32 +02:00
Philip Withnall
39052a1cfc tests: Fix some minor memory leaks in tests
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
Philip Withnall
8ae07a727a glib.supp: Add some fundamental type suppressions
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-09-02 14:16:33 +01:00
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