Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge
Дата
Msg-id 201109021520.p82FKoJ19066@momjian.us
обсуждение исходный текст
Ответ на Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge  (Jeremy Drake <pgsql@jdrake.com>)
Ответы Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-committers
Jeremy Drake wrote:
> On Thu, 1 Sep 2011, Bruce Momjian wrote:
>
> > Jeremy Drake wrote:
> >
> > > I am the owner of both mongoose and okapi.  Let me know if there's
> > > anything you want me to try.
> >
> > Thanks.  I would either like to email you patches to test or get ssh
> > access so I can compile it myself.
>
> You can send me patches if you want, but I spent a little time with it
> tonight and it seems to be the change to src/include/access/xlog.h:
>
http://git.postgresql.org/gitweb/?p=postgresql.git;a=blobdiff;f=src/include/access/xlog.h;h=1fd60fb98d7362b677112517a20a41e32227a34f;hp=cdbf63fa76e0e7b154c084191d0df6138e1cbfcc;hb=4bd7333;hpb=d010391ac8f706e17998671534ca1230f68d2f38
>
> Unfortunately, I also had to revert commit
> 6416a82a62db4e66b2edb0fa8fc83a580c3f1931 to fix compile errors.  I expect
> you would be able to do something a little more surgical than that...

Wow, that is interesting.  So the problem is the inclusion of
replication/walsender.h in xlog.h.  Hard to see how that could cause the
cube regression tests to fail, but of course, it is.

I noticed you are using these compile flags:

    'CFLAGS' => '-O3 -xN -parallel -ip',
    'CC' => 'icc'

Can you test it with lower optimizations?

I looked at the contrib/cube compile messages and didn't see anything
unusual.

The only other idea I have is to try the attached patch which changes
the offsetof() call to mention a struct field name, and not the first
element of the field.  However, I see other uses of accessing the
element of a struct field, so I might be wrong here.

I will say that our buildfarm is great at giving developers information
to diagnose the cause of failures!  It just isn't helping me find the
cause in this particular case.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c
new file mode 100644
index b0564f7..5159be4
*** a/contrib/cube/cube.c
--- b/contrib/cube/cube.c
*************** cube_a_f8_f8(PG_FUNCTION_ARGS)
*** 199,205 ****
      dur = ARRPTR(ur);
      dll = ARRPTR(ll);

!     size = offsetof(NDBOX, x[0]) +sizeof(double) * 2 * dim;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
--- 199,205 ----
      dur = ARRPTR(ur);
      dll = ARRPTR(ll);

!     size = offsetof(NDBOX, x) +sizeof(double) * 2 * dim;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
*************** cube_a_f8(PG_FUNCTION_ARGS)
*** 235,241 ****

      dur = ARRPTR(ur);

!     size = offsetof(NDBOX, x[0]) +sizeof(double) * 2 * dim;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
--- 235,241 ----

      dur = ARRPTR(ur);

!     size = offsetof(NDBOX, x) +sizeof(double) * 2 * dim;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
*************** cube_subset(PG_FUNCTION_ARGS)
*** 268,274 ****
      dx = (int4 *) ARR_DATA_PTR(idx);

      dim = ARRNELEMS(idx);
!     size = offsetof(NDBOX, x[0]) +sizeof(double) * 2 * dim;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
--- 268,274 ----
      dx = (int4 *) ARR_DATA_PTR(idx);

      dim = ARRNELEMS(idx);
!     size = offsetof(NDBOX, x) +sizeof(double) * 2 * dim;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
*************** cube_enlarge(PG_FUNCTION_ARGS)
*** 1373,1379 ****
          dim = n;
      if (a->dim > dim)
          dim = a->dim;
!     size = offsetof(NDBOX, x[0]) +sizeof(double) * dim * 2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
--- 1373,1379 ----
          dim = n;
      if (a->dim > dim)
          dim = a->dim;
!     size = offsetof(NDBOX, x) +sizeof(double) * dim * 2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = dim;
*************** cube_f8(PG_FUNCTION_ARGS)
*** 1414,1420 ****
      NDBOX       *result;
      int            size;

!     size = offsetof(NDBOX, x[0]) +sizeof(double) * 2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = 1;
--- 1414,1420 ----
      NDBOX       *result;
      int            size;

!     size = offsetof(NDBOX, x) +sizeof(double) * 2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = 1;
*************** cube_f8_f8(PG_FUNCTION_ARGS)
*** 1432,1438 ****
      NDBOX       *result;
      int            size;

!     size = offsetof(NDBOX, x[0]) +sizeof(double) * 2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = 1;
--- 1432,1438 ----
      NDBOX       *result;
      int            size;

!     size = offsetof(NDBOX, x) +sizeof(double) * 2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = 1;
*************** cube_c_f8(PG_FUNCTION_ARGS)
*** 1453,1459 ****
      int            size;
      int            i;

!     size = offsetof(NDBOX, x[0]) +sizeof(double) * (c->dim + 1) *2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = c->dim + 1;
--- 1453,1459 ----
      int            size;
      int            i;

!     size = offsetof(NDBOX, x) +sizeof(double) * (c->dim + 1) *2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = c->dim + 1;
*************** cube_c_f8_f8(PG_FUNCTION_ARGS)
*** 1480,1486 ****
      int            size;
      int            i;

!     size = offsetof(NDBOX, x[0]) +sizeof(double) * (c->dim + 1) *2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = c->dim + 1;
--- 1480,1486 ----
      int            size;
      int            i;

!     size = offsetof(NDBOX, x) +sizeof(double) * (c->dim + 1) *2;
      result = (NDBOX *) palloc0(size);
      SET_VARSIZE(result, size);
      result->dim = c->dim + 1;

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

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: pgsql: In ecpglib restore LC_NUMERIC in case of an error.
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgsql: Remove "fmgr.h" include in cube contrib --- caused crash on a Ge