Commit Graph

19369 Commits

Author SHA1 Message Date
Will Thompson
3821ba06b1
tests/g-file-info-filesystem-readonly: assert subcommands succeed
In practice, fusermount -u often fails:

  /usr/bin/fusermount: failed to unmount /home/wjt/src/gnome/glib/_build/dir_bindfs_mountpoint: Device or resource busy

which causes the subsequent calls to bindfs to fail:

  fuse: mountpoint is not empty
  fuse: if you are sure this is safe, use the 'nonempty' mount option

This may or may not cause the current test run to fail, but it reliably
causes a repeat run of the test to fail. This change causes the current
run to fail instead.
2018-11-13 10:34:09 +00:00
Philip Withnall
cb174e6600 Merge branch 'wip/tintou/gio-symbols-index-update' into 'master'
docs: add index of new symbols for gio > 2.52

See merge request GNOME/glib!469
2018-11-13 10:11:21 +00:00
Philip Withnall
e8359619d1 Merge branch '1261-settings-documentation' into 'master'
gsettings: Add an example of a <default> with an empty string

Closes #1261

See merge request GNOME/glib!468
2018-11-13 10:10:32 +00:00
Corentin Noël
c7ac6f3ae0 docs: add index of new symbols for gio > 2.52 2018-11-13 08:08:14 +01:00
Philip Withnall
bc320d9fca gsettings: Add an example of a <default> with an empty string
Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://gitlab.gnome.org/GNOME/glib/issues/1261
2018-11-13 00:31:54 +00:00
Philip Withnall
f81a2b3de2 Merge branch 'mcatanzaro/tls1.3-handshake' into 'master'
Update documentation of g_tls_connection_handshake() again

See merge request GNOME/glib!467
2018-11-12 23:50:16 +00:00
Michael Catanzaro
68878ab50b Update documentation of g_tls_connection_handshake() again
I made a mistake when last updating the documentation in 94a99ae9. I
wrote that, with TLS 1.3, this would perform a rekey instead of a
rehandshake. In fact, that's only true for client connections. For
server connections, it's a no-op.

I was a bit nervous about how to document the behavior anyway, because
we really don't know what behavior will be reasonable with non-GnuTLS
crypto backends. This behavior is reasonable for the GnuTLS backend, but
might not necessarily make sense for OpenSSL. Ideally, we would
discourage API users from doing things which could have unexpected
effects, so instead of documenting what the GnuTLS backend does, I think
it'd be better to document that this is "undefined but not dangerous,"
since of course we want to make sure that existing code that doesn't
know about TLS 1.3 is not broken.
2018-11-12 14:49:30 -06:00
Matthias Clasen
bb1f765df3 Clarify docs for g_settings_list_children
The docs sound like settings list is a thing, and
a ::children-changed signal exists. That is not the
case, and will never be the case at this point, so
stop pretending.

Closes: #1362
2018-11-12 08:07:52 -05:00
Philip Withnall
e990a9ff8e Merge branch '107-key-file-comment-line-breaks' into 'master'
gkeyfile: Fix parsing of new lines in comments

Closes #107

See merge request GNOME/glib!432
2018-11-12 12:57:24 +00:00
Philip Withnall
378be29185 Merge branch 'dont-memoize-in-g_log_writer_is_journald' into 'master'
gmessages: don't memoize in g_log_writer_is_journald()

Closes #1589

See merge request GNOME/glib!464
2018-11-12 12:54:49 +00:00
Philip Withnall
4ea56957db Merge branch 'issues/1310' into 'master'
gdbusproxy: make g-name-owner property useful with unique names

See merge request GNOME/glib!454
2018-11-12 12:43:27 +00:00
Philip Withnall
4af8edb57d Merge branch 'master' into 'master'
gio, tests: fix leak of dbus connection.

See merge request GNOME/glib!463
2018-11-12 12:13:55 +00:00
Will Thompson
f1175704b6
gmessages: don't memoize in g_log_writer_is_journald()
Previously, g_log_writer_is_journald() would cache the result for the
first (non-negative) FD it was called on, and return that result for
all future (non-negative) FDs. While unlikely, it's possible that
applications might call this function on something other than
fileno(stderr).

