BUG #1092: Memory Fault in PQsetdbLogin

Started by PostgreSQL Bugs Listabout 22 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

The following bug has been logged online:

Bug reference: 1092
Logged by: Fred Eisele

Email address: fred@netarx.com

PostgreSQL version: 7.4

Operating system: Debian/GNU unstable (kernel 2.6.3)

Description: Memory Fault in PQsetdbLogin

Details:

When opening two connections using PQsetdbLogin one of the connections was
apparently being dropped, and I would get segmentation errors.
I rebuilt the program using dmalloc and it reported...
debug-malloc library: dumping program, fatal error
Error: invalid allocation size (err 40)
...when PQsetdbLogin was called.
I replaced the call to PQsetdbLogin with an equivalent call to PQconnectdb.
dmalloc does not report any errors with PQconnectdb and the original two
problems seem to have gone away.
As far as I am concerned, deprecating PQsetdbLogin is an adequate fix.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: BUG #1092: Memory Fault in PQsetdbLogin

"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:

When opening two connections using PQsetdbLogin one of the connections was
apparently being dropped, and I would get segmentation errors.
I rebuilt the program using dmalloc and it reported...
debug-malloc library: dumping program, fatal error
Error: invalid allocation size (err 40)
...when PQsetdbLogin was called.
I replaced the call to PQsetdbLogin with an equivalent call to PQconnectdb.
dmalloc does not report any errors with PQconnectdb and the original two
problems seem to have gone away.

This is a bit hard to believe, seeing that as of 7.4 these two functions
are trivial wrappers around the same set of underlying functions.
You're going to need to provide more detail, or preferably a
reproducible test case.

regards, tom lane