On 10 May 2011 23:02, Greg Smith <g...@2ndquadrant.com> wrote: > Why crash there only on Windows? Was the problem actually introduced above > this part of the code? These are all questions I have no answer for.
I don't find it at all surprising that there's a memory corruption bug that only manifests itself on Windows. Recently, I reported a bug in pgAdmin that turned out to be a simple case of forgetting to allocate an extra byte of memory for a null in a c string. The outward problem couldn't be reproduced on Mac - it only occurred on Linux. Of course, the problem with undefined behaviour is not that it might cause your program to crash, but that it might not cause your program to crash. For debug builds, Visual C++ allocates "no man's land" guard bytes on either side of areas of allocated memory, which is great for catching heap corruption bugs. My guess is that when the VC++ debugger issues a breakpoint, that's exactly where the memory is being corrupted/improperly dereferenced. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers