Bug 1538570

Summary: Segmentation fault when run some virt-admin help srv* cmd.
Product: Red Hat Enterprise Linux 7 Reporter: zhe peng <zpeng>
Component: libvirtAssignee: Erik Skultety <eskultet>
Status: CLOSED ERRATA QA Contact: Lili Zhu <lizhu>
Severity: medium Docs Contact:
Priority: low    
Version: 7.5CC: dyuan, eskultet, jdenemar, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-4.3.0-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 09:52:39 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 zhe peng 2018-01-25 10:29:15 UTC
Description of problem:
Segmentation fault when run some virt-admin help srv* cmd.

Version-Release number of selected component (if applicable):
libvirt-admin-3.9.0-9.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.install libvirt-admin pkg
2.# virt-admin help srv-clients-set
  NAME
    srv-clients-set - (null)

  SYNOPSIS
    srv-clients-set
Segmentation fault (core dumped)

same with cmd srv-threadpool-set,srv-clients-info,srv-threadpool-info,srv-clients-list

actually srv-* cmd removed in help contents.
Monitoring commands (help keyword 'monitor'):
    server-list                    list available servers on a daemon
    server-threadpool-info         get server workerpool parameters
    client-list                    list clients connected to <server>
    client-info                    retrieve client's identity info from server
    server-clients-info            get server's client-related configuration limits

 Management commands (help keyword 'management'):
    server-threadpool-set          set server workerpool parameters
    client-disconnect              force disconnect a client from the given server
    server-clients-set             set server's client-related configuration limits
    daemon-log-filters             fetch or set the currently defined set of logging filters on daemon
    daemon-log-outputs             fetch or set the currently defined set of logging outputs on daemon

Actual results:


Expected results:
if virt-admin use server* instead of srv*, we hope no Segmentation fault and
error msg like this:
error: command or command group 'srv*' doesn't exist

Additional info:

Comment 1 Erik Skultety 2018-01-25 16:09:38 UTC
Fixed upstream by:

commit 23594ccda9d0813c1b019db7348d9e93f20bb884
Refs: v4.0.0-26-g23594ccda
Author:     Erik Skultety <eskultet>
AuthorDate: Thu Jan 25 16:13:37 2018 +0100
Commit:     Erik Skultety <eskultet>
CommitDate: Thu Jan 25 16:20:27 2018 +0100

    vsh: Cmd aliases lookups should return results for the aliased command

    Unfortunately, we have a number of aliases in virsh and even though
    these are not visible any more, we have to support them. The problem is
    that when trying to print help for the alias, we get SIGSEGV because
    there isn't any @def structure anymore and we need to query the command
    being aliased instead.

    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1538570

    Signed-off-by: Erik Skultety <eskultet>

Comment 3 Lili Zhu 2018-06-15 07:10:07 UTC
Verify this bug with:
libvirt-4.4.0-2.el7.x86_64

steps:
1. print help for virsh cmd alias
# virsh help nodedev-dettach
  NAME
    nodedev-detach - detach node device from its device driver

  SYNOPSIS
    nodedev-detach <device> [--driver <string>]
......

2. print help for virt-admin cmd alias
# virt-admin help srv-list 
  NAME
    server-list - list available servers on a daemon

  SYNOPSIS
    server-list

I also try to print help other cmd aliases of virt-admin, including srv-threadpool-info, srv-clients-info, srv-threadpool-set, srv-clients-set, all of them work well.

As the result matches with the expected result, mark the bug as verified.

Comment 5 errata-xmlrpc 2018-10-30 09:52:39 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, 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/RHSA-2018:3113