Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perl function getgrent not worked with libnss #16208

Closed
p5pRT opened this issue Oct 23, 2017 · 18 comments
Closed

perl function getgrent not worked with libnss #16208

p5pRT opened this issue Oct 23, 2017 · 18 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 23, 2017

Migrated from rt.perl.org#132351 (status was 'open')

Searchable as RT132351$

@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2017

From asper@tagan.ru

Created by asper@tagan.ru

perl function getgrent not worked in perl higer 5.20.x
if enabled sys-auth/libnss-pgsql library
if the groups are taken from the file, then everything is fine, and if the groups are taken from the database, then the getgent function hangs

I prepared a simple test script to check this
perl -e 'while ($a =getgrent) {print $a . "\n";}'
this script hangs if it is enabled to take groups and users from the database, this error is absent in the version 5.20 perl and below

my nsswitch config file
cat /etc/nsswitch.conf
# /etc/nsswitch.conf​:
# $Header​: /var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v 1.1 2006/09/29 23​:52​:23 vapier Exp $

group​: pgsql files
passwd​: pgsql files
shadow​: pgsql files

#passwd​: compat
#shadow​: compat
#group​: compat

# passwd​: db files nis
# shadow​: db files nis
# group​: db files nis

hosts​: files dns
networks​: files dns

services​: db files
protocols​: db files
rpc​: db files
ethers​: db files
netmasks​: files
netgroup​: files
bootparams​: files

automount​: files
aliases​: files

system utils
getent group - work fine

Perl Info

Flags:
    category=core
    severity=high

Site configuration information for perl 5.24.3:

Configured by Gentoo at Fri Oct 20 13:19:22 MSK 2017.

Summary of my perl5 (revision 5 version 24 subversion 3) configuration:
   
  Platform:
    osname=linux, osvers=4.0.9-gentoo, archname=x86_64-linux
    uname='linux gbase 4.0.9-gentoo #1 smp thu may 26 12:49:22 msk 2016 x86_64 qemu virtual cpu version 2.3.0 authenticamd gnulinux '
    config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux 5.24.1 5.24.0/x86_64-linux 5.24.0  -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-O2 -pipe -march=x86-64 -mtune=generic -Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.24.3 -Darchlib=/usr/lib64/perl5/5.24.3/x86_64-linux -Dsitelib=/usr/local/lib64/perl5/5.24.3 -Dsitearch=/usr/local/lib64/perl5/5.24.3/x86_64-linux -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.24.3 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.24.3 -Dlocincpth=/usr/include  -Dglibpth=/lib64 /usr/lib64  -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Ud_csh -Dsh=/bin/sh -Dtargetsh=/bin/sh -Uusenm -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dinc_version_list=5.24.2/x86_64-linux 5.24.2 5.24.1/x86_64-linux 5.24.1 5.24.0/x86_64-linux 5.24.0  -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -pipe -march=x86-64 -mtune=generic',
    cppflags='-fwrapv -fno-strict-aliasing -pipe'
    ccversion='', gccversion='4.9.3', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='x86_64-pc-linux-gnu-gcc', ldflags ='-Wl,-O1 -Wl,--as-needed'
    libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.23.so, so=so, useshrplib=true, libperl=libperl.so.5.24.3
    gnulibc_version='2.23'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -pipe -march=x86-64 -mtune=generic -Wl,-O1 -Wl,--as-needed'

