Foreign memory context read

From: Vaibhav Kaushal <vaibhavkaushal123(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Foreign memory context read
Date: 2011-05-23 10:44:27
Message-ID: BANLkTi=VN93FCH1rp_jyqFL1AfZZFtiFAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-05-23 11:23:33 Re: Foreign memory context read
Previous Message Noah Misch 2011-05-23 05:12:32 Re: Alignment padding bytes in arrays vs the planner