| Summary: | Segmentation fault when connect to the guest console | ||
|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Alex Jia <ajia> |
| Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | unspecified | CC: | dyuan, gscrivan, gsun, jdenemar, jtomko, rbalakri |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-03-16 18:27:17 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: | |
|
Description
Alex Jia
2013-09-02 05:44:43 UTC
BTW, the libvirt daemon works well without crashing.
# systemctl status libvirtd.service
libvirtd.service - Virtualization daemon
Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled)
Active: active (running) since Mon 2013-09-02 13:46:04 HKT; 17s ago
Main PID: 10496 (libvirtd)
CGroup: /system.slice/libvirtd.service
├─ 1838 /sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
└─10496 /usr/sbin/libvirtd
Sep 02 13:46:04 localhost.localdomain systemd[1]: Started Virtualization daemon.
Sep 02 13:46:06 localhost.localdomain dnsmasq[1838]: read /etc/hosts - 4 addresses
Sep 02 13:46:06 localhost.localdomain dnsmasq[1838]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Sep 02 13:46:06 localhost.localdomain dnsmasq-dhcp[1838]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Sep 02 13:46:10 localhost.localdomain libvirtd[10496]: libvirt version: 1.1.1, package: 3.el7 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2013-08-30-11:06:08, x86-018.build.eng.bos.redhat.com)
Sep 02 13:46:10 localhost.localdomain libvirtd[10496]: End of file while reading data: Input/output error
# virsh list
Id Name State
----------------------------------------------------
4 foo running
should create stream obj first and give it to console: stream = conn.newStream(0) domobj.openConsole(None, stream, libvirt.VIR_DOMAIN_CONSOLE_FORCE) anyway the crash when gave None is a problem. This is a usage error which results in a crash of the application that used the API incorrectly. That's perfectly acceptable as the documentation says "a stream to associate with the console" should be passed. That said, it would be nice to report an error instead but it's very minor issue. seems to be fixed upstream by:
commit 6e130ddc4d06620c5567a13311542421a732e084
Author: Eric Blake <eblake>
Date: Tue Jan 7 14:38:12 2014 -0700
maint: improve VIR_ERR_INVALID_DOMAIN usage
In datatype.c, virGetDomainSnapshot could result in the message:
error: invalid domain pointer in bad domain
Furthermore, while there are a few functions in libvirt.c that
only care about a virDomainPtr without regards to the connection
(such as virDomainGetName), most functions also require a valid
connection. Yet several functions were blindly dereferencing
the conn member without checking it for validity first (such as
virDomainOpenConsole). Rather than try and correct all usage
of VIR_IS_DOMAIN vs. VIR_IS_CONNECTED_DOMAIN, it is easier to
just blindly require that a valid domain object always has a
valid connection object (which should be true anyways, since
every domain object holds a reference to its connection, so the
connection will not be closed until all domain objects have
also been closed to release their reference).
After this patch, all places that validate a domain consistently
report:
error: invalid domain pointer in someFunc
* src/datatypes.h (virCheckDomainReturn, virCheckDomainGoto): New
macros.
* src/datatypes.c (virGetDomainSnapshot): Use new macro.
(virLibConnError): Delete unused macro.
git describe: v1.2.0-250-g6e130dd contains: v1.2.1-rc1~1 |