Re: Fix memleaks and error handling in jsonb_plpython

2019-04-06 Thread Michael Paquier
On Sat, Apr 06, 2019 at 05:56:24PM -0400, Tom Lane wrote: > This patch had bit-rotted due to somebody else fooling with the > volatile-qualifiers situation. I fixed it up, tweaked a couple of > things, and pushed it. Thanks, Tom! -- Michael signature.asc Description: PGP signature

Re: Fix memleaks and error handling in jsonb_plpython

2019-04-06 Thread Tom Lane
Michael Paquier writes: > On Wed, Mar 06, 2019 at 11:04:23AM +0900, Michael Paquier wrote: >> Another thing is that you cannot just return within a try block with >> what is added in PLyObject_FromJsonbContainer, or the error stack is >> not reset properly. So they should be replaced by breaks.

Re: Fix memleaks and error handling in jsonb_plpython

2019-03-07 Thread Michael Paquier
On Wed, Mar 06, 2019 at 11:04:23AM +0900, Michael Paquier wrote: > Another thing is that you cannot just return within a try block with > what is added in PLyObject_FromJsonbContainer, or the error stack is > not reset properly. So they should be replaced by breaks. So, I have been poking at this

Re: Fix memleaks and error handling in jsonb_plpython

2019-03-05 Thread Michael Paquier
On Tue, Mar 05, 2019 at 02:10:01PM +0300, Nikita Glukhov wrote: > I known about this volatility issues, but maybe I incorrectly understand what > should be marked as volatile for pointer variables: the pointer itself and/or > the memory referenced by it. I thought that only pointer needs to be mar

Re: Fix memleaks and error handling in jsonb_plpython

2019-03-05 Thread Nikita Glukhov
On 05.03.2019 6:45, Michael Paquier wrote: On Fri, Mar 01, 2019 at 05:24:39AM +0300, Nikita Glukhov wrote: Unfortunately, contrib/jsonb_plpython still contain a lot of problems in error handling that can lead to memory leaks: - not all Python function calls are checked for the success - not

Re: Fix memleaks and error handling in jsonb_plpython

2019-03-04 Thread Michael Paquier
On Fri, Mar 01, 2019 at 05:24:39AM +0300, Nikita Glukhov wrote: > Unfortunately, contrib/jsonb_plpython still contain a lot of problems in error > handling that can lead to memory leaks: > - not all Python function calls are checked for the success > - not in all places PG exceptions are caught t