Re: [HACKERS] Foreign memory context read

2011-05-23 Thread Vaibhav Kaushal
Indeed I was acting weird there. I had completely forgotten about the bool pointer. Moreover, I actually got confused about the palloc0's return type...whether it was a datum or a pointer to datum. Looked back at the expansion and got it clear. Thanks a lot Mr. Tom. Regards, Vaibhav On Mon, 20

Re: [HACKERS] Foreign memory context read

2011-05-23 Thread Vaibhav Kaushal
Oh...well... I messed it up! Thanks a lot for that. The problem I think is the bool pointer. Will check it soon. -- Sent from my Android On 23 May 2011 19:28, "Tom Lane" wrote: > Vaibhav Kaushal writes: >> My mind started wandering after that error. Now, actually, i was trying to >> do something

Re: [HACKERS] Foreign memory context read

2011-05-23 Thread Tom Lane
Vaibhav Kaushal writes: > My mind started wandering after that error. Now, actually, i was trying to > do something like this: > *last_result = palloc0(sizeof(Datum)); > bool *isnnuull = true; > *last_result = slot_getattr(slot, num_atts, *isnnuull); This seems utterly confused about data types.

Re: [HACKERS] Foreign memory context read

2011-05-23 Thread Vaibhav Kaushal
Thanks for the suggestion. I will look into that shortly and let you know. By the way i am on fedora 13. -- Sent from my Android On 23 May 2011 17:28, "Kevin Grittner" wrote: > Vaibhav Kaushal wrote: > >> Do you think its the 'slot_getattr' causing the seg-fault? > > On many platforms it's not ha

Re: [HACKERS] Foreign memory context read

2011-05-23 Thread Kevin Grittner
Vaibhav Kaushal wrote: > Do you think its the 'slot_getattr' causing the seg-fault? On many platforms it's not hard to get a core file out of a segfault (perhaps by using ulimit), and then get a stack trace (using gdb or similar) to see exactly where it is happening. -Kevin -- Sent via pg

Re: [HACKERS] Foreign memory context read

2011-05-23 Thread Vaibhav Kaushal
Well, I had thought of the same what you said. My mind started wandering after that error. Now, actually, i was trying to do something like this: *last_result = palloc0(sizeof(Datum)); bool *isnnuull = true; *last_result = slot_getattr(slot, num_atts, *isnnuull); elog(INFO, "Last result for slot_

Re: [HACKERS] Foreign memory context read

2011-05-23 Thread Heikki Linnakangas
On 23.05.2011 13:44, Vaibhav Kaushal wrote: Hello, I made some code changes, compilation went fine but the database could not start with the message: LOG: server process (PID 17684) was terminated by signal 11: Segmentation fault I think this is because of memory allocation outside of any mem

[HACKERS] Foreign memory context read

2011-05-23 Thread Vaibhav Kaushal
Hello, I made some code changes, compilation went fine but the database could not start with the message: LOG: server process (PID 17684) was terminated by signal 11: Segmentation fault I think this is because of memory allocation outside of any memory context. Is it possible to create some va