pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedmemory leak in ODBC driver
7+ messages / 3 participants
[nested] [flat]
* memory leak in ODBC driver
@ 2004-11-27 18:11 Scot Loach <sloach@sandvine.com>
0 siblings, 0 replies; 7+ messages in thread
From: Scot Loach @ 2004-11-27 18:11 UTC (permalink / raw)
To: pgsql-odbc
There is a 16-byte leak for every statement handle that has SQLFetch called on it.
I have tracked this leak down to its source:
SC_Fetch calls extend_getdata_info, which allocates memory for the stmt.getdata_info.
However, this memory is never freed when the statement is deallocated.
This patch seems to fix the problem - however I don't know enough about the internals of the driver to really understand if this is the correct or safe fix.
Can one of the developers help me out here?
inline patch 1: statement.c (+2/-0 lines) download inline-1.patch
--- statement.c.old 2004-11-27 13:07:57.000000000 -0500
+++ statement.c 2004-11-27 13:09:37.000000000 -0500
@@ -354,6 +354,8 @@
if (self->callbacks)
free(self->callbacks);
+ GDATA_unbind_cols(SC_get_GDTI(self), TRUE);
+
DELETE_STMT_CS(self);
free(self);
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: memory leak in ODBC driver
@ 2004-11-27 23:19 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 7+ messages in thread
From: Dave Page @ 2004-11-27 23:19 UTC (permalink / raw)
To: Scot Loach <sloach@sandvine.com>; pgsql-odbc
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Scot Loach
> Sent: 27 November 2004 18:11
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] memory leak in ODBC driver
>
> There is a 16-byte leak for every statement handle that has
> SQLFetch called on it.
> I have tracked this leak down to its source:
> SC_Fetch calls extend_getdata_info, which allocates memory
> for the stmt.getdata_info.
> However, this memory is never freed when the statement is deallocated.
>
> This patch seems to fix the problem - however I don't know
> enough about the internals of the driver to really understand
> if this is the correct or safe fix.
> Can one of the developers help me out here?
It certainly *looks* OK to me, but I share the same concerns as you
(I've never really got that far inside the driver before). Anyone else
care to comment?
Regards, Dave.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: memory leak in ODBC driver
@ 2004-11-30 02:30 Scot Loach <sloach@sandvine.com>
0 siblings, 0 replies; 7+ messages in thread
From: Scot Loach @ 2004-11-30 02:30 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; pgsql-odbc
I've done some more code inspection and I think my fix is ok.
I'll make the change to my code base and I'll let you know if I have any problems with it.
I've submitted bug #1067 for this.
scot.
-----Original Message-----
From: Dave Page [mailto:dpage@vale-housing.co.uk]
Sent: Sat 11/27/2004 6:19 PM
To: Scot Loach; pgsql-odbc@postgresql.org
Cc:
Subject: RE: [ODBC] memory leak in ODBC driver
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Scot Loach
> Sent: 27 November 2004 18:11
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] memory leak in ODBC driver
>
> There is a 16-byte leak for every statement handle that has
> SQLFetch called on it.
> I have tracked this leak down to its source:
> SC_Fetch calls extend_getdata_info, which allocates memory
> for the stmt.getdata_info.
> However, this memory is never freed when the statement is deallocated.
>
> This patch seems to fix the problem - however I don't know
> enough about the internals of the driver to really understand
> if this is the correct or safe fix.
> Can one of the developers help me out here?
It certainly *looks* OK to me, but I share the same concerns as you
(I've never really got that far inside the driver before). Anyone else
care to comment?
Regards, Dave.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: memory leak in ODBC driver
@ 2004-11-30 08:40 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 1 reply; 7+ messages in thread
From: Dave Page @ 2004-11-30 08:40 UTC (permalink / raw)
To: Scot Loach <sloach@sandvine.com>; pgsql-odbc
> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 30 November 2004 02:31
> To: Dave Page; pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] memory leak in ODBC driver
>
> I've done some more code inspection and I think my fix is ok.
>
> I'll make the change to my code base and I'll let you know if
> I have any problems with it.
>
> I've submitted bug #1067 for this.
OK, thanks. Let me knoiw when you're happy with your testing and I'll
commit the patch given the lack of other opinions!!
Regards, Dave
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: memory leak in ODBC driver
@ 2004-12-21 01:25 Bruce Momjian <pgman@candle.pha.pa.us>
parent: Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 7+ messages in thread
From: Bruce Momjian @ 2004-12-21 01:25 UTC (permalink / raw)
To: Dave Page <dpage@vale-housing.co.uk>; +Cc: Scot Loach <sloach@sandvine.com>; pgsql-odbc
Dave Page wrote:
>
>
> > -----Original Message-----
> > From: Scot Loach [mailto:sloach@sandvine.com]
> > Sent: 30 November 2004 02:31
> > To: Dave Page; pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] memory leak in ODBC driver
> >
> > I've done some more code inspection and I think my fix is ok.
> >
> > I'll make the change to my code base and I'll let you know if
> > I have any problems with it.
> >
> > I've submitted bug #1067 for this.
>
> OK, thanks. Let me knoiw when you're happy with your testing and I'll
> commit the patch given the lack of other opinions!!
Scot, is this ready to be applied to ODBC?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: memory leak in ODBC driver
@ 2004-12-21 14:59 Scot Loach <sloach@sandvine.com>
0 siblings, 0 replies; 7+ messages in thread
From: Scot Loach @ 2004-12-21 14:59 UTC (permalink / raw)
To: Bruce Momjian <pgman@candle.pha.pa.us>; Dave Page <dpage@vale-housing.co.uk>; +Cc: pgsql-odbc
Sure, we can apply it, I haven't had any problems with it.
-----Original Message-----
From: pgsql-odbc-owner@postgresql.org
[mailto:pgsql-odbc-owner@postgresql.org]On Behalf Of Bruce Momjian
Sent: Monday, December 20, 2004 8:26 PM
To: Dave Page
Cc: Scot Loach; pgsql-odbc@postgresql.org
Subject: Re: [ODBC] memory leak in ODBC driver
Dave Page wrote:
>
>
> > -----Original Message-----
> > From: Scot Loach [mailto:sloach@sandvine.com]
> > Sent: 30 November 2004 02:31
> > To: Dave Page; pgsql-odbc@postgresql.org
> > Subject: RE: [ODBC] memory leak in ODBC driver
> >
> > I've done some more code inspection and I think my fix is ok.
> >
> > I'll make the change to my code base and I'll let you know if
> > I have any problems with it.
> >
> > I've submitted bug #1067 for this.
>
> OK, thanks. Let me knoiw when you're happy with your testing and I'll
> commit the patch given the lack of other opinions!!
Scot, is this ready to be applied to ODBC?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: memory leak in ODBC driver
@ 2004-12-21 15:09 Dave Page <dpage@vale-housing.co.uk>
0 siblings, 0 replies; 7+ messages in thread
From: Dave Page @ 2004-12-21 15:09 UTC (permalink / raw)
To: Scot Loach <sloach@sandvine.com>; Bruce Momjian <pgman@candle.pha.pa.us>; +Cc: pgsql-odbc
> -----Original Message-----
> From: Scot Loach [mailto:sloach@sandvine.com]
> Sent: 21 December 2004 15:00
> To: Bruce Momjian; Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] memory leak in ODBC driver
>
> Sure, we can apply it, I haven't had any problems with it.
>
Thanks, patch applied.
Regards, Dave.
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2004-12-21 15:09 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-27 18:11 memory leak in ODBC driver Scot Loach <sloach@sandvine.com>
2004-11-27 23:19 Re: memory leak in ODBC driver Dave Page <dpage@vale-housing.co.uk>
2004-11-30 02:30 Re: memory leak in ODBC driver Scot Loach <sloach@sandvine.com>
2004-11-30 08:40 Re: memory leak in ODBC driver Dave Page <dpage@vale-housing.co.uk>
2004-12-21 01:25 ` Bruce Momjian <pgman@candle.pha.pa.us>
2004-12-21 14:59 Re: memory leak in ODBC driver Scot Loach <sloach@sandvine.com>
2004-12-21 15:09 Re: memory leak in ODBC driver Dave Page <dpage@vale-housing.co.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox