Actually, I already compiled the source code with "-O0" and then got those backtraces.
The hippobuild function just starts building an index access method and it will call hippobuildcallback to iterate each parent table tuple in its function body.
What makes me fell very confused is that the same code works when I call "make check" to run regression test (testing my index) but fails at running normal PG server.
Here are the lines before and after the problematic line hippo.c 154. It is the first line of this function and did nothing.
On the other hand, I will try to adjust my code to fit in PG 9.6 as you suggested.
--------------------------------------
static void hippobuildcallback()
{
.....
.....
.....
Line 148 }
Line 149 /*
Line 150 *This function initializes the entire Hippo. It will call buildcallback many times.
On Mon, Jan 23, 2017 at 2:00 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jia Yu <jiayu198910@gmail.com> writes: > However, these methods don't work in the normal PG server. It gave me > "segmentation fault" > ... > Here is my backtrace. It looks like I cannot access fcinfo. Can you help me > about this? Or just some hints? I have been struggling with this problem > for weeks.
What's the problematic line (hippo.c:154) doing? What's before that in the hippobuild function?
I wouldn't put much stock in the "Cannot access memory" message ... that just means gdb is confused, which it frequently is. But possibly building with -O0 would make it less confused.
BTW, I gather from the reference to OidFunctionCall3Coll that you're using PG 9.5 or older. It'd be a good idea to switch to 9.6, which has noticeably cleaner indexam APIs that allow some compiler error checking on those calls.