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 2135314

Summary: pmfind crashes when -S option is given
Product: Red Hat Enterprise Linux 8 Reporter: Masatake YAMATO <yamato>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED ERRATA QA Contact: Jan Kurik <jkurik>
Severity: unspecified Docs Contact: Jacob Taylor Valdez <jvaldez>
Priority: unspecified    
Version: ---CC: agerstmayr, jkurik, nathans, scox, thashimo
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: 8.8Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcp-5.3.7-11.el8 Doc Type: No Doc Update
Doc Text:
If this bug requires documentation, please select an appropriate Doc Type value.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 08:13:26 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 Masatake YAMATO 2022-10-17 09:19:16 UTC
Description of problem:

pmfind crashes when -S is given like: pmfind -S -m probe=127.0.0.1/32 .

Version-Release number of selected component (if applicable):  pcp-5.3.5-8.el8.x86_64


How reproducible:

Steps to Reproduce:
1. Install RHEL8.6 (minimam installation).
2. Register the system and attach a subscription.
3. install pcp related packages with
   # yum --disablerepo='*' \                                                                                                                                      
        --enablerepo=rhel-8-for-x86_64-appstream-rpms\                                                                                                         
            --enablerepo=rhel-8-for-x86_64-baseos-rpms\                                                                                                        
                install pcp-zeroconf pcp-system-tools                              
4. Run pmfind -S -m probe=127.0.0.1/32.

Actual results:
    # pmfind -S -m probe=127.0.0.1/32                                                                                                                          
    Segmentation fault (core dumped)                                                                                                                           
                                                                                                                                                               
    # yum debuginfo-install pcp-5.3.5-8.el8.x86_64                                                                                                             
    # yum debuginfo-install avahi-libs-0.7-20.el8.x86_64 \                                                                                                     
      cyrus-sasl-lib-2.1.27-6.el8_5.x86_64 \                                                                                                                   
      dbus-libs-1.12.8-18.el8_6.1.x86_64 glibc-2.28-189.5.el8_6.x86_64 \                                                                                       
      keyutils-libs-1.5.10-9.el8.x86_64 krb5-libs-1.18.2-14.el8.x86_64 \                                                                                       
      libblkid-2.32.1-35.el8.x86_64 libcap-2.48-2.el8.x86_64 \                                                                                                 
      libcom_err-1.45.6-4.el8.x86_64 libgcrypt-1.8.5-7.el8_6.x86_64 \                                                                                          
      libgpg-error-1.31-1.el8.x86_64 libmount-2.32.1-35.el8.x86_64 \                                                                                           
      libselinux-2.9-5.el8.x86_64 libuuid-2.32.1-35.el8.x86_64\                                                                                                
      libuv-1.41.1-1.el8_4.x86_64 libxcrypt-4.1.1-6.el8.x86_64\                                                                                                
      lz4-libs-1.8.3-3.el8_4.x86_64 nspr-4.34.0-3.el8_6.x86_64\                                                                                                
      nss-3.79.0-10.el8_6.x86_64 nss-util-3.79.0-10.el8_6.x86_64\                                                                                              
      openssl-libs-1.1.1k-7.el8_6.x86_64 pcre2-10.32-3.el8_6.x86_64\                                                                                           
      systemd-libs-239-58.el8_6.7.x86_64 xz-libs-5.2.4-4.el8_6.x86_64\                                                                                         
      zlib-1.2.11-18.el8_5.x86_64                                                                                                                              
                                                                                                                                                               
    (gdb) where                                                                                                                                                
    #0  0x00007ffff71b3065 in uv_timer_start (handle=0x7ffff7dce700, cb=0x7ffff7bac110 <timer_worker>,                                                         
        timeout=1000, repeat=1000) at src/timer.c:80                                                                                                           
    #1  0x00007ffff7bac3cd in pmWebTimerRegister () from /lib64/libpcp_web.so.1                                                                                
    #2  0x00007ffff7ba6a1b in webgroup_lookup_context () from /lib64/libpcp_web.so.1                                                                           
    #3  0x00007ffff7ba824f in pmWebGroupContext () from /lib64/libpcp_web.so.1                                                                                 
    #4  0x000055555555645c in sources_discovery_start (arg=<optimized out>) at source.c:176                                                                    
    #5  0x00007ffff71b3318 in uv__run_timers (loop=loop@entry=0x7ffff73d6240 <default_loop_struct>)                                                            
        at src/timer.c:178                                                                                                                                     
    #6  0x00007ffff71b79e5 in uv_run (loop=loop@entry=0x7ffff73d6240 <default_loop_struct>,                                                                    
        mode=mode@entry=UV_RUN_DEFAULT) at src/unix/core.c:376                                                                                                 
    #7  0x0000555555556abe in source_discovery (count=<optimized out>, urls=0x555555759b70) at source.c:241                                                    
    #8  0x000055555555625b in discovery (spec=0x555555556beb "pmcd") at pmfind.c:168                                                                           
    #9  0x0000555555556057 in main (argc=4, argv=0x7fffffffe328) at pmfind.c:247                                                                               
    (gdb) list                                                                                                                                                 
    75                                                                                                                                                         
    76    if (uv__is_active(handle))                                                                                                                           
    77      uv_timer_stop(handle);                                                                                                                             
    78                                                                                                                                                         
    79    clamped_timeout = handle->loop->time + timeout;                                                                                                      
    80    if (clamped_timeout < timeout)                                                                                                                       
    81      clamped_timeout = (uint64_t) -1;                                                                                                                   
    82                                                                                                                                                         
    83    handle->timer_cb = cb;                                                                                                                               
    84    handle->timeout = clamped_timeout;                                                                                                                   
    (gdb) p handle                                                                                                                                             
    $1 = (uv_timer_t *) 0x7ffff7dce700                                                                                                                         
    (gdb) p handle->loop                                                                                                                                       
    $2 = (uv_loop_t *) 0x0


Expected results:

pmfind doesn't crash.

Additional info:

The same thing happens even on Fedora36.

Comment 1 Nathan Scott 2022-10-17 20:55:15 UTC
Thanks for reporting the problem Masatake - its easily reproducible as you found, and I understand the root cause.

A fix will follow shortly.  I anticipate it will be in the pcp-6.0.1 upstream release and something we could back-port to 8.8 provided QE resources are available for that release (if not, we can target 8.9).

Comment 5 errata-xmlrpc 2023-05-16 08:13:26 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 (pcp 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-2023:2745