Skip to content

Conversation

dongcarl
Copy link
Contributor

@dongcarl dongcarl commented May 20, 2019

I've done a Gitian build on my local machine and the symbol tests seem to pass.

@maflcko
Copy link
Member

maflcko commented May 20, 2019

ACK 3b549f4 (checked diff with --ignore-all-space, and verified that thread_local is now disabled on freebsd)

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

ACK 3b549f4aae9bc5f5f9e9dee8476523daf44dd7ee (checked diff with --ignore-all-space, and verified that thread_local is now disabled on freebsd)
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUhhlwwAp1D8oI5zuBCaduML4SFgcShnTo6EeWUN6VrVQDj0Ja4d2iEvgog3iJP1
+KMwj0frmEKmoBxOSW3b72iTPRWT/TeYXgp/PgqAIvy8E+K6CCIdDyBY+c/2iZTc
PSN/GnDkHGNhJ8Cx+RCgB4Io6/df+44XgpvLNzBrFeLkuZhSE0RuzzwIG9NJ3lpY
AEI/OAsiAZLZP23scVqo7z3T9rYM0uUtW5XpW98eJSYlQ+JFe0DE7/oKyeETqVRE
GZ6XtAf+rVEZ/8awa7QBcfFmQ2qxYNQGPewudTVRR9//PhFBn2jCvmqDvg26+zA6
CAkDDcfQb4NLIjvnviZxkQhaXUPdc+PaefCD6Pzx1qL0bUsY2zIUYnw1fV8uZ69K
YTZBewMyJRDQE8oz0NB+9xSpftG8yUlY2H4Xrwo9IEBfGwGsITAc1dv61lfrGrDO
hGC3bE8ucDb+IaClCtrBS3sOyxqRfS3BjrgjkmA4QUJYyXLsyvNYZeTWpcfhKopm
83ydESNX
=eGHB
-----END PGP SIGNATURE-----

Timestamp of file with hash cb3987fa66dbad9cd23f72f8b0cb42d860ccda592d0a20757c01c728c5eadf2e -

Copy link
Contributor

@jamesob jamesob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 3b549f4

To confirm: use_glibc_compat is by default disabled, correct?

@dongcarl
Copy link
Contributor Author

@jamesob

To confirm: use_glibc_compat is by default disabled, correct?

Correct!

bitcoin/configure.ac

Lines 191 to 195 in 2d1583e

AC_ARG_ENABLE([glibc-back-compat],
[AS_HELP_STRING([--enable-glibc-back-compat],
[enable backwards compatibility with glibc])],
[use_glibc_compat=$enableval],
[use_glibc_compat=no])

@theuni
Copy link
Member

theuni commented May 20, 2019

Concept ACK, but I think that the logic here is complex enough that an --enable-threadlocal is necessary so that it can be chosen explicitly.

@dongcarl
Copy link
Contributor Author

dongcarl commented May 20, 2019

@theuni

Concept ACK, but I think that the logic here is complex enough that an --enable-threadlocal is necessary so that it can be chosen explicitly.

As in:

  1. Keep my current changes, add a --enable-threadlocal flag that will enable thread_local regardless of what --enable-glibc-back-compat says?
  2. Or... Keep my current changes, add a --enable-threadlocal flag that will fail the configure if --enable-glibc-back-compat is also there?
  3. Or... Remove the use_glibc_compat <-> thread_local interaction, add a --enable-threadlocal flag that will enable thread_local?

@maflcko
Copy link
Member

maflcko commented May 20, 2019

I think it is nice to have thread_local enabled by default on the generic "64-bit Ubuntu Bionic" (and similar) environments. Thread names give developers additional debug information.

@ryanofsky
Copy link
Contributor

Option (1) is the way to go. If a user passes explicitly passes --enable-threadlocal or --disable-threadlocal, it should enable or disable thread local code respectively, regardless of other options. If neither is specified, it should choose an intelligent default based on the platform and maybe based on --glibc-back-compat.

@theuni
Copy link
Member

theuni commented May 20, 2019

Option (1) is the way to go. If a user passes explicitly passes --enable-threadlocal or --disable-threadlocal, it should enable or disable thread local code respectively, regardless of other options. If neither is specified, it should choose an intelligent default based on the platform and maybe based on --glibc-back-compat.