Locally applied patches:
    gentoo/hints_hpux - Fix hpux hints
    gentoo/aix_soname - aix gcc detection and shared library soname support
    gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054 cpan/ExtUtils-MakeMaker: drop $PORTAGE_TMPDIR from LD_RUN_PATH
    gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags
    gentoo/opensolaris_headers - Add headers for opensolaris
    gentoo/patchlevel - List packaged patches for perl-5.24.3(#1) in patchlevel.h
    gentoo/cleanup-paths - Cleanup PATH and shrpenv
    gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing @INC directories.
    gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin: Use $CC to link
    gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN.
    gentoo/interix - Fix interix hints
    gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set libperl soname
    gentoo/mod_paths - Add /etc/perl to @INC
    gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker: remove targets that generate perllocal.pod
    gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557 Don't force -fstack-protector on everyone
    gentoo/usr_local - Configure: Don't include sources in /usr/local/ for compiling perl
    gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set custom CFLAGS in cpan/Digest-SHA
    gentoo/io_socket_ip_tests - cpan/IO-Socket-IP: Disable network tests
    gentoo/cygwin-libperl - Cygwin: avoid libperl.dll.dll.a
    gentoo/tests - Fixup EUMM perlocal.pod tests and customised SHA1s
    gentoo/zlib-1.2.9-backported-fixes - [rt#119762] Compress-Raw-Zlib: backport zlib 1.2.9+ fixes from upstream 2.073
    debian/cpan-missing-site-dirs - Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent is writable
    debian/makemaker-pasthru - Pass LD settings through to subdirectories
    fixes/memoize_storable_nstore - [rt.cpan.org #77790] Memoize::Storable: respect 'nstore' option not respected
    fixes/podman-pipe - Better errors for man pages from standard input
    fixes/respect_umask - Respect umask during installation
    fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net::SMTP 'Port' option
    fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags}
    fixes/parallel-manisort.patch - Fix parallel building


@INC for perl 5.24.3:
    /etc/perl
    /usr/local/lib64/perl5/5.24.3/x86_64-linux
    /usr/local/lib64/perl5/5.24.3
    /usr/lib64/perl5/vendor_perl/5.24.3/x86_64-linux
    /usr/lib64/perl5/vendor_perl/5.24.3
    /usr/local/lib64/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/lib64/perl5/5.24.3/x86_64-linux
    /usr/lib64/perl5/5.24.3


Environment for perl 5.24.3:
    HOME=/root
    LANG=ru_RU.UTF-8
    LANGUAGE (unset)
    LC_ALL=
    LC_COLLATE=C
    LC_MESSAGES=C
    LC_TIME=C
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash

-- 
Regards,
Michael A. Manerko

Megalink Company, Engineer
318, Chehova street, Taganrog, Russia, 347932
tel work: +7 8634 431431 (ext 159)
tel mobile: +7 999 6939428
sip: 159@tagan.ru
www.tagan.ru


@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2017

From @jkeenan

On Mon, 23 Oct 2017 10​:55​:44 GMT, asper@​tagan.ru wrote​:

This is a bug report for perl from asper@​tagan.ru,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
[Please describe your issue here]
perl function getgrent not worked in perl higer 5.20.x
if enabled sys-auth/libnss-pgsql library
if the groups are taken from the file, then everything is fine, and if
the groups are taken from the database, then the getgent function
hangs

I prepared a simple test script to check this
perl -e 'while ($a =getgrent) {print $a . "\n";}'
this script hangs if it is enabled to take groups and users from the
database, this error is absent in the version 5.20 perl and below

Do you get any output at all if it is enable to take groups and users from the database?

my nsswitch config file
cat /etc/nsswitch.conf
# /etc/nsswitch.conf​:
# $Header​:
/var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v 1.1
2006/09/29 23​:52​:23 vapier Exp $

group​: pgsql files
passwd​: pgsql files
shadow​: pgsql files

#passwd​: compat
#shadow​: compat
#group​: compat

# passwd​: db files nis
# shadow​: db files nis
# group​: db files nis

hosts​: files dns
networks​: files dns

services​: db files
protocols​: db files
rpc​: db files
ethers​: db files
netmasks​: files
netgroup​: files
bootparams​: files

automount​: files
aliases​: files

system utils
getent group - work fine

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 23, 2017

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 26, 2017

From asper@tagan.ru

23.10.2017 23​:26, James E Keenan via RT пиÑ�еÑ�​:

On Mon, 23 Oct 2017 10​:55​:44 GMT, asper@​tagan.ru wrote​:

This is a bug report for perl from asper@​tagan.ru,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
[Please describe your issue here]
perl function getgrent not worked in perl higer 5.20.x
if enabled sys-auth/libnss-pgsql library
if the groups are taken from the file, then everything is fine, and if
the groups are taken from the database, then the getgent function
hangs

I prepared a simple test script to check this
perl -e 'while ($a =getgrent) {print $a . "\n";}'
this script hangs if it is enabled to take groups and users from the
database, this error is absent in the version 5.20 perl and below

Do you get any output at all if it is enable to take groups and users from the database?
There is no output, the script hangs (infinite loop?)
The execution of the script can be interrupted by ^С.

We use the x2go server, when upgrading the pearl above 5.20 clients can not connect to the server.
Traced the function on which the client connection hangs - it turned out to be a gettent.
After that, I checked on other versions of perl 5.22, 5.24, 5.26 on all this function with the enabled livens hangs.

my nsswitch config file
cat /etc/nsswitch.conf
# /etc/nsswitch.conf​:
# $Header​:
/var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v 1.1
2006/09/29 23​:52​:23 vapier Exp $

group​: pgsql files
passwd​: pgsql files
shadow​: pgsql files

#passwd​: compat
#shadow​: compat
#group​: compat

# passwd​: db files nis
# shadow​: db files nis
# group​: db files nis

hosts​: files dns
networks​: files dns

services​: db files
protocols​: db files
rpc​: db files
ethers​: db files
netmasks​: files
netgroup​: files
bootparams​: files

automount​: files
aliases​: files

system utils
getent group - work fine

--
Regards,
Michael A. Manerko

Megalink Company, Engineer
318, Chehova street, Taganrog, Russia, 347932
tel work​: +7 8634 431431 (ext 159)
tel mobile​: +7 999 6939428
sip​: 159@​tagan.ru
www.tagan.ru

@p5pRT
Copy link
Author

p5pRT commented Oct 27, 2017

From @jkeenan

On Thu, 26 Oct 2017 03​:52​:19 GMT, asper@​tagan.ru wrote​:

23.10.2017 23​:26, James E Keenan via RT пиÑ�еÑ�​:

On Mon, 23 Oct 2017 10​:55​:44 GMT, asper@​tagan.ru wrote​:

This is a bug report for perl from asper@​tagan.ru,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
[Please describe your issue here]
perl function getgrent not worked in perl higer 5.20.x
if enabled sys-auth/libnss-pgsql library
if the groups are taken from the file, then everything is fine, and
if
the groups are taken from the database, then the getgent function
hangs

I prepared a simple test script to check this
perl -e 'while ($a =getgrent) {print $a . "\n";}'
this script hangs if it is enabled to take groups and users from the
database, this error is absent in the version 5.20 perl and below

Do you get any output at all if it is enable to take groups and users
from the database?
There is no output, the script hangs (infinite loop?)
The execution of the script can be interrupted by ^С.

We use the x2go server, when upgrading the pearl above 5.20 clients
can not connect to the server.
Traced the function on which the client connection hangs - it turned
out to be a gettent.
After that, I checked on other versions of perl 5.22, 5.24, 5.26 on
all this function with the enabled livens hangs.

my nsswitch config file
cat /etc/nsswitch.conf
# /etc/nsswitch.conf​:
# $Header​:
/var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v
1.1
2006/09/29 23​:52​:23 vapier Exp $

group​: pgsql files
passwd​: pgsql files
shadow​: pgsql files

#passwd​: compat
#shadow​: compat
#group​: compat

# passwd​: db files nis
# shadow​: db files nis
# group​: db files nis

hosts​: files dns
networks​: files dns

services​: db files
protocols​: db files
rpc​: db files
ethers​: db files
netmasks​: files
netgroup​: files
bootparams​: files

automount​: files
aliases​: files

system utils
getent group - work fine

This is going to be difficult for us to debug because there are several factors --- the x2go server, the libnss-pgsql library, the use of a database for NSS -- which are outside the scope of the Perl 5 core distribution and which will be difficult for our readers to emulate.

So I am grasping at straws here. Do you experience the same problem if you use the User​::grent module included in the core distribution? (see attachment)

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 27, 2017

From @jkeenan

usergrent.pl

@p5pRT
Copy link
Author

p5pRT commented Oct 28, 2017

From asper@tagan.ru

using the User​::grent module, the grant also causes a hang.

I ran the test script that you sent - it hangs.

To verify, you really need a library of libnss and a postgres database

x2go server is not needed

I also checked this script in ubuntu with the included libnsss library there, too, hangs

27.10.2017 16​:41, James E Keenan via RT пиÑ�еÑ�​:

On Thu, 26 Oct 2017 03​:52​:19 GMT, asper@​tagan.ru wrote​:

23.10.2017 23​:26, James E Keenan via RT пиÑ�еÑ�​:

On Mon, 23 Oct 2017 10​:55​:44 GMT, asper@​tagan.ru wrote​:

This is a bug report for perl from asper@​tagan.ru,
generated with the help of perlbug 1.40 running under perl 5.24.3.

-----------------------------------------------------------------
[Please describe your issue here]
perl function getgrent not worked in perl higer 5.20.x
if enabled sys-auth/libnss-pgsql library
if the groups are taken from the file, then everything is fine, and
if
the groups are taken from the database, then the getgent function
hangs

I prepared a simple test script to check this
perl -e 'while ($a =getgrent) {print $a . "\n";}'
this script hangs if it is enabled to take groups and users from the
database, this error is absent in the version 5.20 perl and below

Do you get any output at all if it is enable to take groups and users
from the database?
There is no output, the script hangs (infinite loop?)
The execution of the script can be interrupted by ^С.

We use the x2go server, when upgrading the pearl above 5.20 clients
can not connect to the server.
Traced the function on which the client connection hangs - it turned
out to be a gettent.
After that, I checked on other versions of perl 5.22, 5.24, 5.26 on
all this function with the enabled livens hangs.

my nsswitch config file
cat /etc/nsswitch.conf
# /etc/nsswitch.conf​:
# $Header​:
/var/cvsroot/gentoo/src/patchsets/glibc/extra/etc/nsswitch.conf,v
1.1
2006/09/29 23​:52​:23 vapier Exp $

group​: pgsql files
passwd​: pgsql files
shadow​: pgsql files

#passwd​: compat
#shadow​: compat
#group​: compat

# passwd​: db files nis
# shadow​: db files nis
# group​: db files nis

hosts​: files dns
networks​: files dns

services​: db files
protocols​: db files
rpc​: db files
ethers​: db files
netmasks​: files
netgroup​: files
bootparams​: files

automount​: files
aliases​: files

system utils
getent group - work fine

This is going to be difficult for us to debug because there are several factors --- the x2go server, the libnss-pgsql library, the use of a database for NSS -- which are outside the scope of the Perl 5 core distribution and which will be difficult for our readers to emulate.

So I am grasping at straws here. Do you experience the same problem if you use the User​::grent module included in the core distribution? (see attachment)

Thank you very much.

--
Regards,
Michael A. Manerko

Megalink Company, Engineer
318, Chehova street, Taganrog, Russia, 347932
tel work​: +7 8634 431431 (ext 159)
tel mobile​: +7 999 6939428
sip​: 159@​tagan.ru
www.tagan.ru

@p5pRT
Copy link
Author

p5pRT commented Oct 29, 2017

From @jkeenan

On Sat, 28 Oct 2017 22​:25​:19 GMT, asper@​tagan.ru wrote​:

using the User​::grent module, the grant also causes a hang.

I ran the test script that you sent - it hangs.

To verify, you really need a library of libnss and a postgres database

x2go server is not needed

I also checked this script in ubuntu with the included libnsss library
there, too, hangs

Could you clarify what you mean exactly by that? Which script is "this script"? When you refer to "the included libnss library", are you referring, say, to libnss3? Or to something else?

I ask this because if we can demonstrate a problem with libnss (of some sort) not connected to PostgreSQL, then we may have a better handle on the problem.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 31, 2017

From asper@tagan.ru

Under the script, I meant

perl -e 'while ($a =getgrent) {print $a . "\n";}'

AND

# perl
use strict;
use warnings;
use 5.10.1;
use User​::grent;

while (my $y = getgrent()) {
  say join('|' => (
  $y->name,
  $y->passwd,
  $y->gid,
  "@​{$y->members}",
  ) );
}

I do not know how to get hung without a postgres database

for testing, I tried to use another library nss-userfiles with it the function getgrent does not hang

I am attaching two trace files. One trace of the execution of the perl script. The second system utility.

29.10.2017 03​:40, James E Keenan via RT пиÑ�еÑ�​:

On Sat, 28 Oct 2017 22​:25​:19 GMT, asper@​tagan.ru wrote​:

using the User​::grent module, the grant also causes a hang.

I ran the test script that you sent - it hangs.

To verify, you really need a library of libnss and a postgres database

x2go server is not needed

I also checked this script in ubuntu with the included libnsss library
there, too, hangs

Could you clarify what you mean exactly by that? Which script is "this script"? When you refer to "the included libnss library", are you referring, say, to libnss3? Or to something else?

I ask this because if we can demonstrate a problem with libnss (of some sort) not connected to PostgreSQL, then we may have a better handle on the problem.

Thank you very much.

--
Regards,
Michael A. Manerko

Megalink Company, Engineer
318, Chehova street, Taganrog, Russia, 347932
tel work​: +7 8634 431431 (ext 159)
tel mobile​: +7 999 6939428
sip​: 159@​tagan.ru
www.tagan.ru

@p5pRT
Copy link
Author

p5pRT commented Oct 31, 2017

From asper@tagan.ru

gbase ~ # strace getent group
execve("/usr/bin/getent", ["getent", "group"], [/* 32 vars */]) = 0
brk(NULL) = 0x15c4000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f57e034c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33484, ...}) = 0
mmap(NULL, 33484, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f57e0343000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1689416, ...}) = 0
mmap(NULL, 3796544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f57dfd8b000
mprotect(0x7f57dff20000, 2097152, PROT_NONE) = 0
mmap(0x7f57e0120000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x195000) = 0x7f57e0120000
mmap(0x7f57e0126000, 15936, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f57e0126000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f57e0342000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f57e0341000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f57e0340000
arch_prctl(ARCH_SET_FS, 0x7f57e0341700) = 0
mprotect(0x7f57e0120000, 16384, PROT_READ) = 0
mprotect(0x604000, 4096, PROT_READ) = 0
mprotect(0x7f57e034d000, 4096, PROT_READ) = 0
munmap(0x7f57e0343000, 33484) = 0
brk(NULL) = 0x15c4000
brk(0x15e5000) = 0x15e5000
open("/usr/lib64/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2916416, ...}) = 0
mmap(NULL, 2916416, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f57dfac2000
close(3) = 0
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=646, ...}) = 0
read(3, "# /etc/nsswitch.conf​:\n# $Header​:"..., 4096) = 646
read(3, "", 4096) = 0
close(3) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33484, ...}) = 0
mmap(NULL, 33484, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f57e0343000
close(3) = 0
open("/usr/lib64/libnss_pgsql.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@​\36\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=26872, ...}) = 0
mmap(NULL, 2123752, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f57df8bb000
mprotect(0x7f57df8c1000, 2093056, PROT_NONE) = 0
mmap(0x7f57dfac0000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7f57dfac0000
close(3) = 0
open("/usr/lib64/libpq.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\213\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=180088, ...}) = 0
mmap(NULL, 2275488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f57df68f000
mprotect(0x7f57df6b8000, 2093056, PROT_NONE) = 0
mmap(0x7f57df8b7000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7f57df8b7000
close(3) = 0
open("/usr/lib64/postgresql-9.3/lib64/tls/x86_64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64/tls/x86_64", 0x7ffdbc9489a0) = -1 ENOENT (No such file or directory)
open("/usr/lib64/postgresql-9.3/lib64/tls/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64/tls", 0x7ffdbc9489a0) = -1 ENOENT (No such file or directory)
open("/usr/lib64/postgresql-9.3/lib64/x86_64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64/x86_64", 0x7ffdbc9489a0) = -1 ENOENT (No such file or directory)
open("/usr/lib64/postgresql-9.3/lib64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\217\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=432856, ...}) = 0
mmap(NULL, 2528496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f57df425000
mprotect(0x7f57df485000, 2097152, PROT_NONE) = 0
mmap(0x7f57df685000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x60000) = 0x7f57df685000
close(3) = 0
open("/usr/lib64/postgresql-9.3/lib64/libcrypto.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libcrypto.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\344\5\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=2007880, ...}) = 0
mmap(NULL, 4118296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f57df037000
mprotect(0x7f57df1fa000, 2097152, PROT_NONE) = 0
mmap(0x7f57df3fa000, 159744, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7f57df3fa000
mmap(0x7f57df421000, 14104, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f57df421000
close(3) = 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=14344, ...}) = 0
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f57dee33000
mprotect(0x7f57dee35000, 2097152, PROT_NONE) = 0
mmap(0x7f57df035000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f57df035000
close(3) = 0
open("/lib64/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260%\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=92416, ...}) = 0
mmap(NULL, 2187680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f57dec1c000
mprotect(0x7f57dec32000, 2093056, PROT_NONE) = 0
mmap(0x7f57dee31000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f57dee31000
close(3) = 0
mprotect(0x7f57dee31000, 4096, PROT_READ) = 0
mprotect(0x7f57df035000, 4096, PROT_READ) = 0
mprotect(0x7f57df3fa000, 114688, PROT_READ) = 0
mprotect(0x7f57df685000, 16384, PROT_READ) = 0
mprotect(0x7f57df8b7000, 8192, PROT_READ) = 0
mprotect(0x7f57dfac0000, 4096, PROT_READ) = 0
munmap(0x7f57e0343000, 33484) = 0
open("/etc/nss-pgsql.conf", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=482, ...}) = 0
read(3, "connectionstring = hostaddr=10.5"..., 4096) = 482
read(3, "", 4096) = 0
close(3) = 0
socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3
setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0
fcntl(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(5432), sin_addr=inet_addr("10.55.55.18")}, 16) = -1 EINPROGRESS (Operation now in progress)
poll([{fd=3, events=POLLOUT|POLLERR}], 1, 2000) = 1 ([{fd=3, revents=POLLOUT}])
getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(47217), sin_addr=inet_addr("10.55.55.94")}, [128->16]) = 0
poll([{fd=3, events=POLLOUT|POLLERR}], 1, 2000) = 1 ([{fd=3, revents=POLLOUT}])
sendto(3, "\0\0\0 \0\3\0\0user\0libnss\0database\0i\0\0", 32, MSG_NOSIGNAL, NULL, 0) = 32
poll([{fd=3, events=POLLIN|POLLERR}], 1, 2000) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "R\0\0\0\f\0\0\0\5\335\343\202j", 16384, 0, NULL, NULL) = 13
sendto(3, "p\0\0\0(md58c5ce3c0523bf78989929cc7"..., 41, MSG_NOSIGNAL, NULL, 0) = 41
poll([{fd=3, events=POLLIN|POLLERR}], 1, 2000) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "R\0\0\0\10\0\0\0\0S\0\0\0\26application_name\0\0"..., 16384, 0, NULL, NULL) = 318
sendto(3, "Q\0\0\0\26BEGIN TRANSACTION\0", 23, MSG_NOSIGNAL, NULL, 0) = 23
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "C\0\0\0\nBEGIN\0Z\0\0\0\5T", 16384, 0, NULL, NULL) = 17
sendto(3, "Q\0\0\0lDECLARE nss_pgsql_internal_"..., 109, MSG_NOSIGNAL, NULL, 0) = 109
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "C\0\0\0\23DECLARE CURSOR\0Z\0\0\0\5T", 16384, 0, NULL, NULL) = 26
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 131
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 82
fstat(1, {st_mode=S_IFCHR|0622, st_rdev=makedev(136, 0), ...}) = 0
write(1, "skihead​::5062​:skihead\n", 22skihead​::5062​:skihead
) = 22
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 128
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 156
write(1, "sudo​::1001​:asper,vetaly,feo,fath"..., 43sudo​::1001​:asper,vetaly,feo,father,sem,mik
) = 43
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 127
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 78
write(1, "feo​::1029​:feo\n", 14feo​::1029​:feo
) = 14
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 128
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 79
write(1, "tuxw​::5112​:tuxw\n", 16tuxw​::5112​:tuxw
) = 16
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 129
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 80
write(1, "kt315​::5110​:kt315\n", 18kt315​::5110​:kt315
) = 18
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 129
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 80
write(1, "asper​::5019​:asper\n", 18asper​::5019​:asper
) = 18
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 125
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 93, MSG_NOSIGNAL, NULL, 0) = 93
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 110
write(1, "root​::0​:dump,root,admin\n", 24root​::0​:dump,root,admin
) = 24
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 127
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 78
write(1, "alx​::5073​:alx\n", 14alx​::5073​:alx
) = 14
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 130
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 81
write(1, "father​::3013​:father\n", 20father​::3013​:father
) = 20
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 127
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 94, MSG_NOSIGNAL, NULL, 0) = 94
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 206
write(1, "wheel​::10​:father,kt315,sem,root,"..., 62wheel​::10​:father,kt315,sem,root,mik,feo,admin,master_gt,asper
) = 62
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 127
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 78
write(1, "aaa​::1333​:aaa\n", 14aaa​::1333​:aaa
) = 14
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 130
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 81
write(1, "garret​::3011​:garret\n", 20garret​::3011​:garret
) = 20
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 133
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 115
write(1, "nagioscmd​::3005​:nagios,father,ap"..., 37nagioscmd​::3005​:nagios,father,apache
) = 37
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 129
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 80
write(1, "drlex​::5028​:drlex\n", 18drlex​::5028​:drlex
) = 18
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 127
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 78
write(1, "sem​::1040​:sem\n", 14sem​::1040​:sem
) = 14
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 133
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 273
write(1, "mlsupport​::1018​:dashochek30,maru"..., 104mlsupport​::1018​:dashochek30,marusya,alx,vetaly,deduhm,drlex,shabby,firstdan,kt315,dubochek,anton,garret
) = 104
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 130
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 114
write(1, "nagios​::3004​:asper,nagios,father"..., 33nagios​::3004​:asper,nagios,father
) = 33
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 133
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 84
write(1, "master_gt​::5119​:master_gt\n", 26master_gt​::5119​:master_gt
) = 26
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 130
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 81
write(1, "vetaly​::1008​:vetaly\n", 20vetaly​::1008​:vetaly
) = 20
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 132
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 83
write(1, "firstdan​::1027​:firstdan\n", 24firstdan​::1027​:firstdan
) = 24
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 129
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 97
write(1, "anton​::1026​:anton,sysadm\n", 25anton​::1026​:anton,sysadm
) = 25
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 127
sendto(3, "P\0\0\0002\0SELECT * from nss_getgroup"..., 96, MSG_NOSIGNAL, NULL, 0) = 96
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "1\0\0\0\0042\0\0\0\4T\0\0\0!\0\1username\0\0\0\0\0\0\0"..., 16384, 0, NULL, NULL) = 78
write(1, "mik​::1003​:mik\n", 14mik​::1003​:mik
) = 14
sendto(3, "Q\0\0\0001FETCH FROM nss_pgsql_intern"..., 50, MSG_NOSIGNAL, NULL, 0) = 50
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "T\0\0\0Q\0\3groupname\0\0\0\0\0\0\0\0\0\0\31\377\377\377\377\377"..., 16384, 0, NULL, NULL) = 101
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=33484, ...}) = 0
mmap(NULL, 33484, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f57e0343000
close(4) = 0
open("/lib64/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 4
read(4, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\"\0\0\0\0\0\0"..., 832) = 832
fstat(4, {st_mode=S_IFREG|0755, st_size=43216, ...}) = 0
mmap(NULL, 2164536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0x7f57dea0b000
mprotect(0x7f57dea15000, 2093056, PROT_NONE) = 0
mmap(0x7f57dec14000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x9000) = 0x7f57dec14000
mmap(0x7f57dec16000, 22328, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f57dec16000
close(4) = 0
mprotect(0x7f57dec14000, 4096, PROT_READ) = 0
munmap(0x7f57e0343000, 33484) = 0
open("/etc/group", O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=631, ...}) = 0
read(4, "root​:x​:0​:root\nbin​:x​:1​:root,bin,d"..., 4096) = 631
write(1, "root​:x​:0​:root\n", 14root​:x​:0​:root
) = 14
write(1, "bin​:x​:1​:root,bin,daemon\n", 24bin​:x​:1​:root,bin,daemon
) = 24
write(1, "daemon​:x​:2​:root,bin,daemon\n", 27daemon​:x​:2​:root,bin,daemon
) = 27
write(1, "sys​:x​:3​:root,bin,adm\n", 21sys​:x​:3​:root,bin,adm
) = 21
write(1, "adm​:x​:4​:root,adm,daemon\n", 24adm​:x​:4​:root,adm,daemon
) = 24
write(1, "tty​:x​:5​:\n", 9tty​:x​:5​:
) = 9
write(1, "disk​:x​:6​:root,adm\n", 18disk​:x​:6​:root,adm
) = 18
write(1, "lp​:x​:7​:lp\n", 10lp​:x​:7​:lp
) = 10
write(1, "mem​:x​:8​:\n", 9mem​:x​:8​:
) = 9
write(1, "kmem​:x​:9​:\n", 10kmem​:x​:9​:
) = 10
write(1, "wheel​:x​:10​:root\n", 16wheel​:x​:10​:root
) = 16
write(1, "floppy​:x​:11​:root\n", 17floppy​:x​:11​:root
) = 17
write(1, "news​:x​:13​:news\n", 15news​:x​:13​:news
) = 15
write(1, "uucp​:x​:14​:uucp\n", 15uucp​:x​:14​:uucp
) = 15
write(1, "console​:x​:17​:\n", 14console​:x​:17​:
) = 14
write(1, "audio​:x​:18​:\n", 12audio​:x​:18​:
) = 12
write(1, "cdrom​:x​:19​:\n", 12cdrom​:x​:19​:
) = 12
write(1, "tape​:x​:26​:root\n", 15tape​:x​:26​:root
) = 15
write(1, "video​:x​:27​:root\n", 16video​:x​:27​:root
) = 16
write(1, "cdrw​:x​:80​:\n", 11cdrw​:x​:80​:
) = 11
write(1, "usb​:x​:85​:\n", 10usb​:x​:85​:
) = 10
write(1, "users​:x​:100​:\n", 13users​:x​:100​:
) = 13
write(1, "portage​:x​:250​:portage\n", 22portage​:x​:250​:portage
) = 22
write(1, "utmp​:x​:406​:\n", 12utmp​:x​:406​:
) = 12
write(1, "nogroup​:x​:65533​:\n", 17nogroup​:x​:65533​:
) = 17
write(1, "nobody​:x​:65534​:\n", 16nobody​:x​:65534​:
) = 16
write(1, "man​:x​:15​:\n", 10man​:x​:15​:
) = 10
write(1, "sshd​:x​:22​:\n", 11sshd​:x​:22​:
) = 11
write(1, "cron​:x​:16​:\n", 11cron​:x​:16​:
) = 11
write(1, "crontab​:x​:249​:\n", 15crontab​:x​:249​:
) = 15
write(1, "nullmail​:x​:88​:\n", 15nullmail​:x​:88​:
) = 15
write(1, "admin​:x​:1000​:\n", 14admin​:x​:1000​:
) = 14
write(1, "mail​:x​:12​:\n", 11mail​:x​:12​:
) = 11
write(1, "apache​:x​:81​:\n", 13apache​:x​:81​:
) = 13
write(1, "nagios​:x​:248​:icinga\n", 20nagios​:x​:248​:icinga
) = 20
write(1, "icinga​:x​:247​:\n", 14icinga​:x​:247​:
) = 14
write(1, "mysql​:x​:60​:\n", 12mysql​:x​:60​:
) = 12
write(1, "tcpdump​:x​:246​:\n", 15tcpdump​:x​:246​:
) = 15
write(1, "input​:x​:245​:\n", 13input​:x​:245​:
) = 13
write(1, "postgres​:x​:70​:\n", 15postgres​:x​:70​:
) = 15
write(1, "postmaster​:x​:244​:\n", 18postmaster​:x​:244​:
) = 18
write(1, "smtpd​:x​:25​:\n", 12smtpd​:x​:25​:
) = 12
write(1, "smtpq​:x​:252​:\n", 13smtpq​:x​:252​:
) = 13
read(4, "", 4096) = 0
sendto(3, "Q\0\0\0\vCOMMIT\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
poll([{fd=3, events=POLLIN|POLLERR}], 1, -1) = 1 ([{fd=3, revents=POLLIN}])
recvfrom(3, "C\0\0\0\vCOMMIT\0Z\0\0\0\5I", 16384, 0, NULL, NULL) = 18
sendto(3, "X\0\0\0\4", 5, MSG_NOSIGNAL, NULL, 0) = 5
close(3) = 0
close(4) = 0
exit_group(0) = ?
+++ exited with 0 +++

@p5pRT
Copy link
Author

p5pRT commented Oct 31, 2017

From asper@tagan.ru

gbase ~ # strace perl -e 'while ($a =getgrent) {print $a . "\n";}'
execve("/usr/bin/perl", ["perl", "-e", "while ($a =getgrent) {print $a ."...], [/* 32 vars */]) = 0
brk(NULL) = 0x1ad8000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c0aef000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33484, ...}) = 0
mmap(NULL, 33484, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa3c0ae6000
close(3) = 0
open("/usr/lib64/libperl.so.5.24", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260m\3\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1963056, ...}) = 0
mmap(NULL, 4062392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3c04ed000
mprotect(0x7fa3c06c2000, 2097152, PROT_NONE) = 0
mmap(0x7fa3c08c2000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d5000) = 0x7fa3c08c2000
mmap(0x7fa3c08cc000, 3256, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa3c08cc000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1689416, ...}) = 0
mmap(NULL, 3796544, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3c014e000
mprotect(0x7fa3c02e3000, 2097152, PROT_NONE) = 0
mmap(0x7fa3c04e3000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x195000) = 0x7fa3c04e3000
mmap(0x7fa3c04e9000, 15936, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa3c04e9000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c0ae5000
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000a\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=133712, ...}) = 0
mmap(NULL, 2208872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bff32000
mprotect(0x7fa3bff49000, 2093056, PROT_NONE) = 0
mmap(0x7fa3c0148000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7fa3c0148000
mmap(0x7fa3c014a000, 13416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa3c014a000
close(3) = 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=14344, ...}) = 0
mmap(NULL, 2109712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bfd2e000
mprotect(0x7fa3bfd30000, 2097152, PROT_NONE) = 0
mmap(0x7fa3bff30000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fa3bff30000
close(3) = 0
open("/lib64/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300U\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1067088, ...}) = 0
mmap(NULL, 3162416, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bfa29000
mprotect(0x7fa3bfb2d000, 2093056, PROT_NONE) = 0
mmap(0x7fa3bfd2c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x103000) = 0x7fa3bfd2c000
close(3) = 0
open("/lib64/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\v\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=34840, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c0ae4000
mmap(NULL, 2318880, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bf7f2000
mprotect(0x7fa3bf7fa000, 2093056, PROT_NONE) = 0
mmap(0x7fa3bf9f9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0x7fa3bf9f9000
mmap(0x7fa3bf9fb000, 184864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa3bf9fb000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c0ae3000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c0ae2000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa3c0ae1000
arch_prctl(ARCH_SET_FS, 0x7fa3c0ae2700) = 0
mprotect(0x7fa3c04e3000, 16384, PROT_READ) = 0
mprotect(0x7fa3bf9f9000, 4096, PROT_READ) = 0
mprotect(0x7fa3bfd2c000, 4096, PROT_READ) = 0
mprotect(0x7fa3bff30000, 4096, PROT_READ) = 0
mprotect(0x7fa3c0148000, 4096, PROT_READ) = 0
mprotect(0x7fa3c08c2000, 24576, PROT_READ) = 0
mprotect(0x601000, 4096, PROT_READ) = 0
mprotect(0x7fa3c0af0000, 4096, PROT_READ) = 0
munmap(0x7fa3c0ae6000, 33484) = 0
set_tid_address(0x7fa3c0ae29d0) = 5856
set_robust_list(0x7fa3c0ae29e0, 24) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7fa3bff37bc0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fa3bff42f90}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7fa3bff37c50, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fa3bff42f90}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
rt_sigaction(SIGFPE, {sa_handler=SIG_IGN, sa_mask=[FPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fa3c01812a0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
brk(NULL) = 0x1ad8000
brk(0x1af9000) = 0x1af9000
getuid() = 0
geteuid() = 0
getgid() = 0
getegid() = 0
open("/usr/lib64/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2916416, ...}) = 0
mmap(NULL, 2916416, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa3bf529000
close(3) = 0
open("/dev/urandom", O_RDONLY) = 3
read(3, "\372\245\206\6", 4) = 4
close(3) = 0
readlink("/proc/self/exe", "/usr/bin/perl", 4095) = 13
stat("/usr/local/lib64/perl5/5.24.2/x86_64-linux", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/5.24.2", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/5.24.1/x86_64-linux", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/5.24.1", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/5.24.0/x86_64-linux", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib64/perl5/5.24.0", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/5.24.2/x86_64-linux", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/5.24.2", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/5.24.1/x86_64-linux", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/5.24.1", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/5.24.0/x86_64-linux", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/perl5/vendor_perl/5.24.0", 0x7ffdb8b02970) = -1 ENOENT (No such file or directory)
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(0, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(1, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
lseek(2, 0, SEEK_CUR) = -1 ESPIPE (Illegal seek)
open("/dev/null", O_RDONLY) = 3
ioctl(3, TCGETS, 0x7ffdb8b028d0) = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
fstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
getuid() = 0
geteuid() = 0
getgid() = 0
getegid() = 0
rt_sigaction(SIGCHLD, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
close(3) = 0
brk(0x1b1a000) = 0x1b1a000
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=646, ...}) = 0
read(3, "# /etc/nsswitch.conf​:\n# $Header​:"..., 4096) = 646
read(3, "", 4096) = 0
close(3) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=33484, ...}) = 0
mmap(NULL, 33484, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fa3c0ae6000
close(3) = 0
open("/usr/lib64/libnss_pgsql.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@​\36\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=26872, ...}) = 0
mmap(NULL, 2123752, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bf322000
mprotect(0x7fa3bf328000, 2093056, PROT_NONE) = 0
mmap(0x7fa3bf527000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x7fa3bf527000
close(3) = 0
open("/usr/lib64/libpq.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\213\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=180088, ...}) = 0
mmap(NULL, 2275488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bf0f6000
mprotect(0x7fa3bf11f000, 2093056, PROT_NONE) = 0
mmap(0x7fa3bf31e000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x7fa3bf31e000
close(3) = 0
open("/usr/lib64/postgresql-9.3/lib64/tls/x86_64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64/tls/x86_64", 0x7ffdb8b01c40) = -1 ENOENT (No such file or directory)
open("/usr/lib64/postgresql-9.3/lib64/tls/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64/tls", 0x7ffdb8b01c40) = -1 ENOENT (No such file or directory)
open("/usr/lib64/postgresql-9.3/lib64/x86_64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64/x86_64", 0x7ffdb8b01c40) = -1 ENOENT (No such file or directory)
open("/usr/lib64/postgresql-9.3/lib64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib64/postgresql-9.3/lib64", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib64/libssl.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\300\217\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=432856, ...}) = 0
mmap(NULL, 2528496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bee8c000
mprotect(0x7fa3beeec000, 2097152, PROT_NONE) = 0
mmap(0x7fa3bf0ec000, 40960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x60000) = 0x7fa3bf0ec000
close(3) = 0
open("/usr/lib64/postgresql-9.3/lib64/libcrypto.so.1.0.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib64/libcrypto.so.1.0.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\344\5\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0555, st_size=2007880, ...}) = 0
mmap(NULL, 4118296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3bea9e000
mprotect(0x7fa3bec61000, 2097152, PROT_NONE) = 0
mmap(0x7fa3bee61000, 159744, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7fa3bee61000
mmap(0x7fa3bee88000, 14104, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fa3bee88000
close(3) = 0
open("/lib64/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260%\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=92416, ...}) = 0
mmap(NULL, 2187680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fa3be887000
mprotect(0x7fa3be89d000, 2093056, PROT_NONE) = 0
mmap(0x7fa3bea9c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7fa3bea9c000
close(3) = 0
mprotect(0x7fa3bea9c000, 4096, PROT_READ) = 0
mprotect(0x7fa3bee61000, 114688, PROT_READ) = 0
mprotect(0x7fa3bf0ec000, 16384, PROT_READ) = 0
mprotect(0x7fa3bf31e000, 8192, PROT_READ) = 0
mprotect(0x7fa3bf527000, 4096, PROT_READ) = 0
munmap(0x7fa3c0ae6000, 33484) = 0
futex(0x7fa3bf528260, FUTEX_WAIT_PRIVATE, 2, NULL^Cstrace​: Process 5856 detached
<detached ...>
gbase ~ #

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2017

From asper@tagan.ru

I want to inform you that I found a solution to the problem.

I rebuilt in the debugging mode, glibc, linss-pgsgl, perl 5.24 and through the tracer found a function in which hangs.

This is a function in the libnss_pgsqll library.

after changing the lock type in a libnss_pgsql with MUTEX to RECURSIVE_MUTEX, the getgrent function stops hanging.

however I still do not understand what changed in the perl after version 5.20 and caused the getgrent to hang

30.10.2017 15​:09, Ð�иÑ�аил Ð�анеÑ�ко пиÑ�еÑ�​:

Under the script, I meant

perl -e 'while ($a =getgrent) {print $a . "\n";}'

AND

# perl
use strict;
use warnings;
use 5.10.1;
use User​::grent;

while (my $y = getgrent()) {
say join('|' => (
$y->name,
$y->passwd,
$y->gid,
"@​{$y->members}",
) );
}

I do not know how to get hung without a postgres database

for testing, I tried to use another library nss-userfiles with it the function getgrent does not hang

I am attaching two trace files. One trace of the execution of the perl script. The second system utility.

29.10.2017 03​:40, James E Keenan via RT пиÑ�еÑ�​:

On Sat, 28 Oct 2017 22​:25​:19 GMT, asper@​tagan.ru wrote​:

using the User​::grent module, the grant also causes a hang.

I ran the test script that you sent - it hangs.

To verify, you really need a library of libnss and a postgres database

x2go server is not needed

I also checked this script in ubuntu with the included libnsss library
there, too, hangs

Could you clarify what you mean exactly by that? Which script is "this script"? When you refer to "the included libnss library", are you referring, say, to libnss3? Or to something else?

I ask this because if we can demonstrate a problem with libnss (of some sort) not connected to PostgreSQL, then we may have a better handle on the problem.

Thank you very much.

--
Regards,
Michael A. Manerko

Megalink Company, Engineer
318, Chehova street, Taganrog, Russia, 347932
tel work​: +7 8634 431431 (ext 159)
tel mobile​: +7 999 6939428
sip​: 159@​tagan.ru
www.tagan.ru

@p5pRT
Copy link
Author

p5pRT commented Nov 1, 2017

From @jkeenan

On 11/01/2017 09​:49 AM, Ð�иÑ�аил Ð�анеÑ�ко wrote​:

I want to inform you that I found a solution to the problem.

I rebuilt in the debugging mode, glibc, linss-pgsgl, perl 5.24 and through the tracer found a function in which hangs.

Would you be able to post that trace and your work-around? Even if we
can't track down the perl problem it would be good for future reference
in case someone with expertise in linss-pgsql stumbles upon this problem.

This is a function in the libnss_pgsqll library.

after changing the lock type in a libnss_pgsql with MUTEX to RECURSIVE_MUTEX, the getgrent function stops hanging.

however I still do not understand what changed in the perl after version 5.20 and caused the getgrent to hang

Nor do I. I couldn't see any modifications to the source code for
getgrent after 5.20 (though I may not have known every place to look).

30.10.2017 15​:09, Ð�иÑ�аил Ð�анеÑ�ко пиÑ�еÑ�​:

Under the script, I meant

perl -e 'while ($a =getgrent) {print $a . "\n";}'

AND

# perl
use strict;
use warnings;
use 5.10.1;
use User​::grent;

while (my $y = getgrent()) {
say join('|' => (
$y->name,
$y->passwd,
$y->gid,
"@​{$y->members}",
) );
}

I do not know how to get hung without a postgres database

for testing, I tried to use another library nss-userfiles with it the function getgrent does not hang

I am attaching two trace files. One trace of the execution of the perl script. The second system utility.

29.10.2017 03​:40, James E Keenan via RT пиÑ�еÑ�​:

On Sat, 28 Oct 2017 22​:25​:19 GMT, asper@​tagan.ru wrote​:

using the User​::grent module, the grant also causes a hang.

I ran the test script that you sent - it hangs.

To verify, you really need a library of libnss and a postgres database

x2go server is not needed

I also checked this script in ubuntu with the included libnsss library
there, too, hangs

Could you clarify what you mean exactly by that? Which script is "this script"? When you refer to "the included libnss library", are you referring, say, to libnss3? Or to something else?

I ask this because if we can demonstrate a problem with libnss (of some sort) not connected to PostgreSQL, then we may have a better handle on the problem.

Thank you very much.

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2017

From @tonycoz

On Wed, Nov 01, 2017 at 04​:49​:05PM +0300, Ð�иÑ�аил Ð�анеÑ�ко wrote​:

I want to inform you that I found a solution to the problem.

I rebuilt in the debugging mode, glibc, linss-pgsgl, perl 5.24 and through the tracer found a function in which hangs.

This is a function in the libnss_pgsqll library.

after changing the lock type in a libnss_pgsql with MUTEX to RECURSIVE_MUTEX, the getgrent function stops hanging.

however I still do not understand what changed in the perl after version 5.20 and caused the getgrent to hang

Is there any chance you switched from an unthreaded build of perl to a
threaded build?

You might want to try building with -Ud_getgrent_r

Looking at the ChangeLog for libnss-pgsql2, I see​:

  * Fixed bug where if you used getpwent, then getspnam, then getpwent
  you would end up hanging the application (common perl operation)

I wonder if there's a similar problem with groups.

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2017

From asper@tagan.ru

02.11.2017 08​:55, Tony Cook via RT пиÑ�еÑ�​:

Is there any chance you switched from an unthreaded build of perl to a
threaded build?

I downloaded the perl from the git repository.
switched to branch 5.24
compiled with default settings

asper@​a ~/INSTALL/perl $ git remote -v
origin https://perl5.git.perl.org/perl.git (fetch)
origin https://perl5.git.perl.org/perl.git (push)
asper@​a ~/INSTALL/perl $ git status
�а ве�ке maint-5.24
�а�а ве�ка обновлена в �оо�ве���вии � «origin/maint-5.24».
не�его комми�и��, не� изменений в �або�ем ка�алоге

You might want to try building with -Ud_getgrent_r

I rebuild perl with
./Configure -de -Dprefix=/opt/perl5 -Ud_getgrent_r
nothing will change functions hang

Looking at the ChangeLog for libnss-pgsql2, I see​:

    \* Fixed bug where if you used getpwent\, then getspnam\, then getpwent
    you would end up hanging the application \(common perl operation\)

I saw the commit described in Cgangelog libnss_pgsql2, these fixes relate to lib_nss of the function getent_close and
backend_close.

partial sequence is called when getgrent
in libnss_pgsql2

...
_nss_pgsql_getgrent_r __libc_lock_lock(lock); _nss_pgsql_setgrent(); __libc_lock_lock(lock); <-- hangs here if getgrent
is called from perl version greater than 5.20, but does not hang if getgrent is called from c program like this #include
<sys/types.h> #include <grp.h> #include <stdio.h> void main(void) { printf ("name​: %s\n",getgrent()->gr_name); }

I wonder if there's a similar problem with groups.

Tony

A more detailed study showed that a pearl above 5.20 hides using two functions, getgrent and getpwent.

Here is the patch I applied to the libnss_pgsql2 library, this patch fixes both functions , getgrent and getpwent.

Inline Patch
diff --git a/src/interface.c b/src/interface.c
index 7c6475c..ced21c6 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -10,12 +10,13 @@
  *
  */
 
+#define _GNU_SOURCE
 #include "nss-pgsql.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <pthread.h>
 
-static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 
 /*
  * passwd functions
@@ -250,7 +251,7 @@ _nss_pgsql_getspent_r(struct spwd *result, char *buffer,
 {
        enum nss_status retval = NSS_STATUS_UNAVAIL;
        int lerrno = 0;
-      
+
        pthread_mutex_lock(&lock);
 
        // Make sure the database is opened in case no one has called setspent()


-- 

Regards,
Michael A. Manerko

Megalink Company, Engineer
318, Chehova street, Taganrog, Russia, 347932
tel work​: +7 8634 431431 (ext 159)
tel mobile​: +7 999 6939428
sip​: 159@​tagan.ru
www.tagan.ru

@p5pRT
Copy link
Author

p5pRT commented Nov 2, 2017

From @tonycoz

On Thu, Nov 02, 2017 at 01​:50​:57PM +0300, Ð�иÑ�аил Ð�анеÑ�ко wrote​:

02.11.2017 08​:55, Tony Cook via RT пиÑ�еÑ�​:

Is there any chance you switched from an unthreaded build of perl to a
threaded build?

I downloaded the perl from the git repository.
switched to branch 5.24
compiled with default settings

asper@​a ~/INSTALL/perl $ git remote -v
origin https://perl5.git.perl.org/perl.git (fetch)
origin https://perl5.git.perl.org/perl.git (push)
asper@​a ~/INSTALL/perl $ git status
�а ве�ке maint-5.24
�а�а ве�ка обновлена в �оо�ве���вии � «origin/maint-5.24».
не�его комми�и��, не� изменений в �або�ем ка�алоге

You might want to try building with -Ud_getgrent_r

I rebuild perl with
./Configure -de -Dprefix=/opt/perl5 -Ud_getgrent_r
nothing will change functions hang

Ok, thanks.

Looking at the ChangeLog for libnss-pgsql2, I see​:

    \* Fixed bug where if you used getpwent\, then getspnam\, then getpwent
    you would end up hanging the application \(common perl operation\)

I saw the commit described in Cgangelog libnss_pgsql2, these fixes relate to lib_nss of the function getent_close and
backend_close.

partial sequence is called when getgrent
in libnss_pgsql2

...
_nss_pgsql_getgrent_r __libc_lock_lock(lock); _nss_pgsql_setgrent(); __libc_lock_lock(lock); <-- hangs here if getgrent
is called from perl version greater than 5.20, but does not hang if getgrent is called from c program like this #include
<sys/types.h> #include <grp.h> #include <stdio.h> void main(void) { printf ("name​: %s\n",getgrent()->gr_name); }

I wonder if there's a similar problem with groups.

Tony

A more detailed study showed that a pearl above 5.20 hides using two functions, getgrent and getpwent.

Here is the patch I applied to the libnss_pgsql2 library, this patch fixes both functions , getgrent and getpwent.

Yes, but I can only see that lock being held if there's a bug in libnss_pgsql.

I had a look, getgrent() (from 1.4.0) is​:

enum nss_status
_nss_pgsql_getgrent_r(struct group *result, char *buffer,
  size_t buflen, int *errnop)
{
  enum nss_status retval = NSS_STATUS_UNAVAIL;

  __libc_lock_lock(lock);

  // Make sure the database is opened in case no one has called setpwent()
  if(!backend_isopen(CONNECTION_USERGROUP)) {
  retval = _nss_pgsql_setgrent();
  }

  if(backend_isopen(CONNECTION_USERGROUP)) {
  retval = backend_getgrent(result, buffer, buflen, errnop);
  }
  __libc_lock_unlock(lock);

  return retval;
}

Note the call to _nss_pgsql_setgrent() with the lock held.

enum nss_status
_nss_pgsql_setgrent(void)
{
  enum nss_status retval = NSS_STATUS_UNAVAIL;

  __libc_lock_lock(lock);
  if(backend_open(CONNECTION_USERGROUP)) {
  getent_prepare("allgroups");
  retval = NSS_STATUS_SUCCESS;
  }
  __libc_lock_unlock(lock);

  return NSS_STATUS_SUCCESS;
}

attempts to lock too, and in the call from _nss_pgsql_getgrent_r() it
will attempt to lock again.

So this appears to be a libnss_pgsql bug, which your change to
recursive locks works around.

Tony

@jkeenan
Copy link
Contributor

jkeenan commented Dec 8, 2021

Reviewing this older ticket, it appears that @tonycoz diagnosed the problem as being in an outside library. Since we haven't heard anything more in 4 years, I will take this ticket for the purpose of closing it within 7 days unless someone has a serious objection.

Thank you very much.
Jim Keenan

@jkeenan jkeenan self-assigned this Dec 8, 2021
@jkeenan
Copy link
Contributor

jkeenan commented Dec 20, 2021

Reviewing this older ticket, it appears that @tonycoz diagnosed the problem as being in an outside library. Since we haven't heard anything more in 4 years, I will take this ticket for the purpose of closing it within 7 days unless someone has a serious objection.

Thank you very much. Jim Keenan

No objections heard; closing ticket as per previous post.

@jkeenan jkeenan closed this as completed Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants