ned Productions Consulting


Technology musings by Niall Douglas
ned Productions Consulting
(an expert advice and services company based in Ireland)


Monday 27th January 2014 3.48am

Link shared: https://ci.nedprod.com/job/Boost.AFIO%20Valgrind%20Linux%20GCC%204.8/143/valgrindResult/pid=31061,0x0/

It's half three in the morning and I spent much of today replacing Boost.AFIO's use of std::packaged_task<> with a custom implementation which is much faster and simplifies the internals, plus removes a chicken-and-egg block on the next feature I intend to add. Unfortunately, there is something wrong with my new custom implementation - basically, on Linux only and on the Jenkins CI only it shows a timing race condition which definitely wasn't there in the old code. Irritatingly I can't replicate it on my bog slow Intel Atom 220 netbook which is the only computer I have here until the stuff from Canada arrives, so I have to debug it via the CI over SSH to Canada over a shaky 3G mobile data connection seeing as we're out in the sticks here in rural Ireland. Anyway, I'm getting pretty tired, so I think it's pretty much bedtime for me, let's hope clarity appears tomorrow!

Edit: I found the problem, I had an errant std::move() in an obscure part of the code which was rarely resetting a shared_ptr<> to null if and only if the compiler fully supports C++11 rvalue ref semantics. That's why MSVC and therefore my Intel Atom didn't show the bug, because even VS2013 still doesn't fully implement C++11 rvalue ref semantics, but GCC 4.8 on Linux does. So there you go - bitten by a new language feature!