Bug 1990072

Summary: collectd-ipmi causes core dump
Product: Red Hat Enterprise Linux 8 Reporter: Pavel Cahyna <pcahyna>
Component: OpenIPMIAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: Jeff Bastian <jbastian>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.5CC: jbastian, ltrivell
Target Milestone: betaKeywords: Regression
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: OpenIPMI-2.0.31-2.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2044062 (view as bug list) Environment:
Last Closed: 2021-11-09 20:01:21 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 Pavel Cahyna 2021-08-04 16:51:19 UTC
This bug was initially created as a copy of Bug #1927022

I am copying this bug because: the same problem was caused by the OpenIPMI rebase in RHEL, bz1923044


Description of problem:

Activating the collectd-ipmi plugin causes a core dump

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

OpenIPMI-2.0.31-1.el8

How reproducible:

Always

Steps to Reproduce:

--------------------------------
LoadPlugin ipmi

<Plugin ipmi>
  <Instance default>
        Sensor "FAN4"
        Sensor "FAN5"
        Sensor "FANB"
        IgnoreSelected true
        NotifySensorAdd true
        NotifySensorRemove true
        NotifySensorNotPresent true
  </Instance>
</Plugin>

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

Actual results:

--------------------------------
Process 11260 (collectd) of user 0 dumped core.
                                               
                                               Stack trace of thread 11261:
                                               #0  0x00007fb40ef0c9d5 raise (libc.so.6 + 0x3d9d5)
                                               #1  0x00007fb40eef58a4 abort (libc.so.6 + 0x268a4)
                                               #2  0x00007fb40eef5789 __assert_fail_base.cold (libc.so.6 + 0x26789)
                                               #3  0x00007fb40ef05026 __assert_fail (libc.so.6 + 0x36026)
                                               #4  0x00007fb40e1d9dd4 valid_fd (libOpenIPMIpthread.so.0 + 0x4dd4)
                                               #5  0x00007fb40e1da374 sel_set_fd_write_handler (libOpenIPMIpthread.so.0 + 0x5374)
                                               #6  0x00007fb40e1db28e add_fd (libOpenIPMIpthread.so.0 + 0x628e)
                                               #7  0x00007fb40e105f15 ipmi_smi_setup_con (libOpenIPMI.so.0 + 0xb2f15)
                                               #8  0x00007fb40e1e3ecc c_ipmi_thread_main (ipmi.so + 0x2ecc)
                                               #9  0x00007fb40f0aa3f9 start_thread (libpthread.so.0 + 0x93f9)
                                               #10 0x00007fb40efd0b53 __clone (libc.so.6 + 0x101b53)
                                               
                                               Stack trace of thread 11260:
                                               #0  0x00007fb40de5f6f4 remoteConnectOpen (libvirt.so.0 + 0x30c6f4)
                                               #1  0x00007fb40de6f7a4 virConnectOpenInternal (libvirt.so.0 + 0x31c7a4)
                                               #2  0x00007fb40de70167 virConnectOpenReadOnly (libvirt.so.0 + 0x31d167)
                                               #3  0x00007fb40e034406 lv_connect (virt.so + 0x4406)
                                               #4  0x00007fb40e0348df lv_init (virt.so + 0x48df)
                                               #5  0x00005642fc871031 plugin_init_all (collectd + 0xf031)
                                               #6  0x00005642fc875bbc run_loop (collectd + 0x13bbc)
                                               #7  0x00005642fc868900 main (collectd + 0x6900)
                                               #8  0x00007fb40eef71e2 __libc_start_main (libc.so.6 + 0x281e2)
                                               #9  0x00005642fc868e1e _start (collectd + 0x6e1e)

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


Expected results:

Should work.


Additional info:

Workaround (not really): disable IPMI plugin


According to my (pcahyna) testing, reproducing the bug is very easy: it is enough to install collectd and collectd-ipmi on a machine with an IPMI interface and start collectd (collectd -f) - it will abort after opening /dev/ipmi0.

It is also possible to test on a machine without ipmi:
copy the <Plugin ipmi> block from /etc/collectd.conf to /etc/collectd.d/ipmi.conf and uncomment the <Instance "remote"> part, i.e. append this to the file:

<Plugin ipmi>
#       <Instance "local">
#               Sensor "some_sensor"
#               Sensor "another_one"
#               IgnoreSelected false
#               NotifySensorAdd false
#               NotifySensorRemove true
#               NotifySensorNotPresent false
#               NotifyIPMIConnectionState false
#               SELEnabled false
#               SELSensor "some_sensor"
#               SELSensor "another_one"
#               SELIgnoreSelected false
#               SELClearEvent false
#       </Instance>
        <Instance "remote">
                Host "server.example.com"
                Address  "1.2.3.4"
                Username "user"
                Password "secret"
                #AuthType "md5"
                Sensor "some_sensor"
                Sensor "another_one"
                IgnoreSelected false
                NotifySensorAdd false
                NotifySensorRemove true
                NotifySensorNotPresent false
                NotifyIPMIConnectionState false
                SELEnabled false
                SELSensor "some_sensor"
                SELSensor "another_one"
                SELIgnoreSelected false
                SELClearEvent false
        </Instance>
</Plugin>

Comment 9 errata-xmlrpc 2021-11-09 20:01:21 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 (OpenIPMI 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/RHBA-2021:4483