Move the memoization into g_log_writer_default(), which always passes
fileno(stderr).

Fixes #1589.
2018-11-12 11:20:49 +00:00
INSUN PYO
bf1a2d7079 gio, tests: fix leak of dbus connection.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1- Start server
   gio/tests/.libs/gdbus-example-peer --server --address unix:abstract=/tmp/peer/myaddr

2- Check the open fds for server process
   lsof -a -p 8253
   ..................
   gdbus-exa 8253 imran    0u   CHR      136,1      0t0        4 /dev/pts/1
   gdbus-exa 8253 imran    1u   CHR      136,1      0t0        4 /dev/pts/1
   gdbus-exa 8253 imran    2u   CHR      136,1      0t0        4 /dev/pts/1
   gdbus-exa 8253 imran    3u  0000        0,9        0     6602 anon_inode
   gdbus-exa 8253 imran    4u  unix 0xf1005680      0t0   966830 @/tmp/peer/myaddr

3- Run the client
   gio/tests/.libs/gdbus-example-peer --address unix:abstract=/tmp/peer/myaddr

4- Check the open fds for server process again
   lsof -a -p 8253
   ..................
   gdbus-exa 8253 imran    0u   CHR      136,1      0t0        4 /dev/pts/1
   gdbus-exa 8253 imran    1u   CHR      136,1      0t0        4 /dev/pts/1
   gdbus-exa 8253 imran    2u   CHR      136,1      0t0        4 /dev/pts/1
   gdbus-exa 8253 imran    3u  0000        0,9        0     6602 anon_inode
   gdbus-exa 8253 imran    4u  unix 0xf1005680      0t0   966830 @/tmp/peer/myaddr
   gdbus-exa 8253 imran    5u  unix 0xf1004280      0t0   965811 @/tmp/peer/myaddr
   gdbus-exa 8253 imran    6u  0000        0,9        0     6602 anon_inode

5- Please note the fd '5u' which is created when client makes connection but even when the client goes down, the descriptor is still there..
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

https://bugzilla.gnome.org/show_bug.cgi?id=734281
2018-11-12 15:45:20 +09:00
Aurimas Černius
fcda663165 Updated Lithuanian translation 2018-11-10 17:51:22 +02:00
Cosimo Cecchi
47be0f7a23 gdbusproxy: make g-name-owner property useful with unique names
Currently, GDBusProxy:g-name-owner only notifies changes to the unique
name owner of the remote object in case the proxy was constructed for a
well-known name.
That sounds like an artificial restriction, and it's convenient to
connect to notify::g-name-owner if a proxy instance has already been
created for an unique name, instead of additionally using
g_bus_watch_name() to track the owner.

To fix this, always connect to NameOwnerChanged after the proxy is
initialized, instead of only doing so when the proxy was constructed for
a well-known name.

https://bugzilla.gnome.org/show_bug.cgi?id=791316
https://gitlab.gnome.org/GNOME/glib/issues/1310
2018-11-10 03:53:32 +00:00
Xavier Claessens
b3c899d295 Meson: Fix build error in gdbus-example-objectmanager
test_c_args is defined in the root meson.build with unfiltered list of
compiler flags, then redefined in gio/tests/meson.build after the
subdir() call. Move it before.
2018-11-09 13:23:43 -05:00
Tomasz Miąsko
4fde2b273d gatomicrefcount: Make g_atomic_ref_count_init non-atomic
Programmer needs to ensure that initializations happens before other
operations on gatomicrefcount as otherwise they could access
uninitialized memory, so there is no practical use case for making
initialization atomic.
2018-11-08 16:04:51 +01:00
Philip Withnall
0c6346c98f Merge branch 'atomic-ref-count-cnd' into 'master'
Atomic reference count in GVariant, ContainerInfo and GDBus introspection

See merge request GNOME/glib!452
2018-11-08 14:22:03 +00:00
Philip Withnall
0ef8dde34e Merge branch '1342-gvariant-alignment' into 'master'
gvariant: Realign data on construction if it’s not properly aligned

