Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2A48F476F4E for ; Wed, 22 Jan 2003 15:18:46 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id B22574765DD for ; Wed, 22 Jan 2003 14:45:31 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 8C5A143A9AD; Wed, 22 Jan 2003 14:45:31 -0500 (EST) From: Gerhard Hintermayer X-Newsgroups: comp.databases.postgresql.interfaces Subject: Re: still memory leaks with libpgtcl Date: Wed, 22 Jan 2003 20:39:30 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 47 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en In-Reply-To: To: pgsql-interfaces@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/92 X-Sequence-Number: 3592 Gerhard Hintermayer wrote: > ljb wrote in message > >>[...] >>(This is for PostgreSQL-7.3.1) >> >>--- src/interfaces/libpgtcl/pgtclId.c.bak 2002-10-17 10:53:32.000000000 -0400 >>+++ src/interfaces/libpgtcl/pgtclId.c 2003-01-07 21:51:53.000000000 -0500 >>@@ -300,12 +300,10 @@ >> * small) amount of memory taken for the channel state representation. >> * Note we are not leaking a socket, since libpq closed that already. >> */ >>-#ifdef NOT_USED >> #if TCL_MAJOR_VERSION >= 8 >>- if (connid->notifier_channel != NULL) >>+ if (connid->notifier_channel != NULL && interp != NULL) >> Tcl_UnregisterChannel(NULL, connid->notifier_channel); >> #endif >>-#endif >> >> /* >> * We must use Tcl_EventuallyFree because we don't want the connid > > > Your patch does indeed fix the memory leakage but seems to introduce > another problem. Every once in a while I do get segfaults, when I > enter the event loop after pg_disconnect-ing (well, it looks like that > to me). I have to say, that this is the only script, where the error > occurs. All others (~500) work with no problem at all. I was trying to > reproduce that in a short script, but - no way. I am not even sure, if > this is postgreSQL related. I did build a static wish with > --enable-symbols=all and --enable-memory to track the error down. Hope > I'll see more then. > > Gerhard I found out (actually it was Joe English from TCT), that the segfault was due to an error in tk (Bug #671330). So I see no reason, why the above patch should'nt be applied to further releases. I have running lot's of scripts with the above patch and not having any problem with both memory leaks or segfaults. Gerhard -- Gerhard Hintermayer http://www.inode.at/g.hintermayer