segmentation fault in function

From: Sergej Galkin <sergej(dot)galkin(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: segmentation fault in function
Date: 2010-01-13 19:53:30
Message-ID: dfebc1f11001131153rd60155dn98924b5e4850083a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I am realizing gist index and get a bug, that crashes DB. I' debugged my
program as Robert(thanks !) advised me and I know which procedure crashed.

*Datum gist_mov_consistent(PG_FUNCTION_ARGS)*
*{*
* GISTENTRY *entry = (GISTENTRY *)PG_GETARG_POINTER(0);*
* BOX *query = PG_GETARG_BOX_P(1);*
* StrategyNumber strategy = (StrategyNumber)PG_GETARG_UINT16(2);*
* *
* if (DatumGetMovP(entry->key) == NULL || query == NULL)*
* PG_RETURN_BOOL(FALSE);*
* *
* PG_RETURN_BOOL(obj_contains(DatumGetMovP(entry->key), query));*
*}*

*int obj_contains(moving_object *a, BOX *b)*
*{*
* *
* if (b->low.x > a->x_low)*
* return 0;*
* if (b->low.y > a->y_low)*
* return 0;*
* if (b->high.x < a->x_high)*
* return 0;*
* if (b->high.y < a->y_high)*
* return 0;*
* return 1;*
*}
**
Do you have any ideas ?**

Best regards,
Sergej Galkin
*

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-01-13 19:54:49 Re: [PATCH] remove redundant ownership checks
Previous Message Robert Haas 2010-01-13 19:46:41 Re: [PATCH] remove redundant ownership checks