Discussion:
ExecScanHashBucket -> Assert Error
(too old to reply)
j***@uwaterloo.ca
2011-03-04 11:36:28 UTC
Permalink
I have determined as much as I can behind my Assert error, but have yet to
fix it... I am still trying to build a table with MultiExecProcNode and
probe with the other (therefore, still Hybrid Hash Join - but I have
switched the outer and the inner).

It appears the error occurs in ExecScanHashBucket() when a match is found
and the line "if (ExecQual(hjclauses, econtext, false))" is called. This
(unsurprisingly) is where the Assert error stems from in execQual.c.

I also checked by doing a print out of the building of my hashtable
(insertions of what hash values into which buckets), as well as the
probing that occurs. You can see that the Assert error happens when a
probe clearly matches one of the values in the hashtable (bucket: 911,
hashvalue: 4294966991). I have added this output below (please feel free
to remove it if you think it is unacceptable for the news group... I
figure it's not code - or even working properly).

LOG: database system was shut down at 2011-03-04 05:55:50 EST
LOG: checkpoint record is at 0/3BDD70
LOG: redo record is at 0/3BDD70; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 881; next OID: 16412
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
Storing hashvalue in hashtable --> 4294967188
Storing in hashtable at bucket # --> 75
Storing hashvalue in hashtable --> 4294967092
Storing in hashtable at bucket # --> 1012
Storing hashvalue in hashtable --> 4294966994
Storing in hashtable at bucket # --> 914
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Probing hashvalue --> 4294967194
Storing in hashtable at bucket # --> 81
Probing Bucket #: 81
Probing hashvalue --> 4294967094
Storing in hashtable at bucket # --> 1014
Probing Bucket #: 1014
Probing hashvalue --> 4294967190
Storing in hashtable at bucket # --> 77
Probing Bucket #: 77
Probing hashvalue --> 4294967193
Storing in hashtable at bucket # --> 80
Probing Bucket #: 80
Probing hashvalue --> 4294966893
Storing in hashtable at bucket # --> 813
Probing Bucket #: 813
Probing hashvalue --> 4294967090
Storing in hashtable at bucket # --> 1010
Probing Bucket #: 1010
Probing hashvalue --> 4294966894
Storing in hashtable at bucket # --> 814
Probing Bucket #: 814
Probing hashvalue --> 4294967093
Storing in hashtable at bucket # --> 1013
Probing Bucket #: 1013
Probing hashvalue --> 4294967192
Storing in hashtable at bucket # --> 79
Probing Bucket #: 79
Probing hashvalue --> 4294966993
Storing in hashtable at bucket # --> 913
Probing Bucket #: 913
Probing hashvalue --> 4294966991
Storing in hashtable at bucket # --> 911
Probing Bucket #: 911
ExecScanHashBucket MATCH FOUND.
TRAP: FailedAssertion("!(variable->vartype == tuple_type->attrs[attnum -
1]->atttypid || tuple_type->attrs[attnum - 1]->attisdropped)", File:
"execQual.c", Line: 503)
LOG: server process (PID 63760) was terminated by signal 6
LOG: terminating any other active server processes
FATAL: the database system is in recovery mode


Therefore, everything seems to be working fine. Both the hashvalues and
the buckets are being determined correctly - it's simply an error that
crops up in ExecScanHashBucket() and furthermore ExecQual() that is
causing the issue...

This was a complete re-write and the error came back so it doesn't appear
to be a one-off.

Any idea what might be the source of my error?
Anup Kumar Chalamalla
2011-03-04 15:05:36 UTC
Permalink
Hi..

the problem may be because you switched the outer and inner, somewhere
an outer tuple is used where an inner tuple is required. In the same
function in ExecQual.c (where you see the error, line 503) the variable
"slot" is initialized in a switch case construct. Check if by reversing
that, there is any hope.

