Thread: BUG #1126: TCP Connection Issues.

BUG #1126: TCP Connection Issues.

From
"PostgreSQL Bugs List"
Date:
The following bug has been logged online:

Bug reference:      1126
Logged by:          Paul Bone

Email address:      boney@digitalerection.com

PostgreSQL version: 7.4

Operating system:   Debian 3.0-r1 (but I'm following testing),  Linux 2.6.4

Description:        TCP Connection Issues.

Details:

Hi Guys.

in postgres 7.4.2:

When connecting with TCP the backend server process "spins" in mallopt (from
/lib/tls/libc)

When I run postmaster with valgrind I get some interesting output.  the
first message is:

Warning: invalid file descriptor 828 in syscall dup()

during initialization (before postmaster forks).

Then when I connect using psql valgrind running on the postmaster backends
says:

==4666== Invalid read of size 4
==4666==    at 0x3C353492: freeaddrinfo (in /lib/tls/libc-2.3.2.so)
==4666==    by 0x81214E9: (within /usr/lib/postgresql/bin/postgres)
==4666==    by 0x81225A0: hba_getauthmethod (in
/usr/lib/postgresql/bin/postgres)
==4666==    by 0x811F5B7: ClientAuthentication (in
/usr/lib/postgresql/bin/postgres)
==4666==  Address 0x3C46BC04 is 28 bytes inside a block of size 48 free'd
==4666==    at 0x3C01F918: free (vg_replace_malloc.c:127)
==4666==    by 0x3C35349C: freeaddrinfo (in /lib/tls/libc-2.3.2.so)
==4666==    by 0x81214E9: (within /usr/lib/postgresql/bin/postgres)
==4666==    by 0x81225A0: hba_getauthmethod (in
/usr/lib/postgresql/bin/postgres)
==4666==
==4666== Invalid free() / delete / delete[]
==4666==    at 0x3C01F918: free (vg_replace_malloc.c:127)
==4666==    by 0x3C35349C: freeaddrinfo (in /lib/tls/libc-2.3.2.so)
==4666==    by 0x81214E9: (within /usr/lib/postgresql/bin/postgres)
==4666==    by 0x81225A0: hba_getauthmethod (in
/usr/lib/postgresql/bin/postgres)
==4666==  Address 0x3C46BBE8 is 0 bytes inside a block of size 48 free'd
==4666==    at 0x3C01F918: free (vg_replace_malloc.c:127)
==4666==    by 0x3C35349C: freeaddrinfo (in /lib/tls/libc-2.3.2.so)
==4666==    by 0x81214E9: (within /usr/lib/postgresql/bin/postgres)
==4666==    by 0x81225A0: hba_getauthmethod (in
/usr/lib/postgresql/bin/postgres)

And then:
==4711== Syscall param write(buf) contains uninitialised or unaddressable
byte(s)
==4711==    at 0x3C3593EE: write (in /lib/tls/libc-2.3.2.so)
==4711==  Address 0x3CF460F0 is not stack'd, malloc'd or free'd
==4655==
==4655== Syscall param write(buf) contains uninitialised or unaddressable
byte(s)
==4655==    at 0x3C3593EE: write (in /lib/tls/libc-2.3.2.so)
==4655==  Address 0x3C551009 is not stack'd, malloc'd or free'd

There are also mentions of supressed errors.

Also while it spins (before the cleint gets bored and goes away).  it isn't
making any syscalls.  it's just in mallopt() which dosn't occur with valgrid
as valgrind uses it's own malloc libraries.

Thankyou.

If this bug-reporting software dosn't keep me up to date with this.  I would
like to be kept up to date.  Thanks.

Paul

Re: BUG #1126: TCP Connection Issues.

From
Tom Lane
Date:
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
> When connecting with TCP the backend server process "spins" in mallopt (from
> /lib/tls/libc)

You seem to have a rather badly broken build :-(.  Did you compile it
yourself or get it from someone else?  If the latter, you need to
complain to the someone else.

If you built Postgres yourself then you need to take another look at the
build process.  I am guessing that something is wrong with the configure
script's results relating to HAVE_STRUCT_ADDRINFO and HAVE_GETADDRINFO,
but it's hard to tell just what.  If you made more than one try at
getting the configuration options right, you might just need to do a
pristine build with the correct options set --- changing options in a
partially complete build tree is risky.

            regards, tom lane