On 8.1.2005, at 01:59, Joseph Tam wrote:
Subsequent versions still crashed and I looked into the problem further. Specifically it crashes at this line
offset = *((const uint64_t *)data);
when "data" assumes a non-64 bit aligned value. At first I thought that 64-bit ints should always be aligned on 64-bit boundaries, but when I isolated this code into a standalone executable to demonstrate it (no arguments to cause a crash, one argument is OK):
The bug is that the data pointer in there should always be 64bit aligned. There exists code which tries to keep it 64bit aligned, but apparently there's a bug somewhere. I haven't yet tried to find it. So many other things to do..
They claim that this casting violates ISO aliasing rules and the results like crashing are to be expected. Maybe this statement ought to be rewritten
memcpy(&offset,data,sizeof(uint64_t));
That's a good workaround until it's really fixed.