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

From Katsaros Kwn/nos
Subject Memory Context problems...
Date
Msg-id 1099847634.12836.18.camel@localhost.localdomain
Whole thread Raw
Responses Re: Memory Context problems...
List pgsql-hackers
Hi everybody,
I have some problems with management of memory contexts (at least I
thing so). I'll try to describe my problem in a few lines:

I've written some code based on spi.c. I've created my_spi.c (and
my_spi.h) which provide some more features I wanted (did not alter spi
itself to keep code clear). Anyway, I've managed to get them into the
backend and call some of the functions from a user defined function. The
problem is that I experience some problems during the transition from
one memory context to another. 

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

Moreover, when I true to call (my_)SPI_finish the server crashes.

Note, that the results expected from the my_SPI calls are returned
correctly.

Any ideas? I think it is something with the memory contexts but
obviously this is not enough to solve the problem.

Thank you in advance!
Ntinos Katsaros



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: cygwin build failure
Next
From: Andrew Dunstan
Date:
Subject: pg_arch.c call to sleep()