Обсуждение: 7.1 devel and initdb core dumps

Поиск
Список
Период
Сортировка

7.1 devel and initdb core dumps

От
"Jarmo Paavilainen"
Дата:
Hi,

I think the subject says it all ("7.1 devel and initdb core dumps").

But the fun (?) part is that it works on my work HW (Intel Pii 450 with
256MByte) while it crashes on my test machine (P90MHz with 48 MByte). Other
that the obvious diff they are the same (Redhat 6.0 almost out of the box).
The software compiled on the HW that uses it (copied through a local CVS).

And then to something else, whats wrong with this:

...
    nstr = palloc(len = strlen(string) + 1);
    memcpy(nstr, string, len);

If I wrote it that way postgres gave me an assert (prob. when it freed the
memory), but this worked:

...
    len = strlen(string) + 1;
    nstr = palloc( len+1 ); //    Note the extra space
    memcpy(nstr, string, len);

"nstr" was used as a constant, so it was never changed after the
memcpy(...). I find it odd, very odd.

// Jarmo