Commit graph

13 commits

Author SHA1 Message Date
cdb3d3045a BUG: Clang shows a problem when accessing templated static variable through separate compilation units
this is really creepy: the same(!) instance of the singleton factory
sees different addresses of the class static variable, depending on
the compilation unit.

Please note that the type of the concrete factory function is *erased*
when exiting the constructor function of ConfigurableHolder
2013-10-06 23:17:18 +02:00
4bd9eeb8ee bughunt: re-create the whole 2nd layer with a configurable product type --> HIT
Now we've reprduced the problematic situation in isolation
2013-10-06 23:17:18 +02:00
675b2070ce bughunt: attempt to rebuild the problematic structure stand-alone... --> MISS
this is only a stripped-down version of the basic singleton, without
the indirection. Unsurprisingly, this doesn't exhibit the problem yet
2013-10-06 23:17:18 +02:00
0e8a1f1e08 bughunt: use a single SingletonSub instance in two compilation units --> HIT
basically this reproduces the problem in a simplified setup.
Especially note that we're going through a single instance of the factory,
yet still this single instance 'sees' two different locations of the
class static variable
2013-10-06 23:17:18 +02:00
72bd94e141 bughunt: replace the ConfigResolver with a direct instantiation of Singleton -> MISS
thus not lib::Singleton is the culprit, it must be lib::SingletonSubclass
2013-10-06 23:17:18 +02:00
10a511d29c bughunt: build testcase statically linked
...but still dynamically linking against the core lib
But the actual template instantiations happen now within the two
compilation units, which are linked statically.

When looking into the symbol table, we can see that the static
field is emitted two times

readelf -W target/clang-static-init -s | c++filt |less
2013-10-06 23:17:18 +02:00
cec78fdc58 bughunt: extract a call sequence leading to a strange init error with Clang
Observations:
 - the initial observation was that we get two instances of the config rules service
 - obviously this it is *not* the initialisation of a static variable accessed from
    multiple compilation units. But the access from two compilation units is crucial
 - we can exclude the effect of all other initialisation. It *is* in SingletonSubclass
 - we can exclude the effect of dynamic linking. Even two translation units
    linked statically exhibit the same problem

rebuild this test case in the research area, to be able to verify with various compilers
2013-10-06 23:17:18 +02:00
d2f83523ca join recent player subsystem work, SCons overhaul and documentation 2012-01-11 07:54:43 +01:00
f84da63e11 use import/export instead of passing an artefacts map 2012-01-11 07:05:00 +01:00
9bba366763 investigate partial application of member functions 2012-01-07 03:28:12 +01:00
c134026502 for experimenting with -O3 2012-01-07 02:53:07 +01:00
e054c272b6 research: detecting the possibility of a string conversion
find out about the corner cases of this
simplistic implementation
2011-12-31 06:46:50 +01:00
07002ab3af SCons: new build target for experimental code 2011-12-03 06:10:12 +01:00