Re: backend crashing despite tsearch2 patch

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: psql-mail(at)freeuk(dot)com
Cc: pgsql-general(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: backend crashing despite tsearch2 patch
Date: 2003-09-17 21:26:11
Message-ID: Pine.LNX.4.21.0309172148000.7239-200000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches


On Wed, 17 Sep 2003 psql-mail(at)freeuk(dot)com wrote:

> > On Wed, 17 Sep 2003 psql-mail(at)freeuk(dot)com wrote:
> >
> > > I have applied the recent tsearch2 patch and recompiled the
> tsearch2
> > > module but I am still experiencing the same backend crashes as I
> > > previously described.
> >
> > I didn't think your problem was the same as mine.
> >
> > > #0 SN_create_env (S_size=0, I_size=2, B_size=1) at api.c:6
> > > 6 z->p = create_s();
> > > (gdb) bt
> > > #0 SN_create_env (S_size=0, I_size=2, B_size=1) at api.c:6
> > > #1 0x20000000026be870 in SN_create_env (S_size=40770504, I_size=
> > > 40509856,
> > > B_size=1034) at api.c:6
> >
> > Is that the full backtrace?
>
> The gdb session above is quoted above start to finish as displayed on
> screen. I'm not very famialiar with gdb so please say if I need to do
> things differently.
>
> So i think it is the full backtrace - i certainly haven't edited
> anything.

Trouble is it doesn't look like a decently deep stack. I would have expected to
see a lot more output from the backtrace.

Having said that the z in the z->p = create_s() line mentioned as the place of
the fault is the result of a calloc without checking for a null return from
calloc. Here's a[nother simple] patch to fix that.

It's not going to fix whatever is putting you into the situation that makes
calloc fail though. It'll just make the failure less disasterous.

--
Nigel J. Andrews

Attachment Content-Type Size
tsearch2.patch text/plain 798 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-09-17 21:30:59 Re: Weird query plan
Previous Message Tom Lane 2003-09-17 21:04:52 Re: Weird query plan

Browse pgsql-patches by date

  From Date Subject
Next Message Nigel J. Andrews 2003-09-17 22:44:14 Re: backend crashing despite tsearch2 patch
Previous Message psql-mail 2003-09-17 14:35:31 Re: backend crashing despite tsearch2 patch