+1

Thread names give developers additional debug information.

They had thread names before thread_local :)

@jamesob
Copy link
Contributor

jamesob commented May 20, 2019

They had thread names before thread_local :)

I think @MarcoFalke is referring to the [threadname] prefixes on each log line, which did not exist before the merge of #15849.

@dongcarl dongcarl force-pushed the 2019-05-fix-thread_local-compat branch from 3b549f4 to caaa942 Compare May 20, 2019 21:23
@dongcarl
Copy link
Contributor Author

Implemented logic as documented here: #16059 (comment)

@DrahtBot
Copy link
Contributor

Gitian builds for commit 2d1583e (master):

Gitian builds for commit 256e353 (master and this pull):

@DrahtBot
Copy link
Contributor

Gitian builds for commit 3001cc6 (master):

Gitian builds for commit 3f02161 (master and this pull):

@maflcko
Copy link
Member

maflcko commented May 22, 2019

utACK caaa942

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

utACK caaa942a5ff372db723a224c35236df48b93ebcb
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUgOcAwAqOf1q52e0OmUrUy+lg0FHlFZ/F4VXVN/NtRAa7wP1KO+GsQacvFuKlOT
7T9V7KFqdRbj9RsxwXd77ZwXkhA7PDOn5Z8ja4GvnH/Z8KXOOKyPKJF9Bw6qtUH0
7ghGVa1eawGNddId5WQfhdJygwjbuwPZbqkxY3dLW1puXXXV7+RkWnEz6c+eZG2b
zJ84SlRd8BvGDcRqSoSGtH4kwXbfjYwQMk1+wt1j534/UgHq4ubHOPiSq38GMF2X
PmK6LGlG0PO9sU4hV5a62k5aZ0cW22n3HlL6MVTODAkSci7Cfd2Mo84dNC8TevOU
NU+J5wTaqDn84tLKRBWvPdtH3pb1L2WtKVPQ1sVCFrXFsguGnPhKy8r7rB8dgjkz
efLYbXO8vGK1GRTqsFsyAsxi7/AMS4PyIG19nnazGw2WmVIqcRp7D6ZTE+uEpCyV
Z7cB4UgtZo9MdrwJqmjkbHXD45NHjxvy5SsXtVRcWzQ2J50BsCn+rfLZxkc484jJ
srQR/1SK
=9lnG
-----END PGP SIGNATURE-----

Timestamp of file with hash 92094b899f3571c01b98c4d14e9586500a17402059ac90ca5200d93dc689eef3 -

@dongcarl
Copy link
Contributor Author

From the @DrahtBot gitian builds, looks like bitcoin-core-linux-0.19-res.ymls are coming back again! 🎉

@sipa
Copy link
Member

sipa commented May 22, 2019

Concept ACK

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK caaa942. Change looks good to me. I just suggested adding some more documentation below. IMO, the glibc-back-compat option is also underdocumented, and is perhaps trying to control too many disparate things. My instinct would be to make the --enable-threadlocal and --enable-glibc-back-compat options independent and just pass them both where needed. But I don't know all the context, and the change seems fine in its present form.

- When aiming for glibc compatibility, don't use thread_local.
- Add a flag --enable-threadlocal, which, when specified, will
  enable/disable thread_local regardless of the value of glibc_compat.
- FreeBSD has a buggy thread_local, don't use it.
@dongcarl dongcarl force-pushed the 2019-05-fix-thread_local-compat branch from caaa942 to 480e341 Compare May 23, 2019 19:16
@dongcarl
Copy link
Contributor Author

Update: better help text.

@maflcko
Copy link
Member

maflcko commented May 24, 2019

utACK 480e341

@fanquake
Copy link
Member

tACK 480e341

macOS:

checking for thread_local support... no
src/bitcoind -logthreadnames=1
2019-05-23T20:27:48Z [] Bitcoin Core version v0.18.99.0-480e3415d (release build)
2019-05-23T20:27:48Z [] Assuming ancestors of block 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee have valid signatures.

openBSD 6.4:

checking for thread_local support... yes
./src/bitcoind -logthreadnames=1
2019-05-23T20:41:11Z [init] mapBlockIndex.size() = 1
2019-05-23T20:41:11Z [loadblk] Failed to open mempool file from disk. Continuing anyway.
......
2019-05-23T20:41:58Z [shutoff] [default wallet] Releasing wallet
2019-05-23T20:41:58Z [shutoff] Shutdown: done

