Crash in PostgreSQL 7.0.b5.

From: Frank Mayhar <frank(at)exit(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Crash in PostgreSQL 7.0.b5.
Date: 2000-04-24 15:43:19
Message-ID: 200004241543.IAA13422@realtime.exit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Frank Mayhar
Your email address : frank(at)exit(dot)com

System Configuration
---------------------
Architecture (example: Intel Pentium) : Pentium II 266.

Operating System (example: Linux 2.0.26 ELF) : FreeBSD 3.4-stable

PostgreSQL version (example: PostgreSQL-6.5.1): PostgreSQL-7.0.b5

Compiler used (example: gcc 2.8.0) : gcc 2.7.2.3

Please enter a FULL description of your problem:
------------------------------------------------
I'm using a frontend written in Perl using DBI and DBD::Pg to convert a set
of DBF database tables directly into my PostgreSQL database. At some point
quite far into the process (but very early in the creation of one of the
tables) the postgres backend coredumps. What follows is the insert it crashes
on and a backtrace from the corefile itself (with symbols). I can provide
the corefile and executable upon request.

Here is trace output from DBI:

dbd_st_execute: statement = >INSERT INTO td_products (GRP,CAT,SUB,VEND_CODE,MANU_PART,PART_NUM,DESCR,COST,RETAIL,QTY,LIST_PRICE,EFF_DATE,TECH_FAX,STATUS,UPC) VALUES ('''M6''','''A1''','''A0''','''AMI''','''S607697700000''','''042967''','''MEGAPLEX ATXMBD 4PII XEON 12PCI 2ISA 8GB DM''','7416.67','12051','1','7416.67','''03/31/2000''','1','''2''','''731243769002''')<
<- execute= 1 at dbftopgsql line 172.
-> execute for DBD::Pg::st (DBI::st=HASH(0x821c174)~0x821eef4 ''J4'' ''C4'' ''C1'' ''AMI'' ''4283233000'' ''043003'' ''MEGARAID ENT 1200:ULTRA 3-CHNL W/0MB (SERIES 428)'' '524.15' '799' '-6' '524.15' ''04/19/2000'' '1' ''2'' ''031243428337'')
dbd_bind_ph
bind :p1 <== ''J4'' (type 0)
dbd_st_rebind
bind :p1 <== ''J4'' (size 4/5/0, ptype 4, otype 1043)
bind :p1 <== ''J4'' (size 4/4, otype 1043, indp 0)
dbd_bind_ph
bind :p2 <== ''C4'' (type 0)
dbd_st_rebind
bind :p2 <== ''C4'' (size 4/5/0, ptype 4, otype 1043)
bind :p2 <== ''C4'' (size 4/4, otype 1043, indp 0)
dbd_bind_ph
bind :p3 <== ''C1'' (type 0)
dbd_st_rebind
bind :p3 <== ''C1'' (size 4/5/0, ptype 4, otype 1043)
bind :p3 <== ''C1'' (size 4/4, otype 1043, indp 0)
dbd_bind_ph
bind :p4 <== ''AMI'' (type 0)
dbd_st_rebind
bind :p4 <== ''AMI'' (size 5/6/0, ptype 4, otype 1043)
bind :p4 <== ''AMI'' (size 5/5, otype 1043, indp 0)
dbd_bind_ph
bind :p5 <== ''4283233000'' (type 0)
dbd_st_rebind
bind :p5 <== ''4283233000'' (size 12/16/0, ptype 4, otype 1043)
bind :p5 <== ''4283233000'' (size 12/15, otype 1043, indp 0)
dbd_bind_ph
bind :p6 <== ''043003'' (type 0)
dbd_st_rebind
bind :p6 <== ''043003'' (size 8/9/0, ptype 4, otype 1043)
bind :p6 <== ''043003'' (size 8/8, otype 1043, indp 0)
dbd_bind_ph
bind :p7 <== ''MEGARAID ENT 1200:ULTRA 3-CHNL W/0MB (SERIES 428)'' (type 0)
dbd_st_rebind
bind :p7 <== ''MEGARAID ENT 1200:ULTRA 3-CHNL W/0MB (SERIES 428)'' (size 51/52/0, ptype 4, otype 1043)
bind :p7 <== ''MEGARAID ENT 1200:ULTRA 3-CHNL W/0MB (SERIES 428)'' (size 51/51, otype 1043, indp 0)
dbd_bind_ph
bind :p8 <== '524.15' (type 0)
dbd_st_rebind
bind :p8 <== '524.15' (size 6/8/0, ptype 4, otype 1043)
bind :p8 <== '524.15' (size 6/7, otype 1043, indp 0)
dbd_bind_ph
bind :p9 <== '799' (type 0)
dbd_st_rebind
bind :p9 <== '799' (size 3/6/0, ptype 4, otype 1043)
bind :p9 <== '799' (size 3/5, otype 1043, indp 0)
dbd_bind_ph
bind :p10 <== '-6' (type 0)
dbd_st_rebind
bind :p10 <== '-6' (size 2/3/0, ptype 4, otype 1043)
bind :p10 <== '-6' (size 2/2, otype 1043, indp 0)
dbd_bind_ph
bind :p11 <== '524.15' (type 0)
dbd_st_rebind
bind :p11 <== '524.15' (size 6/8/0, ptype 4, otype 1043)
bind :p11 <== '524.15' (size 6/7, otype 1043, indp 0)
dbd_bind_ph
bind :p12 <== ''04/19/2000'' (type 0)
dbd_st_rebind
bind :p12 <== ''04/19/2000'' (size 12/13/0, ptype 4, otype 1043)
bind :p12 <== ''04/19/2000'' (size 12/12, otype 1043, indp 0)
dbd_bind_ph
bind :p13 <== '1' (type 0)
dbd_st_rebind
bind :p13 <== '1' (size 1/2/0, ptype 4, otype 1043)
bind :p13 <== '1' (size 1/1, otype 1043, indp 0)
dbd_bind_ph
bind :p14 <== ''2'' (type 0)
dbd_st_rebind
bind :p14 <== ''2'' (size 3/4/0, ptype 4, otype 1043)
bind :p14 <== ''2'' (size 3/3, otype 1043, indp 0)
dbd_bind_ph
bind :p15 <== ''031243428337'' (type 0)
dbd_st_rebind
bind :p15 <== ''031243428337'' (size 14/15/0, ptype 4, otype 1043)
bind :p15 <== ''031243428337'' (size 14/14, otype 1043, indp 0)
dbd_st_execute
dbd_st_execute: statement = >INSERT INTO td_products (GRP,CAT,SUB,VEND_CODE,MANU_PART,PART_NUM,DESCR,COST,RETAIL,QTY,LIST_PRICE,EFF_DATE,TECH_FAX,STATUS,UPC) VALUES ('''J4''','''C4''','''C1''','''AMI''','''4283233000''','''043003''','''MEGARAID ENT 1200:ULTRA 3-CHNL W/0MB (SERIES 428)''','524.15','799','-6','524.15','''04/19/2000''','1','''2''','''031243428337''')<
ERROR EVENT 7 'pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
' on DBI::st=HASH(0x821eef4)

...and here is the backtrace from the coredump:

ungoverned# gdb postgres /var/db/pgsql/data/base/exit/postgres.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...

warning: exec file is newer than core file.
Core was generated by `postgres'.
Program terminated with signal 10, Bus error.
Reading symbols from /usr/lib/libcrypt.so.2...done.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/lib/libreadline.so.3...done.
Reading symbols from /usr/lib/libtermcap.so.2...done.
Reading symbols from /usr/local/lib/libncurses.so.4...done.
Reading symbols from /usr/lib/libc.so.3...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0 bcTruelen (arg=0xfffffffa <Address 0xfffffffa out of bounds>)
at varchar.c:427
427 for (i = len - 1; i >= 0; i--)
(gdb) bt
#0 bcTruelen (arg=0xfffffffa <Address 0xfffffffa out of bounds>)
at varchar.c:427
#1 0x810d388 in bpcharcmp (
arg1=0xfffffffa <Address 0xfffffffa out of bounds>, arg2=0x1 "")
at varchar.c:590
#2 0x8075e06 in _bt_compare (rel=0x81ec478, itupdesc=0x81ec838,
page=0x300d1cd0 "\f", keysz=1, scankey=0x8200230, offnum=1)
at nbtsearch.c:594
#3 0x8075b93 in _bt_binsrch (rel=0x81ec478, buf=63, keysz=1,
scankey=0x8200230, srchtype=0) at nbtsearch.c:393
#4 0x80734a8 in _bt_pgaddtup (rel=0x81ec478, buf=63, keysz=1,
itup_scankey=0x8200230, itemsize=12, btitem=0x81fec48, afteritem=0x0)
at nbtinsert.c:1238
#5 0x8072d22 in _bt_insertonpg (rel=0x81ec478, buf=63, stack=0x0, keysz=1,
scankey=0x8200230, btitem=0x81fec48, afteritem=0x0) at nbtinsert.c:822
#6 0x8071f98 in _bt_doinsert (rel=0x81ec478, btitem=0x81fec48,
index_is_unique=0 '\000', heapRel=0x81e6e28) at nbtinsert.c:207
#7 0x8074a31 in btinsert (rel=0x81ec478, datum=0x81fe900,
nulls=0x81fea18 " \001", ht_ctid=0x820002c, heapRel=0x81e6e28)
at nbtree.c:365
#8 0x811e47b in fmgr_c (finfo=0xbfbfca64, values=0xbfbfca74,
isNull=0xbfbfca63 "") at fmgr.c:147
#9 0x811ee04 in fmgr (procedureId=331) at fmgr.c:623
#10 0x806e4f8 in index_insert (relation=0x81ec478, datum=0x81fe900,
nulls=0x81fea18 " \001", heap_t_ctid=0x820002c, heapRel=0x81e6e28)
at indexam.c:197
#11 0x809d5e0 in ExecInsertIndexTuples (slot=0x81ff560, tupleid=0x820002c,
estate=0x81fe448, is_update=0) at execUtils.c:1214
#12 0x809a5c9 in ExecAppend (slot=0x81ff560, tupleid=0x0, estate=0x81fe448)
at execMain.c:1353
#13 0x809a4ac in ExecutePlan (estate=0x81fe448, plan=0x81fe3c0,
operation=CMD_INSERT, offsetTuples=0, numberTuples=0,
direction=ForwardScanDirection, destfunc=0x8200000) at execMain.c:1199
#14 0x8099b39 in ExecutorRun (queryDesc=0x81fe240, estate=0x81fe448,
feature=3, limoffset=0x0, limcount=0x0) at execMain.c:326
#15 0x80ea8d7 in ProcessQueryDesc (queryDesc=0x81fe240, limoffset=0x0,
limcount=0x0) at pquery.c:310
#16 0x80ea93c in ProcessQuery (parsetree=0x81f6d80, plan=0x81fe3c0,
dest=Remote) at pquery.c:353
#17 0x80e94ca in pg_exec_query_dest (
query_string=0x818aad0 "INSERT INTO td_products (GRP,CAT,SUB,VEND_CODE,MANU_PART,PART_NUM,DESCR,COST,RETAIL,QTY,LIST_PRICE,EFF_DATE,TECH_FAX,STATUS,UPC) VALUES ('''J4''','''C4''','''C1''','''AMI''','''4283233000''','''043003"...,
dest=Remote, aclOverride=0) at postgres.c:664
#18 0x80e93b3 in pg_exec_query (
query_string=0x818aad0 "INSERT INTO td_products (GRP,CAT,SUB,VEND_CODE,MANU_PART,PART_NUM,DESCR,COST,RETAIL,QTY,LIST_PRICE,EFF_DATE,TECH_FAX,STATUS,UPC) VALUES ('''J4''','''C4''','''C1''','''AMI''','''4283233000''','''043003"...)
at postgres.c:563
#19 0x80ea3d4 in PostgresMain (argc=5, argv=0xbfbfd23c, real_argc=5,
real_argv=0xbfbfdc20) at postgres.c:1586
#20 0x80d48ce in DoBackend (port=0x8190800) at postmaster.c:1953
#21 0x80d4480 in BackendStartup (port=0x8190800) at postmaster.c:1722
#22 0x80d379a in ServerLoop () at postmaster.c:994
#23 0x80d3258 in PostmasterMain (argc=5, argv=0xbfbfdc20) at postmaster.c:700
#24 0x80a93ca in main (argc=5, argv=0xbfbfdc20) at main.c:93
#25 0x806328d in _start ()

I can provide more information from the coredump if necessary. Please note
that this happens under version 6.5.3 as well (which is why I went to 7), but
I didn't collect all this information for those dumps.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
This probably depends heavily on the data I'm using and the script I
wrote. If necessary I can rerun the job with any attempted fixes.

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

--
Frank Mayhar frank(at)exit(dot)com http://www.exit.com/

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2000-04-24 17:11:08 Re: Crash in PostgreSQL 7.0.b5.
Previous Message Peter Eisentraut 2000-04-21 22:06:46 Re: [HACKERS] Re: Join/table alias bug