Re: strange path through code (initdb problem)

From: Keith Parks <emkxp01(at)mtcc(dot)demon(dot)co(dot)uk>
To: maillist(at)candle(dot)pha(dot)pa(dot)us
Cc: hackers(at)postgresql(dot)org
Subject: Re: strange path through code (initdb problem)
Date: 1998-08-28 21:11:32
Message-ID: 199808282111.WAA09884@mtcc.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>

> Are you compiling with optimization. Thay may do it.

Yes, and it does :-(

Compiled with -O0 everything works fine (well almost).
With -O2, the default, I get the SIGSEGV as before.

I seem to remember I had this optimisation problem some while
ago and someone, Thomas?, fixed it by rewriting some code.

So, for now I'm reasonably happy and can get on with some
testing.

Thanks,
Keith.

BTW: this is tested after Jan's fix for indexes. (Thanks Jan)

> > Keith Parks
> >
> > The latest changes do not seem to have fixed my problems
> > (assumed to be alignment)
> >
> > What I find really strange is the path taken through the
> > code when stepping upto the SIGSEGV.
> >
> > ie. how do we get to line 208 in heaptuple.c (the other half of
> > the if/else statement) without passing through line 203??
> >
> > Remembering that we should never touch line 208 if the
> > attalign is 'd'
> >
> > Puzzled,
> > Keith.
> >
> > 163 switch (att[i]->attlen)
> > (gdb)
> > 195 if (att[i]->attlen < sizeof(int32))
> > (gdb)
> > 198 if (att[i]->attalign == 'd')
> > (gdb)
> > 200 data = (char *)
> > DOUBLEALIGN(data);
> > (gdb)
> > 201 memmove(data,
> > DatumGetPointer(value[i]),
> > (gdb)
> > 204 }
> > (gdb)
> > 208 memmove(data,
> > DatumGetPointer(value[i]),
> > (gdb)
> >
> > Program received signal SIGSEGV, Segmentation fault.
> >
> >
>
>
> --
> Bruce Momjian | 830 Blythe Avenue
> maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
> + If your life is a hard drive, | (610) 353-9879(w)
> + Christ can be your backup. | (610) 853-3000(h)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-08-28 23:25:28 Re: strange path through code (initdb problem)
Previous Message The Hermit Hacker 1998-08-28 17:47:47 Re: [HACKERS] ecpg patches