libvirt/daemon
Nikolay Shirokovskiy 2e66047cc0 daemon: Fix crash during daemon cleanup
Do not dereference the 'dmn' until after the virStateCleanup is completed.

During initialization, virStateInitialize requires/uses the "dmn" as the
argument to/for the daemonInhibitCallback functions. Thus, cleanup cannot
dereference 'dmn' until after calling the virStateCleanup which calls the
the daemonInhibitCallback using 'dmn'; otherwise, the following crash occurs:

backtrace (shortened a bit)

1  0x00007fd3a791b2e6 in virCondWait (c=<optimized out>, m=<optimized out>)
   at util/virthread.c:154
2  0x00007fd3a791bcb0 in virThreadPoolFree (pool=0x7fd38024ee00)
   at util/virthreadpool.c:266
3  0x00007fd38edaa00e in qemuStateCleanup () at qemu/qemu_driver.c:1116
4  0x00007fd3a79abfeb in virStateCleanup () at libvirt.c:808
5  0x00007fd3a85f2c9e in main (argc=<optimized out>, argv=<optimized out>)
    at libvirtd.c:1660

Thread 1 (Thread 0x7fd38722d700 (LWP 32256)):
0  0x00007fd3a7900910 in virClassIsDerivedFrom
   (klass=0xdfd36058d4853, parent=0x7fd3a8f394d0) at util/virobject.c:169
1  0x00007fd3a7900c4e in virObjectIsClass
   (anyobj=anyobj@entry=0x7fd3a8f2f850, klass=<optimized out>)
   at util/virobject.c:365
2  0x00007fd3a7900c74 in virObjectLock (anyobj=0x7fd3a8f2f850)
   at util/virobject.c:317
3  0x00007fd3a7a24d5d in virNetDaemonRemoveShutdownInhibition
   (dmn=0x7fd3a8f2f850) at rpc/virnetdaemon.c:547
4  0x00007fd38ed722cf in qemuProcessStop
   (driver=driver@entry=0x7fd380103810, vm=vm@entry=0x7fd38025b6d0,
    reason=reason@entry=VIR_DOMAIN_SHUTOFF_SHUTDOWN,
    asyncJob=asyncJob@entry=QEMU_ASYNC_JOB_NONE, flags=flags@entry=0)
   at qemu/qemu_process.c:5786
5  0x00007fd38edd9428 in processMonitorEOFEvent
   (vm=0x7fd38025b6d0, driver=0x7fd380103810) at qemu/qemu_driver.c:4588
6  qemuProcessEventHandler (data=<optimized out>, opaque=0x7fd380103810)
   at qemu/qemu_driver.c:4632
7  0x00007fd3a791bb55 in virThreadPoolWorker
   (opaque=opaque@entry=0x7fd3a8f1e4c0) at util/virthreadpool.c:145

(cherry picked from commit 85c3a1820a)
2017-05-10 15:42:45 -04:00
..
admin_server.c rpc: virnetserver: Rename ClientSetProcessingControls to ClientSetLimits 2016-08-02 14:51:13 +02:00
admin_server.h admin: Introduce virAdmServerSetClientLimits 2016-05-19 12:31:53 +02:00
admin.c admin: Introduce virAdmServerSetClientLimits 2016-05-19 12:31:53 +02:00
admin.h admin: Move admin_server.{h,c} to admin.{h,c} 2016-02-17 12:46:34 +01:00
libvirt.rules polkit: Allow password-less access for 'libvirt' group 2015-05-04 12:57:06 -04:00
libvirtd-config.c libvirtd: convert to typesafe virConf accessors 2016-07-12 09:57:01 +01:00
libvirtd-config.h libvirtd: convert to typesafe virConf accessors 2016-07-12 09:57:01 +01:00
libvirtd.aug libvirtd: add config option for TLS priority 2016-06-08 13:48:45 +01:00
libvirtd.c daemon: Fix crash during daemon cleanup 2017-05-10 15:42:45 -04:00
libvirtd.conf libvirtd.conf: Fix invalid default of max_anonymous_clients 2016-06-27 08:54:03 +02:00
libvirtd.h remote: implement node device lifecycle event APIs 2016-08-02 09:52:00 -04:00
libvirtd.init.in Fix LSB requirements in service script and sync them 2016-01-11 15:49:13 +01:00
libvirtd.libxl.logrotate.in libxl: add logrotate config file 2015-05-05 09:08:11 -06:00
libvirtd.logrotate.in Add logrotate support for libvirtd.log 2011-03-04 22:43:55 +08:00
libvirtd.lxc.logrotate.in Change logrotate to be per-hypervisor logs 2010-03-10 11:27:02 +01:00
libvirtd.pod man: Fix SYNOPSIS section 2016-04-25 15:40:44 +02:00
libvirtd.policy.in daemon: Make the default PolicyKit policy auth_admin_keep. 2012-11-01 13:17:26 +00:00
libvirtd.qemu.logrotate.in Change logrotate to be per-hypervisor logs 2010-03-10 11:27:02 +01:00
libvirtd.sasl daemon: Fix command example in libvirtd.sasl 2013-07-09 10:01:55 -04:00
libvirtd.service.in virtlogd.socket: Tie lifecycle to libvirtd.service 2017-05-10 15:24:50 -04:00
libvirtd.sysconf daemon: Enhance documentation for changing NOFILE limit 2014-03-20 10:55:44 +01:00
libvirtd.sysctl init: raise default system aio limits 2011-10-05 14:49:35 -06:00
libvirtd.uml.logrotate.in Change logrotate to be per-hypervisor logs 2010-03-10 11:27:02 +01:00
libvirtd.upstart daemon: Allow overriding NOFILES ulimit for the daemon as well 2012-02-01 16:04:30 +01:00
Makefile.am build: Replace variables in man pages 2016-04-25 15:40:44 +02:00
remote.c remote: rename protocol names for close callbacks 2016-08-23 19:48:01 +03:00
remote.h Implement the RPC protocol for the libvirt-lxc.la library 2013-01-15 18:16:53 +00:00
stream.c daemon: stream: Don't force error when client aborts 2016-05-02 10:13:05 -04:00
stream.h daemon stream: Remove useless empty lines from header file 2016-04-21 16:29:41 +02:00
test_libvirtd.aug.in libvirtd: add config option for TLS priority 2016-06-08 13:48:45 +01:00
THREADS.txt docs: fix usage of 'onto' 2013-04-19 14:31:16 -06:00