Re: [HACKERS] help to identify the reason that extension's C function returns array get segmentation fault

2017-02-28 Thread 钱新林
Thanks for your clues. The system I have used to debug the code is x86 64bit based, Ubuntu 1404 and postgres 9.3.13, I have revised the code and it looks like as following: Datum vquery(PG_FUNCTION_ARGS) { int array_len = PG_GETARG_INT32(0); int64 * node_ids; ArrayType * retarr; Datum * vals ;

Re: [HACKERS] help to identify the reason that extension's C function returns array get segmentation fault

2017-02-27 Thread Tom Lane
=?UTF-8?B?6ZKx5paw5p6X?= writes: > I have written an extension to manage openstreetmap data. There is a C > function to perform spatial top k query on several tables and return an > array of int8 type as result. The code skeleton of this function is as > follows: There are a remarkable lot of bu

[HACKERS] help to identify the reason that extension's C function returns array get segmentation fault

2017-02-27 Thread 钱新林
I have written an extension to manage openstreetmap data. There is a C function to perform spatial top k query on several tables and return an array of int8 type as result. The code skeleton of this function is as follows: Datum vquery(PG_FUNCTION_ARGS) { int array_len = PG_GETARG_INT32(0); long