Anup
Post by j***@uwaterloo.ca
I have determined as much as I can behind my Assert error, but have yet to
fix it... I am still trying to build a table with MultiExecProcNode and
probe with the other (therefore, still Hybrid Hash Join - but I have
switched the outer and the inner).
It appears the error occurs in ExecScanHashBucket() when a match is found
and the line "if (ExecQual(hjclauses, econtext, false))" is called. This
(unsurprisingly) is where the Assert error stems from in execQual.c.
I also checked by doing a print out of the building of my hashtable
(insertions of what hash values into which buckets), as well as the
probing that occurs. You can see that the Assert error happens when a
probe clearly matches one of the values in the hashtable (bucket: 911,
hashvalue: 4294966991). I have added this output below (please feel free
to remove it if you think it is unacceptable for the news group... I
figure it's not code - or even working properly).
LOG: database system was shut down at 2011-03-04 05:55:50 EST
LOG: checkpoint record is at 0/3BDD70
LOG: redo record is at 0/3BDD70; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 881; next OID: 16412
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
Storing hashvalue in hashtable --> 4294967188
Storing in hashtable at bucket # --> 75
Storing hashvalue in hashtable --> 4294967092
Storing in hashtable at bucket # --> 1012
Storing hashvalue in hashtable --> 4294966994
Storing in hashtable at bucket # --> 914
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Probing hashvalue --> 4294967194
Storing in hashtable at bucket # --> 81
Probing Bucket #: 81
Probing hashvalue --> 4294967094
Storing in hashtable at bucket # --> 1014
Probing Bucket #: 1014
Probing hashvalue --> 4294967190
Storing in hashtable at bucket # --> 77
Probing Bucket #: 77
Probing hashvalue --> 4294967193
Storing in hashtable at bucket # --> 80
Probing Bucket #: 80
Probing hashvalue --> 4294966893
Storing in hashtable at bucket # --> 813
Probing Bucket #: 813
Probing hashvalue --> 4294967090
Storing in hashtable at bucket # --> 1010
Probing Bucket #: 1010
Probing hashvalue --> 4294966894
Storing in hashtable at bucket # --> 814
Probing Bucket #: 814
Probing hashvalue --> 4294967093
Storing in hashtable at bucket # --> 1013
Probing Bucket #: 1013
Probing hashvalue --> 4294967192
Storing in hashtable at bucket # --> 79
Probing Bucket #: 79
Probing hashvalue --> 4294966993
Storing in hashtable at bucket # --> 913
Probing Bucket #: 913
Probing hashvalue --> 4294966991
Storing in hashtable at bucket # --> 911
Probing Bucket #: 911
ExecScanHashBucket MATCH FOUND.
TRAP: FailedAssertion("!(variable->vartype == tuple_type->attrs[attnum -
"execQual.c", Line: 503)
LOG: server process (PID 63760) was terminated by signal 6
LOG: terminating any other active server processes
FATAL: the database system is in recovery mode
Therefore, everything seems to be working fine. Both the hashvalues and
the buckets are being determined correctly - it's simply an error that
crops up in ExecScanHashBucket() and furthermore ExecQual() that is
causing the issue...
This was a complete re-write and the error came back so it doesn't appear
to be a one-off.
Any idea what might be the source of my error?
Ken Salem
2011-03-04 22:29:42 UTC
Permalink
Jonathan -

I'm not sure what the problem is. Are you sure that the
call to ExecQual that is failing is the call from
ExecScanHashBucket? (A stack backtrace in the debugger
- via the "where" command - will confirm that.)

If so, here are a couple of things to check:
- is ExecScanHashBucket scanning the correct hash table?
- the arguments to ExecQual in ExecScanHashBucket are
join clauses and an expression context. If ExecQual is
breaking, it's likely that the problem is in one of those
two inputs. Look at everyplace in the nodeHashjoin.c where
expression context or hash join clauses are being set.

-KMS
Post by j***@uwaterloo.ca
I have determined as much as I can behind my Assert error, but have yet to
fix it... I am still trying to build a table with MultiExecProcNode and
probe with the other (therefore, still Hybrid Hash Join - but I have
switched the outer and the inner).
It appears the error occurs in ExecScanHashBucket() when a match is found
and the line "if (ExecQual(hjclauses, econtext, false))" is called. This
(unsurprisingly) is where the Assert error stems from in execQual.c.
I also checked by doing a print out of the building of my hashtable
(insertions of what hash values into which buckets), as well as the
probing that occurs. You can see that the Assert error happens when a
probe clearly matches one of the values in the hashtable (bucket: 911,
hashvalue: 4294966991). I have added this output below (please feel free
to remove it if you think it is unacceptable for the news group... I
figure it's not code - or even working properly).
LOG: database system was shut down at 2011-03-04 05:55:50 EST
LOG: checkpoint record is at 0/3BDD70
LOG: redo record is at 0/3BDD70; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 881; next OID: 16412
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
Storing hashvalue in hashtable --> 4294967188
Storing in hashtable at bucket # --> 75
Storing hashvalue in hashtable --> 4294967092
Storing in hashtable at bucket # --> 1012
Storing hashvalue in hashtable --> 4294966994
Storing in hashtable at bucket # --> 914
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Probing hashvalue --> 4294967194
Storing in hashtable at bucket # --> 81
Probing Bucket #: 81
Probing hashvalue --> 4294967094
Storing in hashtable at bucket # --> 1014
Probing Bucket #: 1014
Probing hashvalue --> 4294967190
Storing in hashtable at bucket # --> 77
Probing Bucket #: 77
Probing hashvalue --> 4294967193
Storing in hashtable at bucket # --> 80
Probing Bucket #: 80
Probing hashvalue --> 4294966893
Storing in hashtable at bucket # --> 813
Probing Bucket #: 813
Probing hashvalue --> 4294967090
Storing in hashtable at bucket # --> 1010
Probing Bucket #: 1010
Probing hashvalue --> 4294966894
Storing in hashtable at bucket # --> 814
Probing Bucket #: 814
Probing hashvalue --> 4294967093
Storing in hashtable at bucket # --> 1013
Probing Bucket #: 1013
Probing hashvalue --> 4294967192
Storing in hashtable at bucket # --> 79
Probing Bucket #: 79
Probing hashvalue --> 4294966993
Storing in hashtable at bucket # --> 913
Probing Bucket #: 913
Probing hashvalue --> 4294966991
Storing in hashtable at bucket # --> 911
Probing Bucket #: 911
ExecScanHashBucket MATCH FOUND.
TRAP: FailedAssertion("!(variable->vartype == tuple_type->attrs[attnum -
"execQual.c", Line: 503)
LOG: server process (PID 63760) was terminated by signal 6
LOG: terminating any other active server processes
FATAL: the database system is in recovery mode
Therefore, everything seems to be working fine. Both the hashvalues and
the buckets are being determined correctly - it's simply an error that
crops up in ExecScanHashBucket() and furthermore ExecQual() that is
causing the issue...
This was a complete re-write and the error came back so it doesn't appear
to be a one-off.
Any idea what might be the source of my error?
Richard Desimone
2011-03-07 01:46:32 UTC
Permalink
We are also having this problem. It is caused by, in the
ExecScanHashBucket code, the line calls ExecQual(hjclauses, econtext,
false). This call wasn't added by us and we're not sure what it
does...it also works for some queries but fails in other ones and we
have been unable to figure out what is causing it to fail. Did anyone
else run into this problem who is able to help us out?

Thanks!
Richard
Post by j***@uwaterloo.ca
I have determined as much as I can behind my Assert error, but have yet to
fix it... I am still trying to build a table with MultiExecProcNode and
probe with the other (therefore, still Hybrid Hash Join - but I have
switched the outer and the inner).
It appears the error occurs in ExecScanHashBucket() when a match is found
and the line "if (ExecQual(hjclauses, econtext, false))" is called. This
(unsurprisingly) is where the Assert error stems from in execQual.c.
I also checked by doing a print out of the building of my hashtable
(insertions of what hash values into which buckets), as well as the
probing that occurs. You can see that the Assert error happens when a
probe clearly matches one of the values in the hashtable (bucket: 911,
hashvalue: 4294966991). I have added this output below (please feel free
to remove it if you think it is unacceptable for the news group... I
figure it's not code - or even working properly).
LOG: database system was shut down at 2011-03-04 05:55:50 EST
LOG: checkpoint record is at 0/3BDD70
LOG: redo record is at 0/3BDD70; undo record is at 0/0; shutdown TRUE
LOG: next transaction ID: 881; next OID: 16412
LOG: next MultiXactId: 1; next MultiXactOffset: 0
LOG: database system is ready
LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
Storing hashvalue in hashtable --> 4294967188
Storing in hashtable at bucket # --> 75
Storing hashvalue in hashtable --> 4294967092
Storing in hashtable at bucket # --> 1012
Storing hashvalue in hashtable --> 4294966994
Storing in hashtable at bucket # --> 914
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Storing hashvalue in hashtable --> 4294966991
Storing in hashtable at bucket # --> 911
Probing hashvalue --> 4294967194
Storing in hashtable at bucket # --> 81
Probing Bucket #: 81
Probing hashvalue --> 4294967094
Storing in hashtable at bucket # --> 1014
Probing Bucket #: 1014
Probing hashvalue --> 4294967190
Storing in hashtable at bucket # --> 77
Probing Bucket #: 77
Probing hashvalue --> 4294967193
Storing in hashtable at bucket # --> 80
Probing Bucket #: 80
Probing hashvalue --> 4294966893
Storing in hashtable at bucket # --> 813
Probing Bucket #: 813
Probing hashvalue --> 4294967090
Storing in hashtable at bucket # --> 1010
Probing Bucket #: 1010
Probing hashvalue --> 4294966894
Storing in hashtable at bucket # --> 814
Probing Bucket #: 814
Probing hashvalue --> 4294967093
Storing in hashtable at bucket # --> 1013
Probing Bucket #: 1013
Probing hashvalue --> 4294967192
Storing in hashtable at bucket # --> 79
Probing Bucket #: 79
Probing hashvalue --> 4294966993
Storing in hashtable at bucket # --> 913
Probing Bucket #: 913
Probing hashvalue --> 4294966991
Storing in hashtable at bucket # --> 911
Probing Bucket #: 911
ExecScanHashBucket MATCH FOUND.
TRAP: FailedAssertion("!(variable->vartype == tuple_type->attrs[attnum -
"execQual.c", Line: 503)
LOG: server process (PID 63760) was terminated by signal 6
LOG: terminating any other active server processes
FATAL: the database system is in recovery mode
Therefore, everything seems to be working fine. Both the hashvalues and
the buckets are being determined correctly - it's simply an error that
crops up in ExecScanHashBucket() and furthermore ExecQual() that is
causing the issue...
This was a complete re-write and the error came back so it doesn't appear
to be a one-off.
Any idea what might be the source of my error?
j***@uwaterloo.ca
2011-03-07 03:08:35 UTC
Permalink
Hey Richard,

I'm still suffering from the same error as well.

A question for you: Are you running Postgres on your own machine? If so,
are you running it on a MAC?

It's unlikely this is the issue, but I am running mine on a MAC and read
an article online stating that Postgres issued a "server process was
terminated by signal 6" on another Mac... wanted to make sure it wasn't
more than a coincidence.

I doubt it though, since the Hybrid Hash Join worked just fine.

Anyways, if I figure out anything I will let you know. If you could do the
same that would be great!

Thanks,

Jon
Jeice Cypher
2011-03-07 07:05:08 UTC
Permalink
I too have been stuck with this for quite a while.

In the debugger, I know that the assert should be working. For example,
I can see that (made up numbers, but the point is still there):

variable->vartype = 42
tuple_type->attrs[attnum - 1]->atttypid = 42

so that assert statement should be working, from what I can gather, it's
not working because when I try to access tuple_type->attrs[attnum
-1]->atttypid, it says, "Cannot access memory at address 0x17"

So, even though the values are the same, since we can't access that
memory location, we can't actually compare the two values. I have no
idea how to fix it though, will get back if I figure it out.
Post by j***@uwaterloo.ca
Hey Richard,
I'm still suffering from the same error as well.
A question for you: Are you running Postgres on your own machine? If so,
are you running it on a MAC?
It's unlikely this is the issue, but I am running mine on a MAC and read
an article online stating that Postgres issued a "server process was
terminated by signal 6" on another Mac... wanted to make sure it wasn't
more than a coincidence.
I doubt it though, since the Hybrid Hash Join worked just fine.
Anyways, if I figure out anything I will let you know. If you could do the
same that would be great!
Thanks,
Jon
Loading...