Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins

From: Richard Huxton <dev(at)archonet(dot)com>
To: Martin Pitt <martin(at)piware(dot)de>
Cc: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins
Date: 2004-05-25 13:56:45
Message-ID: 40B3509D.5050404@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Martin Pitt wrote:
> Hi PostgreSQL developers!
>
> Does anybody happen to use Postgresql with winbind authentication? We
> got the bug report below where this seems to crash.
>
> Is this problem known?

> Subject: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
> Reply-To: Cory Dodt <cdodt(at)turing>, 249083(at)bugs(dot)debian(dot)org
> To: Debian Bug Tracking System <submit(at)bugs(dot)debian(dot)org>
> Date: Fri, 14 May 2004 14:56:11 -0700

> Package: postgresql
> Version: 7.4.2-4
> Severity: normal
>
> [system information]
>
> When configured to look up names with winbind (3.0.2a-1/sarge), postmaster
> crashes with the following:
>
> 2004-05-14 14:50:14 [8725] LOG: could not create IPv6 socket: Address family not supported by protocol
> 2004-05-14 14:50:14 [8725] LOG: authentication file token too long, skipping: "˜.íñ
> Segmentation fault

Duplicated this on Fedora 2 (RPM), but I don't get even that much
logging. I can start single-user /usr/bin/postgres though.

> --------------------
> ... the nsswitch.conf that goes with the above contains:
> hosts: wins files dns
>
> However if I change the name lookup order to:
> hosts: files dns wins
>
> pg starts up normally and the authentication file token error disappears.
> (The IPV6 error remains.)

Don't worry about the IPV6 - that's normal.

If I run gdb --exec=/usr/bin/postmaster
...
Program received signal SIGSEGV, Segmentation fault.
0x008805c7 in getc () from /lib/tls/libc.so.6
(gdb) bt
#0 0x008805c7 in getc () from /lib/tls/libc.so.6
#1 0x0812089b in ?? ()
#2 0xfeefd090 in ?? ()
#3 0x004612d0 in ?? () from /lib/libnss_wins.so.2
#4 0x00000000 in ?? ()

Not much I know, but I don't have time this afternoon to setup and
compile on my workstation.

I can say that the contents of pg_hba.conf don't seem to matter (i.e.
local=trust), so I'm guessing it's looking up the localhost name(s).

The tail of strace /usr/bin/postmaster seems to bear this out:

unlink("/var/lib/pgsql/data/global/pgstat.stat") = 0
gettimeofday({1085493152, 677972}, NULL) = 0
open("/etc/resolv.conf", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=43, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xf642e000
read(4, "search archonet.com\nnameserver 1"..., 4096) = 43
read(4, "", 4096) = 0
close(4) = 0
munmap(0xf642e000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=59776, ...}) = 0
old_mmap(NULL, 59776, PROT_READ, MAP_PRIVATE, 4, 0) = 0xf641f000
close(4) = 0
open("/lib/tls/i686/libnss_wins.so.2", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/lib/tls/i686", 0xfef90bc4) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libnss_wins.so.2", O_RDONLY) = -1 ENOENT (No such file or
directory)
stat64("/lib/tls", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/lib/i686/libnss_wins.so.2", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/lib/i686", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/lib/libnss_wins.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0(at)\276\1"...,
512) = 512
fstat64(4, {st_mode=S_IFREG|0755, st_size=733664, ...}) = 0
old_mmap(NULL, 806248, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0xe82000
old_mmap(0xf2d000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
4, 0xaa000) = 0xf2d000
old_mmap(0xf36000, 68968, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xf36000
close(4) = 0
open("/usr/lib/libldap.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360\226"...,
512) = 512
fstat64(4, {st_mode=S_IFREG|0755, st_size=203068, ...}) = 0
old_mmap(0x971000, 200116, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) =
0x111000
old_mmap(0x141000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4,
0x30000) = 0x141000
close(4) = 0
open("/usr/lib/liblber.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\344"...,
512) = 512
fstat64(4, {st_mode=S_IFREG|0755, st_size=48528, ...}) = 0
old_mmap(0x95c000, 46160, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x142000
old_mmap(0x14d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4,
0xb000) = 0x14d000
close(4) = 0
open("/usr/lib/libsasl2.so.2", O_RDONLY) = 4
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\217\224"...,
512) = 512
fstat64(4, {st_mode=S_IFREG|0755, st_size=82288, ...}) = 0
old_mmap(0x946000, 79676, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x14e000
old_mmap(0x161000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4,
0x13000) = 0x161000
close(4) = 0
munmap(0xf641f000, 59776) = 0
time(NULL) = 1085493152
gettimeofday({1085493152, 694560}, NULL) = 0
stat64("/etc/samba/smb.conf", {st_mode=S_IFREG|0644, st_size=10677,
...}) = 0
uname({sys="Linux", node="client17.archonet.com", ...}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---

In the output above, my workstation is "client17". My smb.conf hasn't
been altered from the default.

> I tried to get a stack trace; unfortunately the stack is corrupted but this
> much (truncated) looks for real:
> ...
> #8 0x40ecb020 in ?? () from /lib/libnss_wins.so.2
> ...
> #35 0x4028efce in __errno_location () from /lib/libc.so.6

For the record, my Fedora setup is slightly behind the release version
of core-2.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-05-25 14:38:53 Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
Previous Message Martin Pitt 2004-05-25 08:04:23 Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf