bench: Fix initialization order in registration #9712

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2017_02_fiasco changing 2 files +10 −9
  1. laanwj commented at 6:09 PM on February 7, 2017: member

    The initialization order of global data structures in different implementation units is undefined. Making use of this is essentially gambling on what the linker does, the so-called Static initialization order fiasco.

    In this case it apparently worked on Linux but failed on OpenBSD and FreeBSD.

    To create it on first use, make the registration structure local static to a function.

    Fixes #8910. (tested on Linux, OpenBSD, FreeBSD)

  2. bench: Fix initialization order in registration
    The initialization order of global data structures in different
    implementation units is undefined. Making use of this is essentially
    gambling on what the linker does, the so-called [Static initialization
    order fiasco](https://isocpp.org/wiki/faq/ctors#static-init-order).
    
    In this case it apparently worked on Linux but failed on OpenBSD and
    FreeBSD.
    
    To create it on first use, make the registration structure local to
    a function.
    
    Fixes #8910.
    29c53289a9
  3. laanwj added the label Tests on Feb 7, 2017
  4. laanwj added this to the milestone 0.14.0 on Feb 7, 2017
  5. MarcoFalke commented at 6:45 PM on February 7, 2017: member

    utACK 29c53289a9e6bb34a098ea87d923968e3ac6d75d

    On Tue, Feb 7, 2017 at 7:09 PM, Wladimir J. van der Laan notifications@github.com wrote:

    The initialization order of global data structures in different implementation units is undefined. Making use of this is essentially gambling on what the linker does, the so-called Static initialization order fiasco.

    In this case it apparently worked on Linux but failed on OpenBSD and FreeBSD.

    To create it on first use, make the registration structure local static to a function.

    Fixes #8910.


    You can view, comment on, or merge this pull request online at:

    #9712

    Commit Summary

    bench: Fix initialization order in registration

    File Changes

    M src/bench/bench.cpp (16) M src/bench/bench.h (3)

    Patch Links:

    #9712.patch #9712.diff

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

  6. TheBlueMatt commented at 6:56 PM on February 7, 2017: member

    utACK 29c53289a9e6bb34a098ea87d923968e3ac6d75d

  7. paveljanik commented at 7:37 PM on February 7, 2017: contributor
  8. jtimon commented at 11:35 PM on February 7, 2017: contributor

    utACK 29c5328

  9. MarcoFalke merged this on Feb 8, 2017
  10. MarcoFalke closed this on Feb 8, 2017

  11. MarcoFalke referenced this in commit d304fef374 on Feb 8, 2017
  12. codablock referenced this in commit 6b2de5472b on Jan 19, 2018
  13. codablock referenced this in commit f1cbc40b3e on Jan 23, 2018
  14. andvgal referenced this in commit 5ebbe43f4d on Jan 6, 2019
  15. CryptoCentric referenced this in commit 419842f2d7 on Feb 27, 2019
  16. zkbot referenced this in commit aa225ebb0b on Jan 24, 2020
  17. zkbot referenced this in commit 74ff73abab on Jan 24, 2020
  18. furszy referenced this in commit 4ed15cc69d on Jun 8, 2020
  19. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me