Unix Technical Forum

BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding conversion

This is a discussion on BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding conversion within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2120 Logged by: Sagi Bashari Email address: sagi@adamnet.co.il 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, 09:35 AM
Sagi Bashari
 
Posts: n/a
Default BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding conversion


The following bug has been logged online:

Bug reference: 2120
Logged by: Sagi Bashari
Email address: sagi@adamnet.co.il
PostgreSQL version: 8.1.1
Operating system: Debian Sarge
Description: Crash when doing UTF8<->ISO_8859_8 encoding conversion
Details:

Postgresql crashes when a client with ISO_8859_8 encoding tries to select
data from a utf8 database.

I have compiled postgresql 8.1.1 from scratch with the following commands:
../configure --prefix=/home/sagi/temp/pgtest --enable-debug
make
make install
mkdir /home/sagi/temp/pgtest/data
/home/sagi/temp/pgtest/bin/initdb -D /home/sagi/temp/pgtest/data/
/home/sagi/temp/pgtest/bin/postmaster -D /home/sagi/temp/pgtest/data

Created a utf8 database:
../createdb test -E utf8

And ran 'SET client_encoding = 'ISO_8859_8'; SELECT 'שלום';' inside
`psql test`.

That's ISO_8859_8 hebrew text inside the SELECT. Here's a file containing
the query (incase the mail breaks it):
http://future.adamnet.co.il/~sagi/temp/enc.sql

Psql returned the following message:
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

The database log:
LOG: server process (PID 1290) was terminated by signal 11

Backtrace:
Core was generated by `postgres: sagi test [local] idle
'.
Program terminated with signal 11, Segmentation fault.

#0 0x0823a1a6 in compare2 ()
#1 0x40100b52 in bsearch () from /lib/libc.so.6
#2 0x0823a41c in LocalToUtf ()
#3 0x40df8909 in iso8859_to_utf8 () from
/home/sagi/temp/pgtest/lib/postgresql/utf8_and_iso8859.so
#4 0x08233112 in FunctionCall5 ()
#5 0x0823adc8 in perform_default_encoding_conversion ()
#6 0x0823acd3 in pg_client_to_server ()
#7 0x081508d4 in pq_getmsgstring ()
#8 0x081b924e in PostgresMain ()
#9 0x08191b1c in BackendRun ()
#10 0x08191565 in BackendStartup ()
#11 0x0818f7c1 in ServerLoop ()
#12 0x0818eb5a in PostmasterMain ()
#13 0x08150e0e in main ()

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:35 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding conversion

"Sagi Bashari" <sagi@adamnet.co.il> writes:
> Postgresql crashes when a client with ISO_8859_8 encoding tries to select
> data from a utf8 database.


It looks like somebody rearranged the pg_enc enum without bothering to
fix the tables that are affected by this.

utf8_and_iso8859.c is certainly broken, and I'm wondering what else
might be. Tatsuo, can you think of any other places to look?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:35 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding conversion

Tatsuo Ishii <ishii@sraoss.co.jp> writes:
>> It looks like somebody rearranged the pg_enc enum without bothering to
>> fix the tables that are affected by this.


> I will look into this.


Thank you. It might be worth adding a comment to pg_wchar.h listing all
the places that need to be fixed when enum pg_enc changes.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 09:35 AM
Tatsuo Ishii
 
Posts: n/a
Default Re: BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding

> > "Sagi Bashari" <sagi@adamnet.co.il> writes:
> > > Postgresql crashes when a client with ISO_8859_8 encoding tries to select
> > > data from a utf8 database.

> >
> > It looks like somebody rearranged the pg_enc enum without bothering to
> > fix the tables that are affected by this.
> >
> > utf8_and_iso8859.c is certainly broken, and I'm wondering what else
> > might be. Tatsuo, can you think of any other places to look?

>
> I will look into this.


Quick check reveals that ISO-8859-5 to ISO-8859-8 are broken.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

---------------------------(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
  #5 (permalink)  
Old 04-10-2008, 09:35 AM
Tatsuo Ishii
 
Posts: n/a
Default Re: BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding

> "Sagi Bashari" <sagi@adamnet.co.il> writes:
> > Postgresql crashes when a client with ISO_8859_8 encoding tries to select
> > data from a utf8 database.

>
> It looks like somebody rearranged the pg_enc enum without bothering to
> fix the tables that are affected by this.
>
> utf8_and_iso8859.c is certainly broken, and I'm wondering what else
> might be. Tatsuo, can you think of any other places to look?


I will look into this.
--
Tatsuo Ishii
SRA OSS, Inc. Japan

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

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:44 PM.


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