Commit Graph

20385 Commits

Author SHA1 Message Date
Vasily Galkin
b1f7c22a24 gdbus, tests: rename gdbus-unix-addresses test to gdbus-address-get-session
In preparation of adding non-unix testcase to the test.
2019-03-12 21:53:43 +03:00
Vasily Galkin
8c7670f0e1 gdbus, win32: autolaunch bus with gdbus.exe instead of rundll32
This is a bit of breaking change:
After this commit the apps relying of win32 dbus autolaunching,
need to install gdbus.exe alongside with libgio-2.0-0.dll.

A new command for gdbus tool is used for running server:
gdbus.exe _win32_run_session_bus

To implement it gdbus.exe uses the same exported function
g_win32_run_session_bus that earlier was used by rundll.
So (private) ABI was not changed.

It runs the bus syncronously, exiting after inactivity timeout -
all exactly like it was runed earlier with the help of rundll32.

While private exported function may have _some_
version compatibility issues between gdbus.exe and libgio-2.0-0.dll
compiling dbus server registration logic directly into gdbus.exe
can lead to _more hidden and more complex_ compatibility issues
since the names and behaviour of syncronization objects
used to publish server address would be required compatible between
gdbus.exe and libgio-2.0-0.dll.

So using "private" exported function to call
looks like more safe behaviour.

gdbus.exe binary was selected for this task since
it has corresponding name and at least for msys2 is shippied
in same package with libgio-2.0-0.dll

turn_off_the_starting_cursor function is also kept as is,
however it is not obvious if it is still needed
(by now I failed reproducing original issue).

Explicit g_warnings added to help with possible
problematic cases for absent or incompatible gdbus.exe

Mainloop is created after successful daemon creation
Before this change the function leaked mainloop on daemon creation fail
2019-03-12 21:53:29 +03:00
2932a58cd5 Handle an UNKNOWN NetworkManager connectivity as NONE
nm_conn_to_g_conn already handles UNKNOWN like NONE (returning
G_NETWORK_CONNECTIVITY_LOCAL in both cases). So in sync_properties
we should also set new_connectivity to G_NETWORK_CONNECTIVITY_LOCAL
for both NM_CONNECTIVITY_UNKNOWN and NM_CONNECTIVITY_NONE.

This has the added benefit that when NetworkManager returns the network
connectivity is UNKNOWN, we set network_available to FALSE as it should
be. Previously, there were cases in a laptop with no network access,
that g_network_monitor_get_network_available returned true, which was
wrong and is also fixed with this commit.
2019-03-12 18:39:42 +01:00
Sebastian Dröge
499c201472 GSocketClient - Free last error if a connection attempt fails and on retry the cancellable is cancelled 2019-03-12 10:32:56 +01:00
Nathan Follens
1a03ebc43a Update Dutch translation 2019-03-10 13:03:39 +00:00
Philip Withnall
3e7baaae23 Merge branch '1708-build-with-g-disable-assert' into 'master'
Fix build with G_DISABLE_ASSERT defined

Closes #1708

See merge request GNOME/glib!705
2019-03-08 19:59:36 +00:00
Philip Withnall
3d3ca9f1fe gobject: Fix various compiler warnings when compiling with G_DISABLE_ASSERT
Mostly unused variables which are only used in a g_assert() call
otherwise.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
faa1d63cab glib: Fix various compiler warnings when compiling with G_DISABLE_ASSERT
Mostly unused variables which are only used in a g_assert() call
otherwise.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
1b50643c99 gio: Fix various compiler warnings when compiling with G_DISABLE_ASSERT
Mostly unused variables which are only used in a g_assert() call
otherwise.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
9ce76b97f1 ci: Add a build with G_DISABLE_ASSERT defined
We want GLib to build correctly with this defined, and for all its tests
to still pass.

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

Helps: #1708
2019-03-08 19:46:21 +00:00
Philip Withnall
8f2365dc8a gtestutils: Call __builtin_undefined() from g_assert_not_reached()
Both GCC and Clang treat this as a hint that the code won’t be reached,
which helps in the cases where they might not have automatically
detected it already.

It doesn’t change any behaviour of the compiled code, other than
allowing the compiler to go off into undefined behaviour.

See
https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005funreachable.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:21 +00:00
Philip Withnall
57a806b762 tests: Convert g_assert() to g_assert_*() in glib/tests/rand.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:21 +00:00
Philip Withnall
ba84f45f96 tests: Convert g_assert() to g_assert_*() in glib/tests/mappedfile.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
a1aebf7437 tests: Convert g_assert() to g_assert_*() in glib/tests/mainloop.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
3a96e7d9cb tests: Convert g_assert() to g_assert_*() in glib/tests/asyncqueue.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
277c42ddc0 tests: Convert g_assert() to g_assert_*() in gio/tests/gsubprocess.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
6a724d9ccd tests: Convert g_assert() to g_assert_*() in gio/tests/actions.c
g_assert_*() give more informative failure messages, and aren’t compiled
out when building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:46:20 +00:00
Philip Withnall
d89f18bb22 build: Add -UG_DISABLE_ASSERT when building tests
In order to allow GLib itself to be built with G_DISABLE_ASSERT defined,
we need to explicitly undefine it when building the tests, otherwise
g_test_init() turns into an abort.

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

