Re: [HACKERS] v6.5 release ToDo

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] v6.5 release ToDo
Дата
Msg-id 6574.926917430@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] v6.5 release ToDo  (Ole Gjerde <gjerde@icebox.org>)
Ответы Re: [HACKERS] v6.5 release ToDo  (Ole Gjerde <gjerde@icebox.org>)
Список pgsql-hackers
Ole Gjerde <gjerde@icebox.org> writes:
> gdb of core:
> #0  0x4013a30a in _IO_default_xsputn (f=0xbf8006f4, data=0x81377e0, n=20)
>     at genops.c:382
> #1  0x40129980 in _IO_vfprintf (s=0xbf8006f4, 
>     format=0x81377e0 " COLUMNDEF :colname %s :typename ", ap=0xbf800c08)
>     at vfprintf.c:1048
> #2  0x40137d16 in _IO_vsnprintf (string=0xbf8007f8 "", maxlen=1024, 
>     format=0x81377e0 " COLUMNDEF :colname %s :typename ", args=0xbf800c08)
>     at vsnprintf.c:129
> #3  0x809ccfb in appendStringInfo ()
> #4  0x80b637b in _outColumnDef ()
> #5  0x80b8107 in _outNode ()
> #6  0x80b7d79 in _outNode ()
> #7  0x80b7cab in _outConstraint ()
> #8  0x80b84b7 in _outNode ()
> #9  0x80b7d79 in _outNode ()
> #10 0x80b63bb in _outColumnDef ()
> #11 0x80b8107 in _outNode ()
> #12 0x80b7d79 in _outNode ()
> And this keeps going and going and going..

Hmm, that looks like a column constraint has somehow gotten recursively
linked back to its parent column definition node.

I poked around in the code for serial-column constraints, and found that
Lockhart's last patch had a subtle bug --- he wrote more characters in
the constraint text without increasing the space palloc'd for the
string.  That could maybe cause such a problem, depending on what
happened to be living next door to the string...  But I don't really
think this explains your complaint, because according to the cvs log
that change was made on 5/13, and you reported a problem quite some time
before that.  Still, please fetch the current cvs sources or apply this
patch:

*** src/backend/parser/analyze.c.orig    Sun May 16 10:29:33 1999
--- src/backend/parser/analyze.c    Mon May 17 00:50:07 1999
***************
*** 545,551 ****                     constraint = makeNode(Constraint);                     constraint->contype =
CONSTR_DEFAULT;                    constraint->name = sname;
 
!                     cstring = palloc(9 + strlen(constraint->name) + 2 + 1);                     strcpy(cstring,
"nextval('\"");                    strcat(cstring, constraint->name);                     strcat(cstring, "\"')");
 
--- 545,551 ----                     constraint = makeNode(Constraint);                     constraint->contype =
CONSTR_DEFAULT;                    constraint->name = sname;
 
!                     cstring = palloc(10 + strlen(constraint->name) + 3 + 1);                     strcpy(cstring,
"nextval('\"");                    strcat(cstring, constraint->name);                     strcat(cstring, "\"')");
 

and let us know if anything changes...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Memory leaks in relcache
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] DROP TABLE leaks file descriptors