Re: Segmentation fault while COPY in 7.3

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: Nicolai Tufar <ntufar(at)apb(dot)com(dot)tr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Segmentation fault while COPY in 7.3
Date: 2002-12-02 21:02:30
Message-ID: 3DEBCA66.3060405@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-general pgsql-hackers

Something is funny about this pfree()....here is a similar crash on a 7.2.3

(gdb)
#0 0x00420874 in heap_freetuple ()
#1 0x004a8390 in acquire_sample_rows ()
#2 0x004a75c8 in analyze_rel ()
#3 0x0049f690 in vacuum ()
#4 0x005585d8 in ProcessUtility ()
#5 0x00553c78 in pg_exec_query_string ()
#6 0x00555850 in PostgresMain ()
#7 0x00524660 in DoBackend ()
#8 0x00523d08 in BackendStartup ()
#9 0x00521c18 in ServerLoop ()
#10 0x005211c8 in PostmasterMain ()
#11 0x004df3d8 in main ()
#12 0x2ae34928 in __libc_start_main () from /lib/libc.so.6
(gdb)

Nicolai Tufar wrote:

>Help!
>Backend crashes on any COPY command I issue:
>PostgreSQL is 7.3 release, is compiled from sources.
>The message I get is:
>
>apb=# COPY maras2.mrk_yyn (bsvr_no, yyn_tur, yyn_no, yyn_syf, yyn_trh) TO
>stdout;
>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.
>!#
>
>
>The output of strace on backend is following:
>
># strace -p 18883
>recv(7, "QCOPY maras2.mrk_yyn (bsvr_no, y"..., 8192, 0) = 77
>gettimeofday({1038713111, 629131}, NULL) = 0
>_llseek(11, 0, [0], SEEK_SET) = 0
>read(11, "\0\0\0\0\20\0\0\0\1\0\0\0\24\0\360\37\360\37\1 b1\5\0\1"..., 8192)
>= 8192
>read(11, "\0\0\0\0x#\375\"\20\0\0\0008\0h\35\360\37\1 \370\235\220"...,
>8192) = 8192
>_llseek(12, 0, [0], SEEK_SET) = 0
>read(12, "\0\0\0\0\0#\375\"\20\0\0\0008\0(at)\34\0 \1 \200\237\0\1\0"..., 8192)
>= 8192
>_llseek(21, 40960, [40960], SEEK_SET) = 0
>read(21, "\0\0\0\0\4\251\3#\20\0\0\0004\4p\17\360\37\1 \340\237 "..., 8192)
>= 8192
>_llseek(22, 106496, [106496], SEEK_SET) = 0
>read(22, "\0\0\0\0(\326\377\"\20\0\0\0\10\1\200\1\0 \1 \200\237\0"..., 8192)
>= 8192
>read(17, "\0\0\0\0\20\0\0\0\1\0\0\0\360\0\20\1\0 \1 p\237 \1\340"..., 8192)
>= 8192
>open("/data/pgsql/base/2015749/2015757", O_RDWR|O_LARGEFILE) = 39
>_llseek(39, 0, [20037632], SEEK_END) = 0
>_llseek(39, 0, [0], SEEK_SET) = 0
>read(39, "\0\0\0\0\270\7\4#\20\0\0\0\300\1\350\1\0 \1 \270\237\216"...,
>8192) = 8192
>--- SIGSEGV (Segmentation fault) ---
>+++ killed by SIGSEGV +++
>#
>
>I have recompiled postgres with debug information enabled, run gdb, attached
>to backend process
>and caught SIGSEGV as following:
>
>(gdb) continue
>Continuing.
>
>Program received signal SIGSEGV, Segmentation fault.
>0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
>480 (*header->context->methods->free_p) (header->context,
>pointer);
>(gdb)
>
>
>The output of bt is:
>
>(gdb) bt
>#0 0x081697bf in pfree (pointer=0x828a7b0) at mcxt.c:480
>#1 0x080b37be in CopyTo (rel=0x402be088, attnumlist=0x828a3f8, binary=0
>'\0', oids=0 '\0',
> fp=0x0, delim=0x81c2a57 "\t", null_print=0x81b2c22 "\\N") at copy.c:671
>#2 0x080b32f6 in DoCopy (stmt=0x827b398) at copy.c:491
>#3 0x08118a6a in pg_exec_query_string (query_string=0x827af48, dest=Remote,
> parse_context=0x8245378) at postgres.c:789
>#4 0x08119b89 in PostgresMain (argc=4, argv=0xbfffd2a0, username=0x8240a81
>"postgres")
> at postgres.c:2016
>#5 0x08101d7c in DoBackend (port=0x8240950) at postmaster.c:2293
>#6 0x081016c2 in BackendStartup (port=0x8240950) at postmaster.c:1915
>#7 0x08100875 in ServerLoop () at postmaster.c:1000
>#8 0x08100326 in PostmasterMain (argc=1, argv=0x82270c0) at
>postmaster.c:779
>#9 0x080debab in main (argc=1, argv=0xbfffdc34) at main.c:210
>#10 0x42017589 in __libc_start_main () from /lib/i686/libc.so.6
>(gdb)
>
>
>
>Thanks in advance,
>Nic
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Stephan Szabo 2002-12-02 21:40:49 Re: 7.4 Wishlist
Previous Message Christopher Kings-Lynne 2002-12-02 20:48:38 Re: 7.4 Wishlist

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-12-02 21:17:18 Re: protecting prosrc (was Re: [GENERAL] USAGE on schema allowed by
Previous Message Joe Conway 2002-12-02 21:01:03 Re: Arrays: determining size

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-12-02 21:04:11 Re: ALTER .. ADD PRIMARY KEY
Previous Message Christopher Kings-Lynne 2002-12-02 20:48:38 Re: 7.4 Wishlist