Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Strange results with Australia/Brisbane and Asia/Dubai #8
At https://github.com/glasserc/weird-tzs I have pushed a test program that demonstrates a strange behavior that we saw in production. It takes the date 2015-11-23 midnight in Brisbane and converts it to UTC. On my machine, its output is:
Compare with the output if you change Brisbane to Sydney:
Certain timezones seem to be affected by this. Asia/Dubai is and Asia/Singapore is, but Asia/Baku isn't.
Interestingly, running the same code in the repl behaves correctly:
Any idea what's going on? This showed up after we switched from tzdata + timezone-series to tzdata + tz.
Sure. The thing is, it was accessing past the end of a vector. And what happens to be there depends on how the allocator works and what kind of things does the program allocates, when etc. And, the allocator in a compiled Haskell program works quite differently from the interpreter (mostly because of the optimizations, but the interpreter allocates some additional stuff too).
And so, it works deterministically (mostly?) in both cases, but the comparison in the