Bug 1281577 - virt-inspector --xpath segfault on attribute get
Summary: virt-inspector --xpath segfault on attribute get
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-12 20:42 UTC by Richard Tollerton
Modified: 2015-11-13 19:00 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-13 19:00:21 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard Tollerton 2015-11-12 20:42:56 UTC
`virsh dumpxml dom | xmlstarlet sel -t -v '//domain/devices/interface[1]/mac/@address'` does what I'd expect and prints out the MAC. But `virsh dumpxml dom | virt-inspector --xpath '//domain/devices/interface[1]/mac/@address'` segfaults.

Stack trace:

#0  0x00007ffff6fb7ac4 in free () from /usr/lib/libc.so.6
#1  0x00007ffff75538d9 in xmlFreeNodeList () from /usr/lib/libxml2.so.2
#2  0x00007ffff7553696 in xmlFreeDoc () from /usr/lib/libxml2.so.2
#3  0x0000000000409dcc in guestfs_int_cleanup_xmlFreeDoc (ptr=0x7fffffffdc28)
    at cleanup.c:87
#4  0x0000000000409be2 in do_xpath (
    query=0x7fffffffe1a6 "//domain/devices/interface[1]/mac/@address")
    at inspector.c:805
#5  0x0000000000406f30 in main (argc=3, argv=0x7fffffffddd8) at inspector.c:250


Running version 1.30.4 on archlinux.

Comment 1 Richard W.M. Jones 2015-11-12 22:15:30 UTC
I can reproduce this on 1.31.25 too.

Comment 2 Richard W.M. Jones 2015-11-12 22:43:35 UTC
Patch posted:
https://www.redhat.com/archives/libguestfs/2015-November/msg00133.html

Comment 3 Richard Tollerton 2015-11-13 18:48:16 UTC
I've validated the fix in a build from master.

Comment 4 Richard W.M. Jones 2015-11-13 19:00:21 UTC
Fixed in 1.31.26.


Note You need to log in before you can comment on or make changes to this bug.