Thread: what can be wrong? backport plpgpsm to 8.1

what can be wrong? backport plpgpsm to 8.1

From
"Pavel Stehule"
Date:
Hello

I am working on backport plpgpsm to 8.1. This interpret is based on plpgsql 
8.2. There is some strange. Where I do rollback transaction, then on 8.1 
postgresql go down on segfault. 8.2 and 8.3 works well.

I don't see any important difference, why 8.1. have to down.

#0  0x081564f1 in AlterDomainDropConstraint (names=0x876eb2c, 
constrName=0x871d4f8 "", behavior=3213261032) at typecmds.c:1399
#1  0x00d97c9c in ?? ()
#2  0x0876eb2c in ?? ()
#3  0x0871d4f8 in ?? ()
#4  0xbf8678e8 in ?? ()
#5  0x080b0d81 in btree_redo (lsn={xlogid = 0, xrecoff = 0}, record=0x0) at 
nbtxlog.c:431
#6  0x080b0d81 in btree_redo (lsn={xlogid = 5, xrecoff = 0}, record=0x1) at 
nbtxlog.c:431
#7  0x080b49a8 in PrepareTransaction () at xact.c:1847
#8  0x080b4c06 in AbortSubTransaction () at xact.c:3806
#9  0x081d7c3a in dovec (v=0x873fc50, cv=0x875196c, lp=0x0, rp=0x875196c) at 
regcomp.c:1721
#10 0x081d891a in parsebranch (v=0x875196c, stopper=0, type=135311595, 
left=0xbf867be8, right=0x0, partial=0) at regcomp.c:717
#11 0x081da153 in pg_regcomp (re=0x4, string=0x86ff4b8, len=141554824, 
flags=137272710) at regcomp.c:366
#12 0x081ade68 in make_rels_by_joins (root=0x19, level=1, joinrels=0x0) at 
../../../../src/include/nodes/pg_list.h:87
#13 0x081aed66 in find_mergeclauses_for_pathkeys (root=0x3, 
pathkeys=0x86fd4e0, restrictinfos=0xbf868e98) at pathkeys.c:1357
#14 0x0816d559 in ExecEvalParam (exprstate=0x10, econtext=0x0, 
isNull=0xbf868ef8 "", isDone=0x0) at execQual.c:732
#15 0x007aaf2c in ?? ()
#16 0x00791ca0 in ?? ()
#17 0x082773d0 in SearchSysCacheCopy (cacheId=135713552, key1=3, 
key2=3213266724, key3=136803280, key4=136803264) at syscache.c:645
#18 0x08078981 in ?? ()

any ideas?

Thank you
Pavel Stehule

_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com. 
http://www.msn.cz/



Re: what can be wrong? backport plpgpsm to 8.1

From
Tom Lane
Date:
"Pavel Stehule" <pavel.stehule@hotmail.com> writes:
> I don't see any important difference, why 8.1. have to down.

I dunno, but gdb is doing you no favors with such a silly backtrace.
It sorta looks like you have some files built with -g and some without
... or perhaps you are trying to gdb the core file against the wrong
executable?
        regards, tom lane


Re: what can be wrong? backport plpgpsm to 8.1

From
"Pavel Stehule"
Date:
>"Pavel Stehule" <pavel.stehule@hotmail.com> writes:
> > I don't see any important difference, why 8.1. have to down.
>
>I dunno, but gdb is doing you no favors with such a silly backtrace.
>It sorta looks like you have some files built with -g and some without
>... or perhaps you are trying to gdb the core file against the wrong
>executable?
>

propably I had to do some errors. Next cycle produce different output:

#0  FreeExecutorState (estate=0x966eb2c) at execUtils.c:260
260                     FreeExprContext((ExprContext *) 
linitial(estate->es_exprcontexts));
(gdb) bt
#0  FreeExecutorState (estate=0x966eb2c) at execUtils.c:260
#1  0x00528c9c in plpgpsm_xact_cb () from /usr/local/pgsql81/lib/plpgpsm.so
#2  0x080b0d81 in CallXactCallbacks (event=XACT_EVENT_COMMIT) at xact.c:2618
#3  0x080b49a8 in CommitTransaction () at xact.c:1534
#4  0x080b4c06 in CommitTransactionCommand () at xact.c:2184
#5  0x081d7c3a in finish_xact_command () at postgres.c:2021
#6  0x081d891a in exec_simple_query (query_string=0x963f844 "select fx();") 
at postgres.c:1034
#7  0x081da153 in PostgresMain (argc=4, argv=0x95ff4b8, username=0x95ff488 
"root") at postgres.c:3232
#8  0x081ade68 in ServerLoop () at postmaster.c:2865
#9  0x081aed66 in PostmasterMain (argc=3, argv=0x95fd4e0) at 
postmaster.c:941
#10 0x0816d559 in main (argc=3, argv=0x0) at main.c:265

I hope so I see problem now.
Thank you

Pavel Stehule

_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com. 
http://www.msn.cz/



Re: what can be wrong? backport plpgpsm to 8.1

From
Alvaro Herrera
Date:
Pavel Stehule wrote:

> propably I had to do some errors. Next cycle produce different output:
> 
> #0  FreeExecutorState (estate=0x966eb2c) at execUtils.c:260
> 260                     FreeExprContext((ExprContext *) 
> linitial(estate->es_exprcontexts));
> (gdb) bt
> #0  FreeExecutorState (estate=0x966eb2c) at execUtils.c:260
> #1  0x00528c9c in plpgpsm_xact_cb () from /usr/local/pgsql81/lib/plpgpsm.so
> #2  0x080b0d81 in CallXactCallbacks (event=XACT_EVENT_COMMIT) at xact.c:2618

Hmm, ISTR there were some changes to what plpgsql_xact_cb did in 8.1 ...
did you check the changes to that routine?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: what can be wrong? backport plpgpsm to 8.1

From
Tom Lane
Date:
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Pavel Stehule wrote:
>> #1  0x00528c9c in plpgpsm_xact_cb () from /usr/local/pgsql81/lib/plpgpsm.so
>> #2  0x080b0d81 in CallXactCallbacks (event=XACT_EVENT_COMMIT) at xact.c:2618

> Hmm, ISTR there were some changes to what plpgsql_xact_cb did in 8.1 ...
> did you check the changes to that routine?

Specifically I think you need to study this patch:
http://archives.postgresql.org/pgsql-committers/2007-01/msg00370.php

But isn't back-porting plpgpsm to old releases a waste of development
and maintenance effort anyway?
        regards, tom lane


Re: what can be wrong? backport plpgpsm to 8.1

From
"Pavel Stehule"
Date:
>
>Specifically I think you need to study this patch:
>http://archives.postgresql.org/pgsql-committers/2007-01/msg00370.php
>
>But isn't back-porting plpgpsm to old releases a waste of development
>and maintenance effort anyway?
>

I unlike it and last weak I play with it. But I don't expect so Debian and 
RH will be support 8.3 soon. And I would to help to expansion plpgpsm. When 
I comment FreeExecutorState, runtime works well (with some minor problems - 
domains). With 8.1 support I will have much bigger group of users, testers 
(I hope).

I have to study your patch.

Thank you
Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/