Unix Technical Forum

BUG #3866: Segfault during table update when using convert_from()

This is a discussion on BUG #3866: Segfault during table update when using convert_from() within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 3866 Logged by: Andrew Gilligan Email address: andy@tcpd.net PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 11:14 AM
Andrew Gilligan
 
Posts: n/a
Default BUG #3866: Segfault during table update when using convert_from()


The following bug has been logged online:

Bug reference: 3866
Logged by: Andrew Gilligan
Email address: andy@tcpd.net
PostgreSQL version: 8.3RC1
Operating system: FreeBSD 4.11
Description: Segfault during table update when using convert_from()
Details:

Greetings,

It seems there exists a bug in the way character set conversion
is handled in some circumstances.

Running the test below results in the server (8.3RC1) segfaulting
every time. I haven't fully explored the extent, but it exists
with (at least) LATIN2 and LATIN9 conversion.

The database and client encoding are both UTF8.

Best regards,
-Andy

-- test case --
test=# CREATE TABLE t (id int, geo text);
CREATE TABLE
test=# INSERT INTO t (id, geo) VALUES (1,
convert_from(decode('50696f74726bf3772c20506f6c616 e64','hex'), 'LATIN9'));
INSERT 0 1
test=# UPDATE t SET geo =
convert_from(decode('50696f74726bf3772c20506f6c616 e64','hex'), 'LATIN9');
UPDATE 1
-- more than 1 row is needed to trigger the error
test=# INSERT INTO t (id, geo) VALUES (2,
convert_from(decode('50696f74726bf3772c20506f6c616 e64','hex'), 'LATIN9'));
INSERT 0 1
test=# UPDATE t SET geo =
convert_from(decode('50696f74726bf3772c20506f6c616 e64','hex'), 'LATIN9');
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 11:14 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #3866: Segfault during table update when using convert_from()

"Andrew Gilligan" <andy@tcpd.net> writes:
> It seems there exists a bug in the way character set conversion
> is handled in some circumstances.


Seems to be the bogus pfree() in pg_convert_from() that's causing
the problem :-(. Take that out and you should be OK.

Thanks for the report!

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 11:14 AM
Andrew Gilligan
 
Posts: n/a
Default Re: BUG #3866: Segfault during table update when using convert_from()


On 9 Jan 2008, at 23:45, Tom Lane wrote:

> "Andrew Gilligan" <andy@tcpd.net> writes:
>> It seems there exists a bug in the way character set conversion
>> is handled in some circumstances.

>
> Seems to be the bogus pfree() in pg_convert_from() that's causing
> the problem :-(. Take that out and you should be OK.


That's exactly it, thanks... Everything seems fine now.

The fix is trivial, so not sure if a patch is even warranted, but
I've attached the changes just in case.

Best regards,
-Andy






---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:32 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com