Re: Infinity bsearch crash on Windows

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Infinity bsearch crash on Windows
Дата
Msg-id BANLkTi=3gEMxbA=Safnd010Kjk9FaFmTdg@mail.gmail.com
обсуждение исходный текст
Ответ на Infinity bsearch crash on Windows  (Greg Smith <greg@2ndQuadrant.com>)
Список pgsql-hackers
On 10 May 2011 23:02, Greg Smith <greg@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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "MauMau"
Дата:
Сообщение: Re: Feature proposal: distinguish each PostgreSQL instance in the event log
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Feature proposal: distinguish each PostgreSQL instance in the event log