Commit Graph

20481 Commits

Author SHA1 Message Date
Allison Karlitskaya
115033338b ghash: fix small array handling in g_hash_table_remove_all_nodes()
Factor out the code for setting up the hash table size, mask and mod,
detecting valgrind and allocating the arrays for hashes, keys, and
values.

Make use of this new function from g_hash_table_remove_all_nodes().

The handling of have_big_keys and have_big_values was never correct in
this function because it reallocated the array without changing the
flags in the struct.  Any calls in to the hashtable from destroy
notifies would find the table in an inconsistent state.

Many thanks to Thomas Haller who is essentially responsible for all the
real work in this patch: both discovering and identifying the original
problem, as well as finding the solution to it.
2019-05-20 17:03:49 +02:00
Allison Karlitskaya
9add93e5a4 ghash: Be more explicit about memory in g_hash_table_destroy_all_nodes()
Make it clear that there is a reference transfer going on here, rather
than relying on the fields being overwritten on each branch of the
conditional below.
2019-05-20 17:03:49 +02:00
Allison Karlitskaya
b3fbf6c18b ghash: do less work when destroying the table
We were calling g_hash_table_set_shift() to reinitialise the hash table
even in the case of destroying it.  Only do that for the non-destruction
case, and fill the relevant fields with zeros for the destruction case.
This has a nice side effect of causing more certain crashes in case of
invalid reuse of the table after (or during) destruction.
2019-05-20 17:03:49 +02:00
Allison Karlitskaya
c5462cb3c1 ghash: Improve internal documentation
The changes introduced by 18745ff674 made
the comment at the top of g_hash_table_remove_all_nodes() no longer
correct.  Fix that inaccuracy and add more documentation all-around.
2019-05-20 17:03:49 +02:00
Allison Karlitskaya
96ce92025d ghash: fix bug introduced by valgrind fix
g_hash_table_new_full() had an invocation of
g_hash_table_realloc_key_or_value_array() with the @is_big argument
incorrectly hardcoded to FALSE, even though later in the function the
values of have_big_keys and have_big_values would be set conditionally.

This never caused problems before because on 64bit platforms, this would
result in the allocation of a guint-sized array (which would be fine, as
have_big_keys and have_big_values would always start out as false) and
on 32bit platforms, this function ignored the value and always allocated
a gpointer-sized array.

Since merge request GNOME/glib!845 we have the possibility for
have_big_keys and have_big_values to start out as TRUE on 64bit
platforms.  We need to make sure we pass the argument through correctly.
2019-05-20 17:03:49 +02:00
Emmanuele Bassi
a8c265c6b1 Merge branch '1782-cross-docs' into 'master'
docs: Fix typo in Meson cross-compilation instructions

Closes #1782

See merge request GNOME/glib!854
2019-05-20 11:28:32 +00:00
Philip Withnall
0470cccec8 docs: Fix typo in Meson cross-compilation instructions
Meson accepts `--cross-file`, but not `--cross_file`.

Spotted by Carlo Bramini.

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

Fixes: #1782
2019-05-20 12:11:24 +01:00
Philip Withnall
13da7e5c2e Merge branch 'wip/ignazp/gtask-wait-time-fix' into 'master'
gtask: fix task_wait_time estimation

Closes #1683

See merge request GNOME/glib!644
2019-05-20 11:07:54 +00:00
Philip Withnall
f093ef6a6f gobject: Fix apostrophe usage in a few small bits of documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-17 17:39:40 +01:00
zb3
d1d81c8a07 Update gdb pretty-printer for GHashTable
Fixes #1780
2019-05-17 17:46:24 +02:00
Philip Withnall
522e74982e Merge branch '1441-1619-deprecate-gtester' into 'master'
Deprecate gtester and use TAP output for tests by default

Closes #1619 and #1441

See merge request GNOME/glib!842
2019-05-17 12:12:53 +00:00
Philip Withnall
9c4026d673 gsettings: Add missing ‘Deprecated’ tag to g_settings_list_keys() docs
It was already deprecated in the header, but the tag was missing from
the documentation.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-17 13:06:08 +01:00
Philip Withnall
d2b419c81f gsettings: Document that lists are returned in no defined order
The caller cannot assume that the lists returned by various GSettings
functions (for example, lists of keys or schemas) will be returned in
any particular order.

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

Helps: #1781
2019-05-17 13:03:27 +01:00
Philip Withnall
1ff1e7d57a Merge branch 'fix_g_format_size_full' into 'master'
Fixing g_format_size_full() on Windows-x64

