[Pgpool-hackers] First pcp command as PostgreSQL function
Jehan-Guillaume (ioguix) de Rorthais
jgdr at dalibo.com
Fri Apr 22 21:48:31 UTC 2011
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 22/04/2011 22:57, Jehan-Guillaume (ioguix) de Rorthais wrote:
> On 22/04/2011 09:40, Tatsuo Ishii wrote:
>>>>>> Sorry but I couldn't apply your patches nor make working it.
>>>>>> Your patches produced lots of following messages:
>>>>>>
>>>>>> Reversed (or previously applied) patch detected! Assume -R? [n]
>>>>>
>>>>> Look like you tried to apply them multiple times and had an unstable
>>>>> source tree ?
>>>>
>>>> I tried to apply split_reporting_functions-2.patch after
>>>> split_reporting_functions-1.patch, or just
>>>> split_reporting_functions-2.patch without success.
>>>
>>> it was split_reporting_functions-2.patch, then pcp_pool_status.patch-1.patch
>>> Anyway doesn't matter now.
>
>> Oh I seem to do in reverse order.
>> Anyway, I have committed your patches. Thanks!
>
>> Regarding pgpool_adm unfortunately I got PostgreSQL backend crash with
>> double free memory:
>
> [...]
> It seems this double free happened in pcp_close(), where we have a
> free() on pc->fd, pc->wbuf, pc->hp and pc, anyway, and I never deal with
> them in my code...
>
> I tried to investigate the pcp.c and pcp_stream.c code, I hadn't find
> the bug yet
Found the bug.
===================cut here=============>
*** pgpool-II/pcp/pcp.c 2011-04-22 20:32:09.818429545 +0200
- --- pgpool-II.status/pcp/pcp.c 2011-04-22 23:43:15.588429544 +0200
***************
*** 168,173 ****
- --- 168,174 ----
if (pcp_authorize(username, password) < 0)
{
pcp_close(pc);
+ pc = NULL;
return -1;
}
<===================cut here=============
I'm not really happy with the fix, but I found this kind of code in some
other places and having something more elegant would probably require
way much more refactoring.
- --
Jehan-Guillaume (ioguix) de Rorthais
DBA
http://www.dalibo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk2x968ACgkQXu9L1HbaT6JFAwCfb2dLAud5+gx04SYmGXb/cOwa
N1IAoNZjXLhzA2tCYFHDA88HbTbJ3T7G
=vA4p
-----END PGP SIGNATURE-----
More information about the Pgpool-hackers
mailing list