Re: [GENERAL] More details on Database corruption

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: g(dot)kousi(at)albourne(dot)com (George Kousi)
Cc: hackers(at)postgreSQL(dot)org (PostgreSQL-development)
Subject: Re: [GENERAL] More details on Database corruption
Date: 1999-03-14 21:21:09
Message-ID: 199903142121.QAA03181@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Here is a bug report from August. The bug still exists.

If you remove the DEFAULT's, it does not crash. If you exit the session
after the UPDATE, and execute SELECT in a new session, it does not crash
and yields the correct results.

The crash happens in the executor, and it clearly shows it getting an
invalid value for the version2 column:

(gdb) print att[3][0]
$12 = {attrelid = 0, attname = {data = "version2", '\000' <repeats 23 times>},
atttypid = 1042, attdisbursion = 0, attlen = -1, attnum = 4, attnelems = 0,
attcacheoff = -1, atttypmod = 10, attbyval = 0 '\000', attisset = 0 '\000',
attalign = 105 'i', attnotnull = 0 '\000', atthasdef = 0 '\000'}
(gdb) print *(struct varlena *)value[3]
$13 = {vl_len = 538976305, vl_dat = " "}

Can anyone suggest a cause?

> Hi,
>
> I managed to recreate a simple example that's crashing postgres. I am
> running on a DEC Alpha with Digital Unix Version 4.0d and Postgres
> 3.2. I tried this example several times, on several databases and it
> crashes every time. We also re-built Postgres and still did not work.
> Here's the example. Can anybody please help?
>
> Thank you...
> George K.
> /***** INPUT FILE: hist.sql *******/
>
> drop table tasks;
> CREATE TABLE tasks (
> task INT4 NOT NULL,
> job INT4 NOT NULL,
> Version1 CHAR(6) DEFAULT '',
> Version2 CHAR(6) DEFAULT '',
> Version3 CHAR(6) DEFAULT '',
> Version4 CHAR(6) DEFAULT '',
> Version5 CHAR(6) DEFAULT ''
> );
>
> INSERT INTO tasks (task, job) VALUES (1, 1);
> select * from tasks;
> update tasks set version1='1',version2='2', version3='3', version4='4',
> version5='5' where task=1;
> select * from tasks;
>
>
> /****** OUTPUT FROM pgsql **********/
> test=> \i hist.sql
> drop table tasks;
> DROP
> CREATE TABLE tasks (
> task INT4 NOT NULL,
> job INT4 NOT NULL,
> Version1 CHAR(6) DEFAULT '',
> Version2 CHAR(6) DEFAULT '',
> Version3 CHAR(6) DEFAULT '',
> Version4 CHAR(6) DEFAULT '',
> Version5 CHAR(6) DEFAULT ''
> );
> CREATE
>
> INSERT INTO tasks (task, job) VALUES (1, 1);
> INSERT 4410388 1
> select * from tasks;
> task|job|version1|version2|version3|version4|version5
> ----+---+--------+--------+--------+--------+--------
> 1| 1| | | | |
> (1 row)
>
> update tasks set version1='1',version2='2', version3='3', version4='4',
> version5='5' where task=1;
> UPDATE 1
> select * from tasks;
> FATAL: unrecognized data from the backend. It probably dumped core.
> FATAL: unrecognized data from the backend. It probably dumped core.
>
> EOF
> test=>
>
>
>
>
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 1999-03-15 00:34:27 Re: [GENERAL] Foreign Keys: check_primary_function
Previous Message Jay W. Summet 1999-03-14 21:04:44 PG 6.1 Archive Needed

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-03-14 21:21:46 Re: [HACKERS] ICQ?
Previous Message Clark Evans 1999-03-14 21:12:55 ICQ?