7.1 devel and initdb core dumps - Mailing list pgsql-general

From Jarmo Paavilainen
Subject 7.1 devel and initdb core dumps
Date
Msg-id 009401c03867$05f1e620$1501a8c0@theboss.comder.private
Whole thread Raw
List pgsql-general
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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: vacuums failing
Next
From: "Enrico Comini"
Date:
Subject: DOUBLE MESSAGE