See merge request GNOME/glib!845
2019-05-15 11:27:49 +00:00
Emmanuel Fleury
101c8b3c19 Fixing g_format_size_full() on Windows-x64
For some reasons, the buffer used in the Format struct was not long
enough on Windows-x64 and the final null ('\0') character was omitted
leading to a limited memory disclosure.
2019-05-15 10:18:22 +02:00
Philip Withnall
4e2acb47bd Merge branch 'wip/desrt/ghash-valgrind' into 'master'
ghash: Disable small-arrays under valgrind

Closes #1749

See merge request GNOME/glib!840
2019-05-14 15:50:05 +00:00
Allison Karlitskaya
436ca1f376 ghash: Disable small-arrays under valgrind
Valgrind can't find 64bit pointers when we pack them into an array of
32bit values.  Disable this optimisation if we detect that we are
running under valgrind.

Fixes #1749
2019-05-14 16:31:37 +02:00
Philip Withnall
4f5fe35385 Merge branch 'fix_g_unichar_totitle' into 'master'
Fix g unichar totitle

Closes #135

See merge request GNOME/glib!843
2019-05-14 12:05:30 +00:00
Philip Withnall
505f45ef95 tests: Remove redundant --tap options
Now that TAP output is used by default, passing `--tap` is unnecessary.

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

Helps: #1619
2019-05-14 12:42:51 +01:00
Philip Withnall
ad17576657 gtestutils: Output in TAP format by default
Only disable TAP output if the `--GTestLogFD` argument is passed to the
test, which is passed in by the (deprecated) gtester harness, and
shouldn’t ever have been passed in by anything else.

Also disable it when running a subprocess, using `--GTestSubprocess`,
since users commonly strictly check the stdout and stderr of test
subprocesses.

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

Fixes: #1619
2019-05-14 12:42:51 +01:00
Emmanuel Fleury
7dcaa7eeda Add the corresponding test for g_unichar_totitle(0) 2019-05-14 13:38:14 +02:00
Emmanuel Fleury
48d65634a5 Handling U+0000 explicitely to avoid collision with other cases
Fix issue #135
2019-05-14 13:35:49 +02:00
Philip Withnall
662cddcb4b glib: Deprecate gtester and gtester-report
Add warnings about their deprecation everywhere. The tools will continue
to work until we break API, but will be less well maintained. You should
use TAP for communicating test results to the test harness provided by
your build system or CI system instead.

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

Fixes: #1441
2019-05-14 12:14:54 +01:00
Philip Withnall
bd8658e16a Merge branch 'g_format_size_is_broken_on_Windows' into 'master'
Fixing g_format_size() on Windows

Closes #429

See merge request GNOME/glib!837
2019-05-14 10:25:30 +00:00
Philip Withnall
6a6ab5bb12 Merge branch 'master' into 'master'
tests: Update month name check for Greek locale

Closes #1776

See merge request GNOME/glib!839
2019-05-14 09:52:59 +00:00
Rafal Luzynski
35c28be327 tests: Update month name check for Greek locale
Update the abbreviated month name in the test to match the actual
translation. Otherwise the test fails with false positive.

Vocabulary:

July (nominative)  - Greek: Ιούλιος (abbreviated: Ιούλ)
Of July (genitive) - Greek: Ιουλίου (abbreviated: Ιουλ)

This is similar to commit 4d215e006e
and commit 7fe793e125.

Closes #1776
2019-05-13 23:11:56 +02:00
Emmanuel Fleury
08f08448ec Fixing g_format_size() on Windows
It seems that the issue went away on current Window systems.

Fix #429
2019-05-13 14:23:57 +02:00
Philip Withnall
ebd2116d89 Merge branch 'de' into 'master'
Fix typo in German translation

See merge request GNOME/glib!835
2019-05-13 10:48:48 +00:00
Martin Kröning
202ef4a4ac Fix typo in German translation 2019-05-11 13:34:10 +00:00
Michael Catanzaro
c252bd150a Merge branch 'wip/tingping/network-address-state' into 'master'
gnetworkaddress: Fix parallel enumerations interfering with each other

Closes #1771

See merge request GNOME/glib!823
2019-05-10 17:46:42 +00:00
Patrick Griffis
5ba42af9b1 gnetworkaddress: Fix parallel enumerations interfering with eachother
The parent GNetworkAddress contains a shared list of resolved
addresses that is used as a cache for multiple enumerations.

This commit ensures that the cache is only set upon completion of
DNS lookups and only read once by enumerations to avoid being in a
bad state.

Fixes #1771
2019-05-10 10:17:23 -07:00
Emmanuele Bassi
e8b045e699 Merge branch 'version-bump' into 'master'
build: (Long time after) post-release version bump

See merge request GNOME/glib!831
2019-05-10 14:44:56 +00:00
Philip Withnall
83177c0edc build: (Long time after) post-release version bump
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-10 15:09:50 +01:00
Philip Withnall
9974cec26b glib: Rename G_STDIO_NO_WRAP_ON_UNIX → G_STDIO_WRAP_ON_UNIX
This clarifies the meaning a bit. Don’t change the logic associated with
it. Add a few comments to clarify things further.