Fixes: #1708
2019-03-08 19:46:20 +00:00
Philip Withnall
a2a17a978a gmacros: Improve documentation of GCC attributes
Link to the GCC documentation pages, and format the attribute names as
code.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:21:39 +00:00
Philip Withnall
e03a2c8633 glib: Move various documentation comments from docs.c to macros.h
Move them next to their definitions, so they’re more likely to be kept
up to date.

This doesn’t modify any of the documentation comments at all.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-08 19:10:32 +00:00
Simon McVittie
f3610f14c4 Merge branch '1712-gdbus-proxy-flaky' into 'master'
Minor improvements to gdbus-proxy test

Closes #1712

See merge request GNOME/glib!715
2019-03-07 15:12:30 +00:00
Philip Withnall
49642bfeb2 glib.supp: Add a calloc() variant of an existing suppression
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:58:11 +00:00
Philip Withnall
3d4a168715 tests: Fix some larger memory leaks in gdbus-proxy
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:57:38 +00:00
Philip Withnall
938f716c2f tests: Fix a minor memory leak in gdbus-proxy
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:04:12 +00:00
Philip Withnall
196e333ec2 tests: Use g_assert_*() instead of g_assert() in gdbus-proxy
g_assert_*() give more informative error messages on failure, and can’t
be disabled by G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-07 13:03:40 +00:00
Vasily Galkin
4342dbbe4d gdbus, win32: move most W32 dbus autolaunch code to gdbusprivate
This allows referencig them from more than single .c file.

Implementation moved without changes
from gdbusaddress.c to gdbusprivate.c

g_win32_run_session_bus signature also kept, so ABI unchanged.
2019-03-07 15:56:44 +03:00
Vasily Galkin
4ed5abda43 gdbusaddress, win32: don't rely on short names
Closes: https://gitlab.gnome.org/GNOME/glib/issues/1566

Short names were used in win32 implementation to allow launching
on installations where full path to libgio-2.0-0.dll contain spaces.
However, short names are optional on windows: so if they were disabled
that method fails - see issue linked above.

Since rundll32 doesn't support neither spaces, nor quotes in cmdline
this patch changes rundll32 argument to just .\gio-dll-name.dll
and uses the entire path directory containing gio dll as rundll32
current directory.

Added comments informing about potential subtleties discovered during
writing test for gdbusaddress on win32.
There are not known to have real-world user-visible effect,
so by now I'm only adding comments without creating issues.
2019-03-07 15:56:44 +03:00
Matthias Clasen
23a99f71cc Merge branch '1177-quark-not-cxx-globals-docs' into 'master'
gquark: Document that some functions can’t initialise C++ globals

Closes #1177

See merge request GNOME/glib!714
2019-03-07 12:10:19 +00:00
Sebastian Dröge
aedd484b92 Merge branch '682-object-set-data-docs' into 'master'
gobject: Mention quark memory usage for g_object_set_data()

Closes #682

See merge request GNOME/glib!713
2019-03-07 11:50:27 +00:00
Philip Withnall
a66ae5cda3 gquark: Document that some functions can’t initialise C++ globals
Any function which requires g_quark_init() to have been called first
cannot be called before the library constructors have finished running.
In particular, this means that g_quark_from_static_string() or
g_intern_static_string() can’t be used to initialize C++ globals.

Do this, rather than adding a conditional call to g_quark_init() to all
these functions, because such a call was previously removed from the
functions to improve performance (quarks are used a lot in the
implementation of GObject for properties and signals). That’s the reason
why g_quark_init() was originally moved out to a library constructor.

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

Fixes: #1177
2019-03-07 11:12:01 +00:00
Philip Withnall
b8a58b7cae Merge branch 'fix-comment-gwin32' into 'master'
gwin32: Fix comment for g_win32_veh_handler

See merge request GNOME/glib!712
2019-03-07 11:03:30 +00:00
Philip Withnall
2a570dc5af gobject: Mention quark memory usage for g_object_set_data()
g_object_set_data() should only ever be used with a small, bounded set
of keys, or the memory usage of the quark lookup table will grow
unbounded. Document that.

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

