Bug 2001500

Summary: reinstalling samba client causes winbindd coredump
Product: Red Hat Enterprise Linux 8 Reporter: Sergey Orlov <sorlov>
Component: ipaAssignee: Florence Blanc-Renaud <frenaud>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: abokovoy, aboscatt, dkarpele, fdvorak, frenaud, gdeschner, jarrpa, mpolovka, ndehadra, rcritten, rjeffman, ssidhaye, sumenon, tscherf
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.9.8-2.module+el8.6.0+13621+937b8cd9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2065718 2065719 (view as bug list) Environment:
Last Closed: 2022-05-10 14:08:46 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: 2065718, 2065719    

Description Sergey Orlov 2021-09-06 08:47:32 UTC
This bug is a clone of https://bugzilla.redhat.com/show_bug.cgi?id=1980356

-----------------------------------------------------------------------------

The upstream test `test_smb` fails in `test_integration/test_smb.py::TestSMB::test_samba_reinstall`:
```
self = <ipatests.test_integration.test_smb.TestSMB object at 0x7f2d939a09a0>

    def test_samba_reinstall(self):
        """Test samba can be reinstalled.
    
        Test installation after uninstallation and do some sanity checks.
        Test for bug https://pagure.io/freeipa/issue/8021
        """
>       self.test_install_samba()

test_integration/test_smb.py:403: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test_integration/test_smb.py:238: in test_install_samba
    self.smbserver.run_command(['systemctl', 'status', service])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <ipatests.pytest_ipa.integration.host.Host client1.ipa.test (client)>
argv = ['systemctl', 'status', 'winbind'], set_env = True, stdin_text = None
log_stdout = True, raiseonerr = True, cwd = None, bg = False, encoding = 'utf-8'
ok_returncode = 0

    def run_command(self, argv, set_env=True, stdin_text=None,
                    log_stdout=True, raiseonerr=True,
                    cwd=None, bg=False, encoding='utf-8', ok_returncode=0):
        """Wrapper around run_command to log stderr on raiseonerr=True
    
        :param ok_returncode: return code considered to be correct,
                              you can pass an integer or sequence of integers
        """
        result = super().run_command(
            argv, set_env=set_env, stdin_text=stdin_text,
            log_stdout=log_stdout, raiseonerr=False, cwd=cwd, bg=bg,
            encoding=encoding
        )
        # in FIPS mode SSH may print noise to stderr, remove the string
        # "FIPS mode initialized" + optional newline.
        result.stderr_bytes = FIPS_NOISE_RE.sub(b'', result.stderr_bytes)
        try:
            result_ok = result.returncode in ok_returncode
        except TypeError:
            result_ok = result.returncode == ok_returncode
        if not result_ok and raiseonerr:
            result.log.error('stderr: %s', result.stderr_text)
>           raise subprocess.CalledProcessError(
                result.returncode, argv,
                result.stdout_text, result.stderr_text
            )
E           subprocess.CalledProcessError: Command '['systemctl', 'status', 'winbind']' returned non-zero exit status 3.

pytest_ipa/integration/host.py:200: CalledProcessError
```

The journal shows that winbindd coredumped:
```
Jan 30 12:27:36 client1.ipa.test systemd[1]: Starting Samba Winbind Daemon...
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.429596,  0] ../../source3/winbindd/winbindd_cache.c:3204(initialize_winbindd_cache)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   initialize_winbindd_cache: clearing cache and re-creating with version number 2
Jan 30 12:27:36 client1.ipa.test audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=winbind comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jan 30 12:27:36 client1.ipa.test systemd[1]: Started Samba Winbind Daemon.
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.442880,  0] ../../lib/util/become_daemon.c:135(daemon_ready)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   daemon_ready: daemon 'winbindd' finished starting up and ready to serve connections
Jan 30 12:27:36 client1.ipa.test systemd[1]: Starting Samba SMB Daemon...
Jan 30 12:27:36 client1.ipa.test winbindd[31148]: [2021/01/30 12:27:36.489004,  0] ../../source3/winbindd/winbindd_cm.c:1893(wb_open_internal_pipe)
Jan 30 12:27:36 client1.ipa.test winbindd[31148]:   open_internal_pipe: Could not connect to dssetup pipe: NT_STATUS_RPC_INTERFACE_NOT_FOUND
Jan 30 12:27:36 client1.ipa.test winbindd[31148]: [2021/01/30 12:27:36.491526,  0] ../../librpc/rpc/dcesrv_core.c:3007(dcesrv_call_dispatch_local)
Jan 30 12:27:36 client1.ipa.test winbindd[31148]:   dcesrv_call_dispatch_local: DCE/RPC fault in call lsarpc:2E - DCERPC_NCA_S_OP_RNG_ERROR
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.676076,  0] ../../lib/util/fault.c:172(smb_panic_log)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   ===============================================================
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.676996,  0] ../../lib/util/fault.c:173(smb_panic_log)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   INTERNAL ERROR: Signal 11: Segmentation fault in pid 31146 (4.14.0rc1)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.677666,  0] ../../lib/util/fault.c:177(smb_panic_log)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.678298,  0] ../../lib/util/fault.c:182(smb_panic_log)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   ===============================================================
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.678582,  0] ../../lib/util/fault.c:183(smb_panic_log)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   PANIC (pid 31146): Signal 11: Segmentation fault in 4.14.0rc1
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.680211,  0] ../../lib/util/fault.c:287(log_stack_trace)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   BACKTRACE: 17 stack frames:
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #0 /lib64/libsamba-util.so.0(log_stack_trace+0x34) [0x7f8bafcc4834]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #1 /lib64/libsamba-util.so.0(smb_panic+0xd) [0x7f8bafcc4a8d]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #2 /lib64/libsamba-util.so.0(+0x11b28) [0x7f8bafcc4b28]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #3 /lib64/libpthread.so.0(+0x13970) [0x7f8baf3a3970]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #4 /lib64/libdcerpc-binding.so.0(dcerpc_binding_handle_call_send+0x76) [0x7f8bb02e59d6]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #5 /usr/lib64/samba/libdcerpc-samba4.so(dcerpc_wbint_AllocateGid_r_send+0xa3) [0x7f8bafefaa73]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #6 /usr/lib64/samba/libdcerpc-samba4.so(dcerpc_wbint_AllocateGid_send+0xba) [0x7f8bafefad4a]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #7 /usr/sbin/winbindd(winbindd_allocate_gid_send+0x76) [0x558e3d243606]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #8 /usr/sbin/winbindd(+0x3450c) [0x558e3d1e950c]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #9 /usr/sbin/winbindd(+0x9b55f) [0x558e3d25055f]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #10 /lib64/libtevent.so.0(tevent_common_invoke_fd_handler+0x7d) [0x7f8baf2a1a4d]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #11 /lib64/libtevent.so.0(+0xd4e7) [0x7f8baf2a54e7]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #12 /lib64/libtevent.so.0(+0x5f57) [0x7f8baf29df57]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #13 /lib64/libtevent.so.0(_tevent_loop_once+0x94) [0x7f8baf2a1414]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #14 /usr/sbin/winbindd(main+0xe50) [0x558e3d1df270]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #15 /lib64/libc.so.6(__libc_start_main+0xd5) [0x7f8baeef7b75]
Jan 30 12:27:36 client1.ipa.test audit[31146]: ANOM_ABEND auid=4294967295 uid=0 gid=0 ses=4294967295 subj=system_u:system_r:winbind_t:s0 pid=31146 comm="winbindd" exe="/usr/sbin/winbindd" sig=6 res=1
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:    #16 /usr/sbin/winbindd(_start+0x2e) [0x558e3d1dfade]
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: [2021/01/30 12:27:36.684856,  0] ../../source3/lib/dumpcore.c:317(dump_core)
Jan 30 12:27:36 client1.ipa.test winbindd[31146]:   coredump is handled by helper binary specified at /proc/sys/kernel/core_pattern
Jan 30 12:27:36 client1.ipa.test winbindd[31146]: 
Jan 30 12:27:36 client1.ipa.test systemd[1]: Created slice system-systemd\x2dcoredump.slice.
```

Additional info:
Upstream ticket: https://pagure.io/freeipa/issue/8687

Comment 1 Florence Blanc-Renaud 2021-10-21 07:18:38 UTC
Moving back to IPA, the fix needs to be done in ipa-client-samba uninstaller.
Upstream PR in review https://github.com/freeipa/freeipa/pull/6056

Comment 10 Michal Polovka 2022-01-17 15:23:10 UTC
As the verification is blocked by https://issues.redhat.com/browse/IDMOPS-571, we are forced to move this BZ to later ITM (21).

Comment 14 Florence Blanc-Renaud 2022-01-19 15:07:30 UTC
Moving back to ON_QA, the move to Verified:FailedQA was a human error.

Comment 17 Florence Blanc-Renaud 2022-03-17 13:24:59 UTC
The BZ has also been detected on RHEL 8.4 and RHEL 8.5, hence asking for z-stream for those releases (see BZ 2065038 and BZ 2065040).

@tapazogl can you provide zstream+ ? thanks

Comment 23 errata-xmlrpc 2022-05-10 14:08:46 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 (idm:client and idm:DL1 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/RHEA-2022:1884

Comment 24 Red Hat Bugzilla 2023-09-15 01:35:55 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days