On Thursday, 7 February 2019 at 03:50:32 UTC, Vladimir Panteleev
wrote:
On Monday, 17 December 2018 at 21:59:59 UTC, JN wrote:
while working on my game engine project, I encountered a DMD
codegen bug. It occurs only when compiling in release mode,
debug works.
Old thread, but FWIW, such bugs can be easily and precisely
reduced with DustMite. In your test script, just compile with
and without the compiler option which causes the bug to
manifest, and check that one works and the other doesn't.
I put together a short article on the DustMite wiki describing
how to do this:
https://github.com/CyberShadow/DustMite/wiki/Reducing-a-bug-with-a-specific-compiler-option
Does it also work for dub projects?
Anyway, I managed to reduce the source code greatly manually:
https://github.com/helikopterodaktyl/repro_d_release/
unfortunately I can't get rid of the dlib dependency. When built
with debug, test outputs [0: Object], with release it outputs [0:
null].
commenting this line out:
f.rotation = Quaternionf.fromEulerAngles(Vector3f(0.0f, 0.0f,
0.0f));
or changing it to:
f.rotation = Quaternionf.identity();
is enough to make release output [0: Object] as well. I guess
dlib is doing something dodgy with memory layout, but I can't see
anything suspicious :(