RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1746784 - Anaconda graphical installation is stuck in "Creating users"
Summary: Anaconda graphical installation is stuck in "Creating users"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: anaconda
Version: 7.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Anaconda Maintenance Team
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-29 09:26 UTC by wangye
Modified: 2021-03-15 07:38 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-15 07:38:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description wangye 2019-08-29 09:26:58 UTC
Description of problem:

The reason is deadlock. In the createUser of anaconda, fork a child process. When the child process calls libuser.admin(), the deadlock causes the thread to block.

# pstack processid
#0  pthread_rwlock_wrlock () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S:85
#1  0x00007f39e4ced975 in set_binding_values (...) at bindtextdom.c:117
#2  __bindtextdomain (...) at bindtextdom.c:348
#3  0x00007f39cdfe1a5e in lu_start (...) at lib/user.c:110
#4  0x00007f39ce1f378c in libuser_admin_new (...) at python/admin.c:1593
#9  PyEval_EvalFrameEx (f=f@entry=Frame 0x564c3c4e40e0, for file /usr/lib64/python2.7/site-packages/pyanaconda/users.py, line 554, in createUser 

Because _nl_state_lock is locked.
(gdb) p _nl_state_lock
$1 = {__data = {__lock = 0, __nr_readers = 1, __readers_wakeup = 0, __writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 1, __writer = 0, __shared = 0, __pad1 = 0...

That's because anaconda is multi-threaded. In a sub-thread, fork the child process. Since _nl_state_lock is a global variable lock, it may cause the child process to deadlock.

we should not use fork in /pyanaconda/users.py, which will cause a deadlock.
The later version of anaconda has got rid of libuser. if i want to continue using libuser, how to fix this problem.

Version-Release number of selected component (if applicable):
anaconda-21.48.22.134

How reproducible:
Occasionally

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
users.py code is below:
    def _prepareChroot(self, root):
        # Unfortunately libuser doesn't have an API to operate on a
        # chroot, so we hack it here by forking a child and calling
        # chroot() in that child's context.

        childpid = os.fork()
        if not childpid:
            if not root in ["","/"]:
                os.chroot(root)
                os.chdir("/")
                # This is ok because it's after a fork
                del(os.environ["LIBUSER_CONF"]) # pylint: disable=environment-modify

            self.admin = libuser.admin()

        return childpid

Comment 4 RHEL Program Management 2021-03-15 07:38:51 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.