Closes #1342

See merge request GNOME/glib!455
2018-11-07 16:55:50 +00:00
Philip Withnall
55934a01c6 Merge branch 'vmlobanov78/glib-patch-2' into 'master'
glib-compile-resources: Fix size allocation for compressed streams

See merge request GNOME/glib!458
2018-11-07 10:01:16 +00:00
Simon McVittie
54549b7e43 Merge branch 'arm-closures-timeout' into 'master'
closures test: Avoid timeout on ARM64 CPUs

See merge request GNOME/glib!451

Reviewed-by: pwithnall
2018-11-06 20:39:41 +00:00
Emin Tufan Çetin
348b5eaa84 Update Turkish translation 2018-11-06 19:52:17 +00:00
Piotr Drąg
36cf46504e Update Polish translation 2018-11-06 17:23:27 +01:00
vmlobanov78
0985e70488 glib-compile-resources: Fix size allocation for compressed streams
The length of the stolen data from a memory output stream is given by
get_data_size() — get_size() can be larger, and hence cause unnecessary
overallocation.
2018-11-06 15:03:03 +00:00
Simon McVittie
cb98e37357 closures test: Avoid timeout on ARM64 CPUs
Closures use a 16-bit atomic reference count, which is really slow
on certain ARM64 CPUs such as the Cortex-A57 (glib#1316). This is
non-trivial to solve, since the public struct field cannot be enlarged
to 32-bit while preserving ABI, and 16-bit atomic operations would be new
(and rather niche) API.

Until this can be solved properly (hopefully in GLib 2.59.x), cut down
the number of signal emission cycles and bump up the timeout in the
Meson build system, so that builds won't time out. We can't just take
another zero off the number of signal emission cycles, as was done in the
original version of this patch in Debian, because if we do that it can
result in test failures when the main thread starves the other threads.

ARM64 CPUs are backwards-compatible with 32-bit ARM, and the same
slowdown can be seen when building and testing 32-bit code on these
CPUs, so check for both 32- and 64-bit ARM.

Bug-Debian: https://bugs.debian.org/880883
Co-authored-by: Iain Lane <laney@debian.org>
Signed-off-by: Simon McVittie <smcv@debian.org>
2018-11-06 13:48:34 +00:00
Tomasz Miąsko
b599a0f414 gdbusintrospection: Use atomic operations to read ref_count 2018-11-06 14:44:40 +01:00
Tomasz Miąsko
b5a41afb18 gvarianttypeinfo: Use gatomicrefcount for ContainerInfo reference count 2018-11-06 14:44:25 +01:00
Tomasz Miąsko
6d108587a4 gvariant-core: Use gatomicrefcount for GVariant reference count 2018-11-06 14:39:19 +01:00
Philip Withnall
409ff69bd1 gvariant: Re-use g_variant_serialised_check() to check alignment
Rather than duplicating the alignment checks when constructing a new
GVariant, re-use the alignment checks from GVariantSerialised. This
ensures that the same checks are done everywhere in the GVariant code.

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

https://gitlab.gnome.org/GNOME/glib/issues/1342
2018-11-06 12:49:25 +00:00
Philip Withnall
a3ad5a2ce0 Merge branch 'bookmarkfile-self-move' into 'master'
bookmarkfile: Don't move an item if the uri has not changed

Closes #1588

See merge request GNOME/glib!456
2018-11-06 12:21:19 +00:00
Philip Withnall
7b0f2e0e34 gvariant: Fix some GIR annotations on internal functions
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2018-11-06 11:50:20 +00:00
Philip Withnall
0f2a6c61c9 gvariant: Realign data on construction if it’s not properly aligned
Otherwise the GVariant would later fail internal alignment checks,
aborting the program.

If unaligned data is provided to (for example)
g_variant_new_from_data(), it will copy the data into a new aligned
allocation. This is slow, but better than crashing. If callers want
better performance, they should provide aligned data in their call, and
it will not be copied or reallocated.

Includes a unit test.

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

https://gitlab.gnome.org/GNOME/glib/issues/1342
2018-11-06 11:50:20 +00:00
Marco Trevisan (Treviño)
cfd164980d gbookmarkfile: remove trailing spaces 2018-11-05 17:15:42 -06:00
Marco Trevisan (Treviño)
821d28024b bookmarkfile: Don't move an item if the uri has not changed
This was causing a crash, because we were first removing an item, freeing
both the instance itself and the key, and then trying to reuse those.

So, in this case, instead of reassigning an item, we can just return TRUE
as we have already the item at the right place, while it's not needed to
update the modified timestamp, since no modification happened in reality.

Fixes #1588
2018-11-05 17:15:32 -06:00
Marco Trevisan (Treviño)
94edafb5fa bookmarkfile: test that moving to the same name works
Verify that we can move a bookmark item to the same name, but actually this
causes a crash right now.
2018-11-05 17:06:52 -06:00
Tomasz Miąsko
68e78c6eb2 tests: Fix data races in gwakeuptest.c 2018-11-04 17:28:58 +01:00
Tomasz Miąsko
1cc7457870 tests: Fix data races in refcount/signals.c 2018-11-04 17:28:51 +01:00
Tomasz Miąsko
83221671ea tests: Fix data races in refcount/closures.c 2018-11-04 17:28:43 +01:00
Philip Withnall
b09a0df9a9 Merge branch '1576-meson-armv5-atomic' into 'master'
meson: Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 on GNU/Linux if needed

Closes #1576

See merge request GNOME/glib!434
2018-11-02 20:56:37 +00:00
Philip Withnall
73a982fa91 Merge branch 'wip/sadiq/likely' into 'master'
gmacros: Fix G_[UN]LIKELY to not mask -Wparentheses

See merge request GNOME/glib!372
2018-11-02 20:45:38 +00:00
Philip Withnall
5c7e64ae77 Merge branch 'supp' into 'master'
valgrind: Add glib_init()-related suppressions

See merge request GNOME/glib!436
2018-11-02 20:34:53 +00:00
Philip Withnall
74d2a8e500 Merge branch 'test-timeout' into 'master'
meson: Increase test timeouts

See merge request GNOME/glib!407
2018-11-02 11:02:32 +00:00
Philip Withnall
8f115b63b1 Merge branch 'atomic-ref-count' into 'master'
gvarianttypeinfo: Consistently use atomics to access ref_count

See merge request GNOME/glib!444
2018-11-02 10:29:48 +00:00
Philip Withnall
7d4fb4df78 Merge branch 'g-test-rand-int-range-race' into 'master'
tests: Avoid multithreaded use of g_test_rand_int_range

See merge request GNOME/glib!443
2018-11-02 10:21:20 +00:00
Tomasz Miąsko
aed3c0083b gtestutils: Make test_rand_* thread-safe within a single test case
Synchronize access to random number generator `test_run_rand` with
a lock to ensure that `g_test_rand_*` family of functions is
thread-safe.

The reseeding taking place between test case runs is intentionally left
unsynchronized. It is an error to continue using random number generator
after test case has already finished running. Lack of synchronization
here will make such erroneous use readily apparent with thread
sanitizer.
2018-11-02 08:29:08 +01:00
Tomasz Miąsko
03518e576e gvarianttypeinfo: Consistently use atomics to access ref_count 2018-11-01 21:55:07 +01:00
Simon McVittie
03413d5a87 meson: Mark gdatetime test as slow
This test isn't inherently slow, but it produces so much output that
it can take a minute or more on hardware with weak I/O performance.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-01 19:13:21 +00:00
Simon McVittie
a40ef2ff92 meson: Increase fast test timeout from 30s to 60s
This is enough for most Debian buildds, including embedded devices
like mips and powerpcspe. It is not enough for hppa (PA-RISC), but that
architecture is so uniquely slow that it might make more sense to
special-case it downstream.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-01 19:13:21 +00:00
Simon McVittie
13e206aaeb meson: Centralize test timeout values
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-11-01 19:13:21 +00:00