Benchmark && static initialisation order fiasco #18

Closed
BenPope opened this Issue Oct 30, 2012 · 1 comment

Comments

Projects
None yet
4 participants
@BenPope

BenPope commented Oct 30, 2012

It seems to me that folly::benchmarks (the vector) is subject to static initialisation order fiasco.

All my tests are constructed, "adding them" to benchmarks, and then benchmarks is initialised :(

@tudor

This comment has been minimized.

Show comment Hide comment
@tudor

tudor Oct 30, 2012

Contributor

We'll take a look, thanks for letting us know.

Contributor

tudor commented Oct 30, 2012

We'll take a look, thanks for letting us know.

@ghost ghost assigned andralex Oct 30, 2012

djwatson added a commit that referenced this issue Dec 11, 2014

Fixing static initilize fiasco in Benchmark.cpp
Summary:
Benchmark.cpp code is dependent on initialization order, which leads
to benchmarks not running. The root cause is that on some linkers the code which
adds benchmarks to the benchmarks vector is run before the vector initialization.

The original bug report: #18
See: http://www.parashift.com/c++-faq-lite/static-init-order.html

Test Plan: run benchmark_test and compare result with master output

Reviewed By: andrei.alexandrescu@fb.com, njormrod@fb.com

Subscribers: trunkagent, sdwilsh, folly-diffs@

FB internal diff: D1710588

Signature: t1:1710588:1417468175:fd2705a573cef5c4ff020b60c6aec3d83bcdbbab

@marcinpe marcinpe closed this Jan 25, 2015

@tdauth tdauth referenced this issue Mar 3, 2017

Open

Clang crash #555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment