Skip site navigation (1) Skip section navigation (2)

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

From: "Sagi Bashari" <sagi(at)adamnet(dot)co(dot)il>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2120: Crash when doing UTF8<->ISO_8859_8 encoding conversion
Date: 2005-12-21 12:18:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugspgsql-patches
The following bug has been logged online:

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

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 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):

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

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/
#2  0x0823a41c in LocalToUtf ()
#3  0x40df8909 in iso8859_to_utf8 () from
#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 ()


pgsql-bugs by date

Next:From: Tom LaneDate: 2005-12-21 15:53:39
Subject: Better path-matching for package relocatability (was Re: horology regression test failure)
Previous:From: Martin PittDate: 2005-12-21 08:38:12
Subject: Re: horology regression test failure

pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-12-21 13:17:46
Subject: Re: COPY LOCK for WAL bypass
Previous:From: Hannu KrosingDate: 2005-12-21 07:50:03
Subject: Re: status of concurrent VACUUM patch ...

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group