Re: [BUGS] libpq causes segfault when share library unloaded
В списке pgsql-bugs по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: [BUGS] libpq causes segfault when share library unloaded |
| Дата | |
| Msg-id | 28739.941764598@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | libpq causes segfault when share library unloaded (Jim Studt <jim@federated.com>) |
| Список | pgsql-bugs |
Jim Studt <jim@federated.com> writes:
> libpq will define an environment variable for PGCLIENTENCODING if
> none is specified. If libpq is a shared library that is dynamically
> loaded, and it is subsequently unloaded then it leaves an entry in
> the environ array pointing into unmapped memory which will cause
> a segfault the next time the environment array is traversed.
Hmm. Dynamically unloading a library can cause all sorts of problems,
of course, but the particular code you're complaining of is pretty
bletcherous anyway --- it's using a fixed-size buffer which seems mighty
risky. I'm inclined to make it put the putenv() string into a malloc'd
buffer instead. Would that solve the problem in your environment?
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера