Bug 1480647

Summary: RFC: setroubleshootd crashing with error: ValueError: list modified during sort
Product: Red Hat Enterprise Linux 6 Reporter: Paulo Andrade <pandrade>
Component: setroubleshootAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.9CC: cww, lvrabec, mgrepl, mmalik, plautrba, ssekidde, vmojzis
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-15 17:51:59 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:

Description Paulo Andrade 2017-08-11 14:55:15 UTC
Backtrace is:

"""
:analyze.py:307:prune:ValueError: list modified during sort
:
:Traceback (most recent call last):
:  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
:    func(*targs, **kargs)
:  File "/usr/lib64/python2.6/site-packages/setroubleshoot/server.py", line 547, in goodbye
:    database.save()
:  File "/usr/lib64/python2.6/site-packages/setroubleshoot/analyze.py", line 377, in save
:    self.prune()
:  File "/usr/lib64/python2.6/site-packages/setroubleshoot/analyze.py", line 307, in prune
:    self.sigs.signature_list.sort(lambda a,b: cmp(a.last_seen_date, b.last_seen_date))
:ValueError: list modified during sort
:
:Local variables in innermost frame:
:self: <setroubleshoot.analyze.SETroubleshootDatabase object at 0x1042b10>
"""

  My guess is that it is receiving a SIGHUP during exit,
causing the list to be reset.

  I found one extra similar report, but never resolved, at:
https://bugzilla.redhat.com/show_bug.cgi?id=1069203
[[abrt] setroubleshoot-server: analyze.py:283:prune:ValueError: list modified during sort]

  Unless I am missing some other condition where the list may
change during sort, I believe the fix is likely to block SIGHUP
during exit, as there is no point in rereading config files if
exiting.

Comment 3 Petr Lautrbach 2017-08-21 11:14:09 UTC
This bug is reported on Red Hat Enterprise Linux 6 but it seems to be a problem of Red Hat Enterprise Linux 7. There's already a similar bug for this - https://bugzilla.redhat.com/show_bug.cgi?id=1315241 - lets move the discussion there.