Fixes: #682
2019-03-07 10:56:47 +00:00
Andrea Azzarone
7bc21392e1 gwin32: Fix comment for g_win32_veh_handler 2019-03-07 10:38:24 +00:00
Sebastian Dröge
c9c88a4b22 Merge branch 'fix-gjs-issue-227' into 'master'
socket: Fix annotation for flags in g_socket_receive_message

Closes gjs#227

See merge request GNOME/glib!710
2019-03-06 20:34:15 +00:00
Andrea Azzarone
d1cb974932 socket: Fix annotation for flags in g_socket_receive_message
Closes: https://gitlab.gnome.org/GNOME/gjs/issues/227
2019-03-06 18:16:52 +00:00
Philip Withnall
62bd79b6a2 Merge branch 'tdr' into 'master'
Fix data races in task test and gmenumodel test

See merge request GNOME/glib!706
2019-03-06 13:53:24 +00:00
Tomasz Miąsko
330f8999a8 tests: Fix data race in task test
Ensure that all tasks have already completed before accessing buf array
from main thread to avoid conflicting data access from multiple threads.
2019-03-06 14:21:13 +01:00
Emmanuele Bassi
7644b6a368 Merge branch 'api-tags' into 'master'
Bump release version for 2.62 series

See merge request GNOME/glib!709
2019-03-06 12:30:12 +00:00
Philip Withnall
6761bb2f57 build: Factor out common gtkdoc flags
Those lists were getting very long. We can’t quite entirely automate the
list generation since Meson doesn’t have a range() function, but we can
at least combine three of them into one.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:59:03 +00:00
Philip Withnall
a73c9411f9 Merge branch 'exceptions' into 'master'
Basic W32 exception handling for glib

See merge request GNOME/glib!582
2019-03-06 11:58:45 +00:00
Руслан Ижбулатов
66f4c104ba W32 VEH: Add tests
One test is for _g_win32_subst_pid_and_event().
Two tests for crashing with different exceptions (access violation
and illegal instruction).
And one test for running a debugger.
2019-03-06 11:41:58 +00:00
Руслан Ижбулатов
025a346728 W32: Add a simple exception handler
Install a Vectored Exception Handler[0]. Its sole purpose is to catch
some exceptions (access violations, stack overflows, illegal
instructions and debug breaks - by default, but it can be made to catch
any exception for which a code is known) and run a debugger in response.

This allows W32 glib applications to be run without a debugger,
but at the same time allows a debugger to be attached in case
something happens.

The debugger is run with a new console, unless an environment variable
is set to allow it to inherit the console of the crashing process.

The short list of handleable exceptions is there to ensure that
this handler won't run a debugger to "handle" utility exceptions,
such as the one that is used to communicate thread names to a debugger.

The handler is installed to be called last, and shouldn't interfere
with any user-installed handlers.

There's nothing fancy about the way it runs a debugger (it doesn't even
support unicode in paths), and it deliberately avoids using glib code.

The handler will also print a bit of information about the exception
that it caught, and even more information for well-known exceptions,
such as access violation.

The whole scheme is similar to AeDebug[1] and, in fact, the signal-event
gdb command was originally implemented for this very purpose.

[0]: https://docs.microsoft.com/en-us/windows/desktop/debug/vectored-exception-handling
[1]: https://docs.microsoft.com/en-us/windows/desktop/debug/configuring-automatic-debugging
2019-03-06 11:41:56 +00:00
Philip Withnall
925c52760c build: Bump version to 2.61.0
Ready for the new unstable release series.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:27:24 +00:00
Philip Withnall
e7d091dec1 gversionmacros: add version macros for GLib 2.62
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-06 11:26:28 +00:00
Philip Withnall
35db2ffe9c Merge branch 'cancellable-cancel-null' into 'master'
gcancellable: add back lost NULL check in g_cancellable_cancel()

Closes #1710

See merge request GNOME/glib!707
2019-03-05 16:06:29 +00:00
Christoph Reiter
e13c646465 gcancellable: add back lost NULL check in g_cancellable_cancel()
Commit f975858e86 removed the NULL check in g_cancellable_cancel() by
accident which makes it crash when called with NULL.

Add the check back and add a test so this doesn't happen again.

Fixes #1710
2019-03-05 16:44:16 +01:00
Tomasz Miąsko
0679bd2732 tests: Fix data race in gmenumodel test
Synchronize access to server_connection.
2019-03-05 15:14:58 +01:00
Philip Withnall
aeb7dbad30 Merge branch 'tsan' into 'master'
Fix thread safety issues

See merge request GNOME/glib!690
2019-03-05 11:46:33 +00:00
Philip Withnall
2edc5aa6df 2.60.0
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-03-04 20:03:12 +00:00
Philip Withnall
4d04353bbd Merge branch 'trash-check' into 'master'
trash portal: Fix permission checks

See merge request GNOME/glib!704
2019-03-04 19:47:11 +00:00