dbTalk Databases Forums  

Re: [BUGS] Libpq free bug? (Was: [ODBC] IIS Postgres ASP ADO - Problem)

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] Libpq free bug? (Was: [ODBC] IIS Postgres ASP ADO - Problem) in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Libpq free bug? (Was: [ODBC] IIS Postgres ASP ADO - Problem) - 08-01-2005 , 06:36 PM






"Dave Page" <dpage (AT) vale-housing (DOT) co.uk> writes:
Quote:
Forwarded to -bugs in case it gets missed.
This looks like it might be an issue to me, though I may well have
overlooked something in my brief look at the code.
There's nothing wrong with that code. The only modifiable values in the
record are the "val" pointers, which are handled correctly. See the
comment:

* PQconninfoOptions[] is a constant static array that we use to initialize
* a dynamically allocated working copy. All the "val" fields in
* PQconninfoOptions[] *must* be NULL. In a working copy, non-null "val"
* fields point to malloc'd strings that should be freed when the working
* array is freed (see PQconninfoFree).

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] Libpq free bug? (Was: [ODBC] IIS Postgres ASP ADO - Problem) - 08-01-2005 , 06:51 PM






Marko Ristola <Marko.Ristola (AT) kolumbus (DOT) fi> writes:
Quote:
I don't know the reason, but that seems to be the problem, that I have
found.

isql crashes under conninfo_parse() on line "free(buf)".
In my experience, this is probably a symptom of some code scribbling
past the end of a malloc'd chunk of memory. What is usually right after
the end of a malloc'd chunk is a portion of malloc's own data
structures, and clobbering that data structure is highly likely to
result in a crash in a later call to malloc, free, or related routines.

You might try running the code under something like Electric Fence.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #3  
Old   
Dave Page
 
Posts: n/a

Default Re: [BUGS] Libpq free bug? (Was: [ODBC] IIS Postgres ASP ADO - Problem) - 08-02-2005 , 02:15 AM



=20

Quote:
-----Original Message-----
From: Tom Lane [mailto:tgl (AT) sss (DOT) pgh.pa.us]=20
Sent: 02 August 2005 00:36
To: Dave Page
Cc: pgsql-bugs (AT) postgresql (DOT) org; pgsql-odbc (AT) postgresql (DOT) org
Subject: Re: [BUGS] Libpq free bug? (Was: [ODBC] IIS Postgres=20
ASP ADO - Problem)=20
=20
"Dave Page" <dpage (AT) vale-housing (DOT) co.uk> writes:
Forwarded to -bugs in case it gets missed.
This looks like it might be an issue to me, though I may well have
overlooked something in my brief look at the code.=20
=20
There's nothing wrong with that code. The only modifiable=20
values in the
record are the "val" pointers, which are handled correctly. See the
comment:
=20
* PQconninfoOptions[] is a constant static array that we use=20
to initialize
* a dynamically allocated working copy. All the "val" fields in
* PQconninfoOptions[] *must* be NULL. In a working=20
copy, non-null "val"
* fields point to malloc'd strings that should be freed when=20
the working
* array is freed (see PQconninfoFree).
Ahh, missed that. Thanks Tom.

Regards, Dave

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.