Foreign memory context read - Mailing list pgsql-hackers

From Vaibhav Kaushal
Subject Foreign memory context read
Date
Msg-id BANLkTi=VN93FCH1rp_jyqFL1AfZZFtiFAQ@mail.gmail.com
Whole thread Raw
Responses Re: Foreign memory context read  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
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 variable in a memory context (say "cut_context") and then access the variable in that context from a piece of code which is working with variables in a different context (say the "per_query" context)?

If yes, then how? 

My first guess is a Memory Context switch. But then, I need to bring in the value of the variable from the cut_context (which was formed earlier) to the per_query context which was created later on. 

Precisely I am trying to create a small array of Datums (before the ExecQual is called inside ExecScan) and then use the array inside the ExecEvalVar (which obviously is inside the executer).

Any help pointers towards the solution of this problem?

Regards,
Vaibhav


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: Alignment padding bytes in arrays vs the planner
Next
From: Heikki Linnakangas
Date:
Subject: Re: Foreign memory context read