Thread: Unruly rules

Unruly rules

From
Peter Eisentraut
Date:
The "rule" regression test gets stuck in an infinite loop in
optimizer/prep/prepunion.c:find_inheritable_rt_entry.  It seems to be a
coding mistake; from what I can tell the loop can't ever exit if there are
no inherited tables.

I also get failures in sanity_check and misc, which might be due to the
changed views implementation.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



Re: Unruly rules

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> The "rule" regression test gets stuck in an infinite loop in
> optimizer/prep/prepunion.c:find_inheritable_rt_entry.  It seems to be a
> coding mistake; from what I can tell the loop can't ever exit if there are
> no inherited tables.
> I also get failures in sanity_check and misc, which might be due to the
> changed views implementation.

??  it all passes here ... platform dependency maybe?  Or perhaps you
just need a make clean and rebuild?  I did a fair amount of struct-
declaration-rearrangement...
        regards, tom lane


Re: Unruly rules

From
Peter Eisentraut
Date:
Tom Lane writes:

> > The "rule" regression test gets stuck in an infinite loop in
> > optimizer/prep/prepunion.c:find_inheritable_rt_entry.

> ??  it all passes here ... platform dependency maybe?  Or perhaps you
> just need a make clean and rebuild?  I did a fair amount of struct-
> declaration-rearrangement...

Actually, it's still there (even after OS upgrade :).  The "misc" and
"sanity_check" failures were due to some test ordering problems, but the
"rules" still hang.

The backend process hangs in this loop:

| bool find_inheritable_rt_entry(List *rangetable,
|                                Index *rt_index,
|                                List **inheritors) {
|     Index count = 0;
|     List *temp;
| 
|     foreach(temp, rangetable)
|     {
|         RangeTblEntry *rt_entry = (RangeTblEntry *) lfirst(temp);
|         List *inhs;
| 
|         count++;
|         /* Ignore non-inheritable RT entries */
|         if (! rt_entry->inh)
|             continue;

Somewhere a list pointer needs to be advanced there.

This happens at the query:

DEBUG:  query: insert into shoelace_ok select * from shoelace_arrive;



Re: Unruly rules

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> The backend process hangs in this loop:

> |     foreach(temp, rangetable)

> Somewhere a list pointer needs to be advanced there.

What?  foreach() does advance the pointer.  The only way this can be
an infinite loop is if the rangetable list is circular.

I wouldn't rank that as out of the question, considering the enthusiasm
with which the rules code munges range lists, but I still don't see it
happening here.  Is anyone else seeing regression failures with current
sources?
        regards, tom lane


Re: Unruly rules

From
Peter Eisentraut
Date:
I don't know if you've noticed, but the Beos porters are also reporting
that the rule test hangs.  Is there any way I can help debugging this?

It happens sporadically on my machine, which is potentially because I turn
it off every night, thus the memory might be more uniformly initialized
than on long-running machines.  (Happened before...)

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



Re: Unruly rules

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> I don't know if you've noticed, but the Beos porters are also reporting
> that the rule test hangs.  Is there any way I can help debugging this?

Yeah?  Hmm, sounds more and more like a platform-specific bug then.
I don't see it on HPUX, Linux/Intel or Linux/PPC.  What are you running
on, and with what configure/build options?
        regards, tom lane