Re: libpd - PQfinish() - crashes client application in some cases
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: libpd - PQfinish() - crashes client application in some cases |
| Дата | |
| Msg-id | 19053.1000677182@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | libpd - PQfinish() - crashes client application in some cases ("Jean-Michel.chabanne" <jeanmichel.chabanne@free.fr>) |
| Список | pgsql-bugs |
"Jean-Michel.chabanne" <jeanmichel.chabanne@free.fr> writes:
> ... a first call to PQfinish(...) disconnects the client,
> [ PQstatus returns 'CONNECTION_BAD' ], and A SECOND call to PQfinish(..)
> make the client to crash with a system message 'segmentation fault'.
Freeing the same chunk of memory twice leads to a crash in most
implementations of malloc/free :-(. I don't think that libpq can be
expected to protect you from this. Don't PQfinish() the same connection
object more than once, because after the first one it's not a connection
object anymore --- only a dangling pointer to freed memory. For that
matter, you shouldn't call PQstatus() or any other libpq function using
an already-PQfinished connection pointer.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера