The following code: ```` private unittest { import core.vararg, std.stdio; void fix() {} void test_bug(size_t bug, ...) { assert(bug == size_t.max); } void test_fixed(size_t bug, ...) { fix(); assert(bug == size_t.max); } void print_bug(size_t bug, ...) { writeln(bug); assert(bug == size_t.max); } void print_fix(size_t bug, ...) { fix(); writeln(bug); assert(bug == size_t.max); } print_bug(size_t.max); print_fix(size_t.max); test_fixed(size_t.max); test_bug(size_t.max); } ```` Will trigger an unittest when put any Phobos module (for simplicity, I tested std.algorithm). Example: ```` make[1]: Leaving directory '/mnt/shared/projects/dlang/druntime' 140734760252720 18446744073709551615 ****** FAIL std.algorithm core.exception.AssertError@std/algorithm.d(417): Assertion failure ---------------- generated/linux/release/64/unittest/libphobos2-ut.so(+0x28fb8e1) [0x7f2bf2fcd8e1] ```` As you see, the parameters passed during the first function call inside that function are wrong. I only appears with 64 bits parameters (including string). I couldn't find any stand-alone snippet that reproduce the error. My guess is that it might originate from the way it's tested (shared library), but I currently lack the time to investigate further. The issue was originally found in https://github.com/D-Programming-Language/phobos/pull/2677 This also outline the fact that variadic functions are poorly tested in Phobos.
The following: void main() { import core.vararg, std.stdio; void fix() {} void test_bug(size_t bug, ...) { assert(bug == size_t.max); } void test_fixed(size_t bug, ...) { fix(); assert(bug == size_t.max); } void print_bug(size_t bug, ...) { writeln(bug); assert(bug == size_t.max); } void print_fix(size_t bug, ...) { fix(); writeln(bug); assert(bug == size_t.max); } print_bug(size_t.max); print_fix(size_t.max); test_fixed(size_t.max); test_bug(size_t.max); } works without error.
Indeed, I cannot reproduce anymore, be it on OSX or Linux. Closing as WORKSFORME.