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.
Created attachment 1190378[details]
gdb.txt for gdb backtrace
Description of problem:
Core dumped when do secret-get-value
Version-Release number of selected component (if applicable):
libvirt-2.0.0-5.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1.Prepare a secret xml:
# cat secret.xml
<secret ephemeral='no' private='yes'>
<description>LUKS passphrase for the main hard drive of our mail
server</description>
<usage type='volume'>
<volume>/var/lib/libvirt/images/testvm.img</volume>
</usage>
</secret>
2.Define the secret
# virsh secret-define secret.xml
Secret 84fe59dd-6a87-415a-8dc1-1a10a63eeb6e created
3.Do secret-get-value
# virsh secret-get-value 84fe59dd-6a87-415a-8dc1-1a10a63eeb6e
Segmentation fault (core dumped)
Actual results:
As Step 3 descripted.
Expected results:
Should not core dumped and should give an error for no value has been set.
Additional info:
1.It works well on rhel7.2 with libvirt-1.2.17-13.el7.x86_64:
# virsh secret-get-value 8e730bc8-4dc3-43f2-be52-4246716dc6f3
error: Secret not found: secret '8e730bc8-4dc3-43f2-be52-4246716dc6f3' does not have a value
2.# cat /var/log/libvirt/libvirt.log|grep error
2016-08-12 11:36:30.498+0000: 17740: error : secretGetValue:363 : Invalid secret: secret is private
2016-08-12 11:36:30.602+0000: 17739: error : virNetSocketReadWire:1623 : End of file while reading data: Input/output error
3.gdb backtrace:
Pls refer to attachment: gdb.txt
posted a patch upstream :
http://www.redhat.com/archives/libvir-list/2016-August/msg00749.html
and pushed as:
commit 18701e9d6213be5a622d7c797f3a899b689e26b2
Author: John Ferlan <jferlan>
Date: Mon Aug 15 07:53:45 2016 -0400
virsh: Fix core for cmdSecretGetValue
...
When commit id 'cb2e3e50' reworked the cmdSecretGetValue call to use
VIR_DISPOSE_STRING for base64, it neglected to initialize the base64
value to NULL since the cleanup: label could be reached prior to the
base64 value being set or not. This resulted in a core dump, adding
the initialization will avoid the issue.
git describe 18701e9d6213be5a622d7c797f3a899b689e26b2
v2.1.0-129-g18701e9
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://rhn.redhat.com/errata/RHSA-2016-2577.html
Created attachment 1190378 [details] gdb.txt for gdb backtrace Description of problem: Core dumped when do secret-get-value Version-Release number of selected component (if applicable): libvirt-2.0.0-5.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.Prepare a secret xml: # cat secret.xml <secret ephemeral='no' private='yes'> <description>LUKS passphrase for the main hard drive of our mail server</description> <usage type='volume'> <volume>/var/lib/libvirt/images/testvm.img</volume> </usage> </secret> 2.Define the secret # virsh secret-define secret.xml Secret 84fe59dd-6a87-415a-8dc1-1a10a63eeb6e created 3.Do secret-get-value # virsh secret-get-value 84fe59dd-6a87-415a-8dc1-1a10a63eeb6e Segmentation fault (core dumped) Actual results: As Step 3 descripted. Expected results: Should not core dumped and should give an error for no value has been set. Additional info: 1.It works well on rhel7.2 with libvirt-1.2.17-13.el7.x86_64: # virsh secret-get-value 8e730bc8-4dc3-43f2-be52-4246716dc6f3 error: Secret not found: secret '8e730bc8-4dc3-43f2-be52-4246716dc6f3' does not have a value 2.# cat /var/log/libvirt/libvirt.log|grep error 2016-08-12 11:36:30.498+0000: 17740: error : secretGetValue:363 : Invalid secret: secret is private 2016-08-12 11:36:30.602+0000: 17739: error : virNetSocketReadWire:1623 : End of file while reading data: Input/output error 3.gdb backtrace: Pls refer to attachment: gdb.txt