Based on work done by Emmanuel Fleury.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Fixes: #77
2019-05-10 12:58:56 +01:00
Philip Withnall
314901309f Merge branch 'wip/kalev/GRWLock-autoptr' into 'master'
Add autoptr support for GRWLock

See merge request GNOME/glib!825
2019-05-10 11:19:42 +00:00
Philip Withnall
676275fba8 Merge branch 'master' into 'master'
build: Fix a typo in the test whether _NL_ABALTMON_n is supported

Closes #1759

See merge request GNOME/glib!828
2019-05-10 10:54:45 +00:00
Kalev Lember
e4bd6dd515 Add autoptr support for GRWLock 2019-05-10 12:48:20 +02:00
Rafal Luzynski
93d8482384 build: Fix a typo in the test whether _NL_ABALTMON_n is supported
The correct spelling is "_NL_ABALTMON_n" rather than "_NL_ALTMON_n".
The typo made Meson build think that _NL_ABALTMON_n constants are
not supported which was totally wrong. This made g_date_time_format()
output incorrect abbreviated month names in some languages.
The old configure.ac script was correct here.

Bug introduced in commit be4f96b650.

Closes: #1759
2019-05-10 01:19:42 +02:00
Philip Withnall
305d850902 Merge branch 'wip/desrt/gsocketclient-leak' into 'master'
gsocketclient: Fix a leak in the connection code

Closes #1774

See merge request GNOME/glib!824
2019-05-09 16:53:22 +00:00
Allison Karlitskaya
bdefe5f9e1 gsocketclient: Fix a leak in the connection code
We miss releasing the async operation's reference on a state object in
one of the error cases.

The call to connection_attempt_remove() (although it calls unref
internally) is not sufficient because this is releasing the reference
that the list owns.

Closes #1774
2019-05-09 12:57:00 +02:00
Philip Withnall
a1d5395f10 Merge branch 'autoptr-assertions' into 'master'
Various minor cleanups to autoptrs

See merge request GNOME/glib!821
2019-05-08 20:51:58 +00:00
Sebastian Dröge
6ce96382d3 Merge branch 'unicode-12.1' into 'master'
glib: Update Unicode Character Database to version 12.1.0

See merge request GNOME/glib!822
2019-05-08 20:48:41 +00:00
Philip Withnall
5a30f852d6 docs: Improve formatting of g_autoptr() documentation
Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-08 21:21:39 +01:00
Philip Withnall
62be3d5d3e tests: Use g_assert_*() in autoptr tests rather than g_assert()
It gives clearer failure messages, and won’t get compiled out when
building with G_DISABLE_ASSERT.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-08 21:21:39 +01:00
Philip Withnall
ae47f0d156 Merge branch 'more-auto-macros' into 'master'
Add g_autoqueue

See merge request GNOME/glib!474
2019-05-08 20:19:43 +00:00
Marco Trevisan (Treviño)
1d96e94070 gmacros: Add g_autoqueue to automatically free queues
This works as g_auto(s)list already does, and allows to create queues that are
fully auto free'd on destruction.
2019-05-08 14:25:24 -05:00
Philip Withnall
babe5cdf5e Merge branch 'g_unichar_isxdigit_full_width' into 'master'
Getting fullwidth unichar for g_unichar_xdigit(_value)

Closes #58

See merge request GNOME/glib!771
2019-05-08 12:19:30 +00:00
Philip Withnall
64ddd32b79 glib: Update Unicode Character Database to version 12.1.0
Using commands:
```
glib/gen-unicode-tables.pl -both 12.1.0 path/to/UCD
tests/gen-casefold-txt.py 12.1.0 path/to/UCD/CaseFolding.txt \
   > tests/casefold.txt
tests/gen-casemap-txt.py 12.1.0 path/to/UCD/UnicodeData.txt \
   path/to/UCD/SpecialCasing.txt > tests/casemap.txt
```

Using UCD release https://www.unicode.org/Public/zipped/12.1.0/UCD.zip.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
2019-05-08 13:07:55 +01:00
Emmanuele Bassi
47bcc6d852 Merge branch 'ci-report-debian-stable' into 'master'
ci: Keep JUnit report script working on Debian stable

See merge request GNOME/glib!820
2019-05-08 11:56:09 +00:00
Emmanuele Bassi
db849efc2a ci: Keep JUnit report script working on Debian stable
The current Debian stable CI image ships with Python 3.5, so the Meson
log to JUnit report script is failing because it's using an API addition
present in Python 3.6 or later.

Since it's just a cosmetic option for the time stamp, we can get rid of
it.
2019-05-08 12:40:45 +01:00