Bug 1832331

Summary: [abrt] [faf] 389-ds-base: unknown function(): /usr/sbin/ns-slapd killed by 11
Product: Red Hat Enterprise Linux 8 Reporter: Alexander Bokovoy <abokovoy>
Component: slapi-nisAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: abokovoy, ipa-qe, ksiddiqu, mreynolds, mvarun, myusuf, spichugi, ssidhaye, tbordaz, vashirov
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: 8.0   
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: 1832190 Environment:
Last Closed: 2020-11-04 02:50:41 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: 1832190    
Bug Blocks:    

Description Alexander Bokovoy 2020-05-06 14:39:50 UTC
+++ This bug was initially created as a clone of Bug #1832190 +++

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

--- Additional comment from thierry bordaz on 2020-05-06 13:17:52 EEST ---

This is related to recent fix https://bugzilla.redhat.com/show_bug.cgi?id=1820124.
Likely because NIS is enabled and SC not :(

--- Additional comment from thierry bordaz on 2020-05-06 13:41:10 EEST ---

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.

--- Additional comment from Alexander Bokovoy on 2020-05-06 14:11:16 EEST ---

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.

--- Additional comment from Sumedh Sidhaye on 2020-05-06 14:50:29 EEST ---

Alexander,

Could you provide steps for verification?

--- Additional comment from Alexander Bokovoy on 2020-05-06 14:56:35 EEST ---

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.

--- Additional comment from Alexander Bokovoy on 2020-05-06 16:48:48 EEST ---

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 1 Alexander Bokovoy 2020-05-06 14:49:21 UTC
Will be fixed in idm:DL1 module stream build that includes slapi-nis-0.56.5-2.el8

Comment 5 Mohammad Rizwan 2020-07-14 10:04:08 UTC
version:
[root@master ~]# rpm -qa | grep slapi
slapi-nis-0.56.5-2.module+el8.3.0+6580+328a3362.x86_64


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

Expected result:
NIS should not crash on ipactl restart

[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 ~]# 

[root@master ~]# systemctl status rpcbind
● rpcbind.service - RPC Bind
   Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-07-14 04:10:56 EDT; 30min ago
     Docs: man:rpcbind(8)
 Main PID: 691 (rpcbind)
    Tasks: 1 (limit: 23505)
   Memory: 2.7M
   CGroup: /system.slice/rpcbind.service
           └─691 /usr/bin/rpcbind -w -f

Jul 14 04:10:56 localhost.localdomain systemd[1]: Starting RPC Bind...
Jul 14 04:10:56 localhost.localdomain systemd[1]: Started RPC Bind.
[root@master ~]# 
[root@master ~]# ipactl restart
Restarting Directory Service
Restarting krb5kdc Service
Restarting kadmin Service
Restarting named Service
Restarting httpd Service
Restarting ipa-custodia Service
Restarting pki-tomcatd Service
Restarting ipa-otpd Service
Restarting ipa-dnskeysyncd Service
ipa: INFO: The ipactl command was successful
[root@master ~]# 

ipactl succeed. Hence marking the bug as verified.

Comment 8 errata-xmlrpc 2020-11-04 02:50:41 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 (Moderate: idm:DL1 and idm:client security, 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/RHSA-2020:4670