Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1163516

Summary: RHEL7 httpd crash in new_threadstate during ipactl restart with
Product: Red Hat Enterprise Linux 7 Reporter: Scott Poore <spoore>
Component: mod_wsgiAssignee: Luboš Uhliarik <luhliari>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jkaluza, jkejda, jorton, sgoveas
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-13 16:34:28 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:
Attachments:
Description Flags
abrt output email for the crash
none
proposed patch
none
abrt output email for another crash
none
Crash email 1
none
Coredump 1
none
Crash email 2
none
Coredump 2
none
abrt email for kdcproxy crash none

Description Scott Poore 2014-11-12 21:57:55 UTC
Description of problem:

During automated testing we're seeing some abrt crashes.  This is from one of the automated abrt emails we recieve:

abrt_version:   2.1.11
backtrace_rating: 4
cmdline:        /usr/sbin/httpd -DFOREGROUND
crash_function: new_threadstate
executable:     /usr/sbin/httpd
hostname:       cisco-c210-01.testrelm.test
kernel:         3.10.0-123.el7.x86_64
last_occurrence: 1427756443
pid:            6700
pkg_arch:       x86_64
pkg_epoch:      0
pkg_name:       httpd
pkg_release:    17.el7
pkg_version:    2.4.6
pwd:            /usr/share/httpd
runlevel:       N 3
time:           Mon 30 Mar 2015 07:00:43 PM EDT
uid:            48
username:       apache


Version-Release number of selected component (if applicable):
httpd-2.4.6-17.el7.x86_64.rpm

How reproducible:
Unknown but, it's happened a few times to date.

Steps to Reproduce:
1.  ipa-server-install
2.  ipactl restart

Actual results:
part of the time, we're seeing this crash but, it doesn't seem to be affecting the system or test.  So, I'm not sure 

Expected results:
no crash

Additional info:

Comment 1 Scott Poore 2014-11-12 22:00:25 UTC
Created attachment 956881 [details]
abrt output email for the crash

Comment 3 Joe Orton 2014-11-13 09:53:03 UTC
Curious crash here.  Backtrace is:

:#0  PyGrammar_RemoveAccelerators (g=<optimized out>) at /usr/src/debug/Python-2.7.5/Parser/acceler.c:48
:#1  0x00007f9b4134e3bb in Py_Finalize () at /usr/src/debug/Python-2.7.5/Python/pythonrun.c:547
:#2  0x00007f9b41627482 in wsgi_python_term () at mod_wsgi.c:5901
:#3  0x00007f9b41627a1b in wsgi_python_child_cleanup (data=<optimized out>) at mod_wsgi.c:6942
:#4  0x00007f9b4f4061ae in run_cleanups (cref=<optimized out>) at memory/unix/apr_pools.c:2352
:#5  apr_pool_destroy (pool=0x7f9b5127d038) at memory/unix/apr_pools.c:814
:#6  0x00007f9b41631e50 in wsgi_start_process (p=p@entry=0x7f9b5102f158, daemon=<optimized out>) at mod_wsgi.c:11958

which says tehre is a Python interpreter being *destroyed* during startup... confusing.

Comment 4 Jan Kaluža 2014-11-13 11:38:01 UTC
From the coredump, it looks like Python interpreter is destroyed, but before mod_wsgi process is stopped completely, its deadlock watchdog thread is executed. This thread does not check if the Python interpreter is initialized and presumes it's always there, but it's not in this case, therefore it crashes.

Proposed patch fixes that by:

1. Using apr_atomic_* for wsgi_python_initialized to be able to use it from multiple threads.

2. Setting wsgi_python_initialized to 0 *before* calling Py_Finalize();, so the deadlock watcher thread won't call Python methods during the Py_Finalize call.

3. Checking for wsgi_python_initialized in deadlock watcher thread.

Comment 5 Jan Kaluža 2014-11-13 11:38:39 UTC
Created attachment 957145 [details]
proposed patch

Comment 6 Jan Kaluža 2014-11-13 11:41:06 UTC
Scott,

if you see this crashes regularly or you are able to reproduce them, we can provide a test package with the patch applied, so you could verify it really fixes the issue you see.

Comment 7 Scott Poore 2014-11-17 18:00:29 UTC
Jan,

Unfortunately, I'm not certain about the frequency.  I haven't seen this particular crash occur again since I opened the bug.  I have also attempted to manually reproduce this by restarting ipa repeatedly.  So far, no luck.

Think I may have better luck reproducing if I just restarted httpd?

I could certainly take a look at a test rpm and add to a repo and test with that but, as of right now, I'm not sure about reproducing this one properly.

Thanks,
Scott

Comment 8 Scott Poore 2014-11-17 18:52:48 UTC
Created attachment 958317 [details]
abrt output email for another crash

I may have spoken too soon.  I just saw this crash occur.  It looks a little different but, I want to make sure.  Is this crash the same?

Comment 9 Jan Kaluža 2014-11-18 05:56:16 UTC
This is the same crash. I will build the test rpm for you today.

Comment 11 Scott Poore 2014-11-18 14:32:48 UTC
Ok got the test rpm and running some tests now.  Hopefully, will see (or not see) some results today.

I'm also asking my team to do the same if they see the crash.

Thanks,
Scott

Comment 12 Scott Poore 2014-11-25 20:40:48 UTC
Ok, I don't think we've seen this crash anywhere again when the test package was used.  I don't know how many jobs that is in total though.   The only place I've seen the crash was a test not using the test rpm.

Thanks,
Scott

Comment 13 Steeve Goveas 2015-01-12 16:03:13 UTC
Created attachment 979219 [details]
Crash email 1

Received crash in the same function while ipa stop start on 2 different servers. I have attached the complete abrt emails and coredumps

Comment 14 Steeve Goveas 2015-01-12 16:05:31 UTC
Created attachment 979221 [details]
Coredump 1

Comment 15 Steeve Goveas 2015-01-12 16:06:15 UTC
Created attachment 979222 [details]
Crash email 2

Comment 16 Steeve Goveas 2015-01-12 16:07:29 UTC
Created attachment 979223 [details]
Coredump 2

Comment 17 Joe Orton 2015-01-12 16:13:13 UTC
Steeve, are these new crashes with the patched mod_wsgi or not?

Comment 18 Steeve Goveas 2015-01-12 16:23:40 UTC
(In reply to Joe Orton from comment #17)
> Steeve, are these new crashes with the patched mod_wsgi or not?

mod_wsgi-3.4-12.el7_0.x86_64 was the version used on these servers. I will try mod_wsgi-3.4-13.el7_0.x86_64 and report back.

Comment 19 Scott Poore 2015-01-12 16:52:56 UTC
Joe,

I don't think we saw crashes when using -13 but, I'll let Steeve confirm since he's seeing them more readily at the moment.

Will that fix make it into RHEL7.1?  

Thanks,
Scott

Comment 20 Steeve Goveas 2015-01-14 18:17:23 UTC
Joe, Scott,

I tested with the fixed version in multiple jobs. There were no crashes seen.

Thanks,
-Steeve

Comment 21 Scott Poore 2015-09-02 19:04:06 UTC
Created attachment 1069579 [details]
abrt email for kdcproxy crash

This looks similar and does appears to have occurred for the affected version:

mod_wsgi-3.4-12.el7_0.x86_64

Attaching the abrt email we got for this one.

Comment 26 Joe Orton 2017-07-13 16:34:28 UTC

*** This bug has been marked as a duplicate of bug 1445540 ***