FreeBSD 12.0:

checking for thread_local support... no
src/bitcoind -logthreadnames=1
2019-05-24T16:06:38Z [] Bitcoin Core version v0.18.99.0-480e3415d (release build)
2019-05-24T16:06:38Z [] Assuming ancestors of block 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee have valid signatures.

Debian 9.9:

checking for thread_local support... yes
src/bitcoind -logthreadnames=1
src/bitcoind -logthreadnames=1
2019-05-24T17:07:14Z [init] Bitcoin Core version v0.18.99.0-480e3415d (release build)
2019-05-24T17:07:14Z [init] Assuming ancestors of block 0000000000000000000f1c54590ee18d15ec70e68c8cd4cfbadb1b4f11697eee have valid signatures.

@maflcko maflcko merged commit 480e341 into bitcoin:master May 25, 2019
maflcko pushed a commit that referenced this pull request May 25, 2019
480e341 configure: Add flag for enabling thread_local. (Carl Dong)

Pull request description:

  - When aiming for glibc compatibility, don't use thread_local. Fixes #15958.
  - FreeBSD has a buggy thread_local, don't use it. Fixes #16055.

  I've done a Gitian build on my local machine and the symbol tests seem to pass.

ACKs for commit 480e34:
  MarcoFalke:
    utACK 480e341
  fanquake:
    tACK 480e341

Tree-SHA512: 334f21f7cf271c261b115a6410afd4ed4db3e84ad79b98c6c684c1dfa42b081f16d58e77695929e27b0fa173a894b959a327fe82821a3f3ed708b305a906ddd3
laanwj added a commit that referenced this pull request Apr 22, 2020
… not work

b91e4ae Do not expose and consider -logthreadnames when it does not work (Hennadii Stepanov)

Pull request description:

  There are conditions when the `HAVE_THREAD_LOCAL` macro is undefined what causes the `-logthreadnames` option does not work -- instead of thread names empty strings `[]` only are printed in the `debug.log` file.

  This PR does not exposes the `-logthreadnames` option in such cases.

  Refs:
  - #16059
  - #18652

ACKs for top commit:
  MarcoFalke:
    ACK b91e4ae, looked at the diff, didn't test

Tree-SHA512: 3bd58e5ea603c69686589ddc94d6fa441cab4f712004378f2f1661e12638804ca03cfb6426e6393e55b6a095b325f3161d3c5371af05d7fc79d6d328227bf40c
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 23, 2020
…it does not work

b91e4ae Do not expose and consider -logthreadnames when it does not work (Hennadii Stepanov)

Pull request description:

  There are conditions when the `HAVE_THREAD_LOCAL` macro is undefined what causes the `-logthreadnames` option does not work -- instead of thread names empty strings `[]` only are printed in the `debug.log` file.

  This PR does not exposes the `-logthreadnames` option in such cases.

  Refs:
  - bitcoin#16059
  - bitcoin#18652

ACKs for top commit:
  MarcoFalke:
    ACK b91e4ae, looked at the diff, didn't test

Tree-SHA512: 3bd58e5ea603c69686589ddc94d6fa441cab4f712004378f2f1661e12638804ca03cfb6426e6393e55b6a095b325f3161d3c5371af05d7fc79d6d328227bf40c
linuxsh2 pushed a commit to linuxsh2/dash that referenced this pull request Aug 11, 2021
480e341 configure: Add flag for enabling thread_local. (Carl Dong)

Pull request description:

  - When aiming for glibc compatibility, don't use thread_local. Fixes bitcoin#15958.
  - FreeBSD has a buggy thread_local, don't use it. Fixes bitcoin#16055.

  I've done a Gitian build on my local machine and the symbol tests seem to pass.

ACKs for commit 480e34:
  MarcoFalke:
    utACK 480e341
  fanquake:
    tACK 480e341

Tree-SHA512: 334f21f7cf271c261b115a6410afd4ed4db3e84ad79b98c6c684c1dfa42b081f16d58e77695929e27b0fa173a894b959a327fe82821a3f3ed708b305a906ddd3
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
8 participants