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 ;

[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