glibc/iconv
Arjun Shankar c5288d378a Remove unnecessary locking when reading iconv configuration [BZ #22062]
In iconv/gconv_conf.c, __gconv_get_path unnecessarily obtains a lock when
populating the array pointed to by __gconv_path_elem. The locking is not
necessary because all calls to __gconv_read_conf (which in turn calls
__gconv_get_path) are serialized using __libc_once.

This patch:
- removes all locking in __gconv_get_path;
- replaces all explicitly serialized __gconv_read_conf calls with calls to
  __gconv_load_conf, a new wrapper that is serialized internally;
- adds a new test, iconv/tst-iconv_mt.c, to exercise iconv initialization,
  usage, and cleanup in a multi-threaded program;
- indents __gconv_get_path correctly, removing tab characters (which makes
  the patch look a little bigger than it really is).

After removing the unnecessary locking, it was confirmed that the test case
fails if the relevant __libc_once is removed. Additionally, four localedata
and iconvdata tests also fail. This gives confidence that the testsuite
sufficiently guards against some regressions relating to multi-threading
with iconv.

Tested on x86_64 and i686.
2018-10-17 17:47:29 +02:00
..
dummy-repertoire.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_builtin.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_builtin.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_cache.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_charset.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_close.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_conf.c Remove unnecessary locking when reading iconv configuration [BZ #22062] 2018-10-17 17:47:29 +02:00
gconv_db.c Remove unnecessary locking when reading iconv configuration [BZ #22062] 2018-10-17 17:47:29 +02:00
gconv_dl.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_int.h Remove unnecessary locking when reading iconv configuration [BZ #22062] 2018-10-17 17:47:29 +02:00
gconv_open.c Clean up iconv/gconv_int.h for unnecessary declarations 2018-09-25 15:13:15 +02:00
gconv_simple.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv_trans.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
gconv.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
iconv_charmap.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
iconv_close.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
iconv_open.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
iconv_prog.c Update copyright dates not handled by scripts/update-copyrights. 2018-01-01 00:41:16 +00:00
iconv_prog.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
iconv.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
iconv.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
iconvconfig.c Update copyright dates not handled by scripts/update-copyrights. 2018-01-01 00:41:16 +00:00
iconvconfig.h Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
loop.c Fix s390 -Os iconv build. 2018-03-05 21:46:55 +00:00
Makefile Remove unnecessary locking when reading iconv configuration [BZ #22062] 2018-10-17 17:47:29 +02:00
skeleton.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
strtab.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
test-gconv-modules Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tst-gconv-init-failure-mod.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tst-gconv-init-failure.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tst-iconv1.c Modify several tests to use test-skeleton.c 2014-11-05 15:24:08 +05:30
tst-iconv2.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tst-iconv3.c Convert tst-iconv3 to use test-skeleton. 2015-02-25 16:01:13 -08:00
tst-iconv4.c
tst-iconv5.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tst-iconv6.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
tst-iconv-mt.c Remove unnecessary locking when reading iconv configuration [BZ #22062] 2018-10-17 17:47:29 +02:00
Versions Complete the removal of __gconv_translit_find 2014-09-12 09:17:32 +02:00