Re: pg_upgrade segfault (was: pg_migrator segfault)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_upgrade segfault (was: pg_migrator segfault)
Дата
Msg-id 3659.1288725817@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_upgrade segfault (was: pg_migrator segfault)  (hernan gonzalez <hgonzalez@gmail.com>)
Список pgsql-general
hernan gonzalez <hgonzalez@gmail.com> writes:
> In pg_upgrade/controldata.c  , putenv2 function :
>         char       *envstr = (char *) pg_malloc(ctx, strlen(var)
> +  strlen(val) + 1);
>         sprintf(envstr, "%s=%s", var, val);

> Shouldn't it be  "+ 2 " instead of "+ 1" ?

Yup, it sure should.  So probably the reason you're the first one to see
it is that the problem would depend on the exact lengths of the strings
being used here :-(

> But it's not enough to get valgrind happy (It still reports 4 "definitely
> lost" blocks, all from that putenv2 function).

That's expected; those blocks aren't supposed to get freed.

            regards, tom lane

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

Предыдущее
От: hernan gonzalez
Дата:
Сообщение: Re: pg_upgrade segfault (was: pg_migrator segfault)
Следующее
От: Jonathan Tripathy
Дата:
Сообщение: Return key from query