Re: Memory Context problems... - Mailing list pgsql-hackers

From Katsaros Kwn/nos
Subject Re: Memory Context problems...
Date
Msg-id 1099914304.5884.35.camel@localhost.localdomain
Whole thread Raw
In response to Re: Memory Context problems...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, 2004-11-07 at 21:31, Tom Lane wrote:
> "Katsaros Kwn/nos" <ntinos@aueb.gr> writes:
> > More precisely,when I call (my_)SPI_prepare the following message comes
> > exactly at the point where (my_)SPI_end_call(true) is called:
> 
> > WARNING:  problem in alloc set my_SPI Exec: detected write past chunk
> > end in block 0x830b7e8, chunk 0x830c058
> > WARNING:  problem in alloc set my_SPI Exec: detected write past chunk
> > end in block 0x8307720, chunk 0x830b6cc
> 
> > Any ideas? I think it is something with the memory contexts but
> > obviously this is not enough to solve the problem.
> 
> I'd bet on buffer-overrun problems.  Check your allocation request sizes
> against what's actually being used.

I tried to increase the allocated memory using ALLOCSET_DEFAULT_*SIZE
just to see what would happen, but nothing.What is returned is a Plan
node and some (3 in my example) Query nodes. All inside a List. Are
these too big to fit? 

When my user defined procedure (that calls my_SPI functions) returns,
the following message also appears:

WARNING:  problem in alloc set my_SPI Results: detected write past chunk
end in block 0x8313550, chunk 0x8315140

which is obviously about the same kind of problem. The thing is that I
noticed that this latter message appears as many times as I palloc
inside my_SPI_copy_results() function which is an extension of
_SPI_copy_plan(). 

I cannot understand what the problem is since I do similar things with
_SPI_copy_plan. I palloc() exactly at the same places with the original
func. Is it that I use Lists as a mean of returning multiple objects to
the user defined function or even that I call another function that
pallocs before calling my_SPI_copy_results() (this other function
produces the Query nodes)? Are there any other places in the source
other than (my_)spi.c, (my_)spi.h and xact.c (AtEOXact_(my_)SPI() call)
that I should make an entry regarding my code? 


Thanks for your interest!
Ntinos




pgsql-hackers by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: pg_arch.c call to sleep()
Next
From: Gaetano Mendola
Date:
Subject: Re: NoMovementScanDirection