Re: PG crash on simple query, story continues - Mailing list pgsql-general

From Tom Lane
Subject Re: PG crash on simple query, story continues
Date
Msg-id 25590.1057689893@sss.pgh.pa.us
Whole thread Raw
In response to Re: PG crash on simple query, story continues  ("Maksim Likharev" <mlikharev@aurigin.com>)
List pgsql-general
"Maksim Likharev" <mlikharev@aurigin.com> writes:
>             ! I would say very interesting aproach,
>             ! why not just
>         xfrmsize = strxfrm(xfrmstr, NULL, 0);

strxfrm doesn't work that way (and if it did, it would give back a
malloc'd not a palloc'd string).

>         !if error happend, xfrmlen will be (size_t)-1

No it won't; see the man page for strxfrm.

This does raise an interesting thought though: what platform are you on?
It seems to me that we've heard of buggy versions of strxfrm that write
more bytes than they're allowed to, thereby clobbering palloc's data
structures.

            regards, tom lane

pgsql-general by date:

Previous
From: Richard Welty
Date:
Subject: Re: Is Postgres broken in Red Hat 9?
Next
From: Tom Lane
Date:
Subject: Re: SQL Functions and plan time