Bug 1832190

Summary: [abrt] [faf] 389-ds-base: unknown function(): /usr/sbin/ns-slapd killed by 11
Product: Red Hat Enterprise Linux 7 Reporter: Lukas Slebodnik <lslebodn>
Component: slapi-nisAssignee: thierry bordaz <tbordaz>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.9CC: abokovoy, mreynolds, myusuf, pvlasin, spichugi, ssidhaye, tbordaz, vashirov
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://faf.lab.eng.brq.redhat.com/faf/reports/bthash/5d179c0c142c68b9153ac69a93d99d3a3bb3df20/
Whiteboard:
Fixed In Version: slapi-nis-0.56.5-2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1832331 (view as bug list) Environment:
Last Closed: 2020-09-29 20:33:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1832331    
Attachments:
Description Flags
proposed fix none

Description Lukas Slebodnik 2020-05-06 10:08:09 UTC
This bug has been created based on an anonymous crash report requested by the package maintainer.

sh-4.2# rpm -q slapi-nis ipa-server 389-ds-base
slapi-nis-0.56.5-1.el7.x86_64
ipa-server-4.6.8-2.el7.x86_64
389-ds-base-1.3.10.2-2.el7.x86_64


    (gdb) bt
    #0  0x00007ff5c041d0c9 in backend_shr_write_ignore (pb=pb@entry=0x564e94aee240) at back-shr.c:2969
    #1  0x00007ff5c041d180 in backend_shr_add_cb (pb=0x564e94aee240) at back-shr.c:1897
    #2  0x00007ff5c041d3b9 in backend_shr_betxn_post_add_cb (pb=0x564e94aee240) at back-shr.c:1983
    #3  0x00007ff5cf329358 in plugin_call_func (list=0x564e9446eb00, operation=operation@entry=560, pb=pb@entry=0x564e94aee240, call_one=call_one@entry=0)
        at ldap/servers/slapd/plugin.c:2028
    #4  0x00007ff5cf329613 in plugin_call_list (pb=0x564e94aee240, operation=560, list=<optimized out>) at ldap/servers/slapd/plugin.c:1972
    #5  0x00007ff5cf329613 in plugin_call_plugins (pb=pb@entry=0x564e94aee240, whichfunction=whichfunction@entry=560) at ldap/servers/slapd/plugin.c:442
    #6  0x00007ff5cf2e30e2 in dse_add (pb=0x564e94aee240) at ldap/servers/slapd/dse.c:2322
    #7  0x00007ff5cf2cc941 in op_shared_add (pb=pb@entry=0x564e94aee240) at ldap/servers/slapd/add.c:679
    #8  0x00007ff5cf2cceb9 in add_internal_pb (pb=pb@entry=0x564e94aee240) at ldap/servers/slapd/add.c:407
    #9  0x00007ff5cf2cdbf1 in slapi_add_internal_pb (pb=pb@entry=0x564e94aee240) at ldap/servers/slapd/add.c:332
    #10 0x00007ff5cf359dee in slapi_plugin_task_register_handler (name=name@entry=0x7ff5be73a9f8 "schema reload task", func=func@entry=0x7ff5be73a460 <schemareload_add>, plugin_pb=plugin_pb@entry=0x564e94ae1f20) at ldap/servers/slapd/task.c:528
    #11 0x00007ff5be73a93b in schemareload_start (pb=0x564e94ae1f20) at ldap/servers/plugins/schema_reload/schema_reload.c:94
    #12 0x00007ff5cf3293c7 in plugin_call_func (list=0x564e94494580, operation=operation@entry=212, pb=0x564e94ae1f20, call_one=call_one@entry=1) at ldap/servers/slapd/plugin.c:2028
    #13 0x00007ff5cf329a3b in plugin_call_one (pb=<optimized out>, operation=212, list=<optimized out>) at ldap/servers/slapd/plugin.c:1978
    #14 0x00007ff5cf329a3b in plugin_dependency_startall (operation=212, errmsg=<synthetic pointer>, plugin_list=0x0, argv=0x7fff583620c8, argc=5) at ldap/servers/slapd/plugin.c:1737
    #15 0x00007ff5cf329a3b in plugin_startall (argc=argc@entry=5, argv=argv@entry=0x7fff583620c8, plugin_list=plugin_list@entry=0x0) at ldap/servers/slapd/plugin.c:1950
    #16 0x0000564e9181ea68 in main (argc=<optimized out>, argv=0x7fff583620c8) at ldap/servers/slapd/main.c:1141
    (gdb) l
    2964         * on of the ignored containers
    2965         */
    2966        slapi_pblock_get(pb, SLAPI_ORIGINAL_TARGET, &dn);
    2967        target_sdn = slapi_sdn_new_dn_byval(dn);
    2968
    2969        for (i = 0; ignored_containers_sdn[i]; i++) {
    2970            check  = slapi_sdn_issuffix(target_sdn, ignored_containers_sdn[i]);
    2971            if (check != 0) {
    2972                /* This entry is an ignored container */
    2973                ignore = PR_TRUE;
    (gdb) p ignored_containers_sdn
    $2 = (Slapi_DN **) 0x0


Submit a correction or amendment below (click here to m

Comment 5 thierry bordaz 2020-05-06 10:17:52 UTC
This is related to recent fix https://bugzilla.redhat.com/show_bug.cgi?id=1820124.
Likely because NIS is enabled and SC not :(

Comment 6 thierry bordaz 2020-05-06 10:41:10 UTC
Actually both NIS and SC are enabled. 
I think the problem is that SC is initialized later compare to NIS or Schema reload plugin.
At this point ignored_containers_sdn was not initialized yet and trigger the crash.

Comment 7 Alexander Bokovoy 2020-05-06 11:11:16 UTC
Created attachment 1685665 [details]
proposed fix

Even though NIS and SC plugins share source code, they get linked and then loaded separately, so static variables defined in src/back-shr.c aren't shared. It means NIS plugin has to initialize map locks as well. And if ignored_containers_sdn is NULL, there is no need to go over it since none of the entries could be ignored, just return NULL.

Comment 9 Alexander Bokovoy 2020-05-06 11:56:35 UTC
I tested this patch and it solves the issue to me.

Reproducer:

1. install FreeIPA
2. enable NIS plugin: ipa-nis-manage enable
3. systemctl start rpcbind
4. ipactl restart

You'll get a failure at this point because NIS plugin would crash.

Build and install a fixed package, do

ipactl restart

and everything continues to work just fine.

Comment 10 Alexander Bokovoy 2020-05-06 13:48:48 UTC
Added upstream: https://pagure.io/slapi-nis/c/f3d34b046ef4f28d31b6d6e3511a8956bc60ec7c?branch=master

Added to Fedora 31-33 as slapi-nis-0.56.5-2

Added to RHEL 7.9 as slapi-nis-0.56.5-2

Comment 14 Mohammad Rizwan 2020-06-01 10:55:20 UTC
reproducer:

[root@master ~]# rpm -qa | grep slapi
slapi-nis-0.56.5-1.el7.x86_64

[root@master ~]# rpm -qa | grep ipa-server
ipa-server-dns-4.6.8-1.el7.noarch
ipa-server-trust-ad-4.6.8-1.el7.x86_64
ipa-server-common-4.6.8-1.el7.noarch
ipa-server-4.6.8-1.el7.x86_64

[root@master ~]# ipa-nis-manage enable
Directory Manager password: 

Enabling plugin
This setting will not take effect until you restart Directory Server.
The rpcbind service may need to be started.

[root@master ~]# systemctl start rpcbind

[root@master ~]# ipactl restart
Restarting Directory Service
Failed to restart Directory Service: Command '/bin/systemctl restart dirsrv' returned non-zero exit status 1
Shutting down
Aborting ipactl



Fix:
~~~~
[root@master ~]# yum install -y http://download.eng.bos.redhat.com/brewroot/vol/rhel-7/packages/slapi-nis/0.56.5/2.el7/x86_64/slapi-nis-0.56.5-2.el7.x86_64.rpm
Loaded plugins: search-disabled-repos
slapi-nis-0.56.5-2.el7.x86_64.rpm     
[..]

[root@master ~]# rpm -qa | grep slapi
slapi-nis-0.56.5-2.el7.x86_64

[root@master ~]# ipactl restart
IPA version error: data needs to be upgraded (expected version '4.6.8-3.el7', current version '4.6.8-1.el7')
Automatically running upgrade, for details see /var/log/ipaupgrade.log
Be patient, this may take a few minutes.
Starting Directory Service
Starting krb5kdc Service
Starting kadmin Service
Starting named Service
Starting httpd Service
Starting ipa-custodia Service
Starting pki-tomcatd Service
Starting ipa-otpd Service
Starting ipa-dnskeysyncd Service
ipa: INFO: The ipactl command was successful

Comment 16 errata-xmlrpc 2020-09-29 20:33:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (slapi-nis bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4010