1. 01 8月, 2017 1 次提交
    • M
      virNetDaemonCallInhibit: Call virNetDaemonGotInhibitReply properly · ace45e67
      Michal Privoznik 提交于
      So there are couple of issues here. Firstly, we never unref the
      @pendingReply and thus it leaks.
      
      ==13279== 144 (72 direct, 72 indirect) bytes in 1 blocks are definitely lost in loss record 1,095 of 1,259
      ==13279==    at 0x4C2E080: calloc (vg_replace_malloc.c:711)
      ==13279==    by 0x781FA97: _dbus_pending_call_new_unlocked (in /usr/lib64/libdbus-1.so.3.14.11)
      ==13279==    by 0x7812A4C: dbus_connection_send_with_reply (in /usr/lib64/libdbus-1.so.3.14.11)
      ==13279==    by 0x56BEDF3: virNetDaemonCallInhibit (virnetdaemon.c:514)
      ==13279==    by 0x56BEF18: virNetDaemonAddShutdownInhibition (virnetdaemon.c:536)
      ==13279==    by 0x12473B: daemonInhibitCallback (libvirtd.c:742)
      ==13279==    by 0x1249BD: daemonRunStateInit (libvirtd.c:823)
      ==13279==    by 0x554FBCF: virThreadHelper (virthread.c:206)
      ==13279==    by 0x8F913D3: start_thread (in /lib64/libpthread-2.23.so)
      ==13279==    by 0x928DE3C: clone (in /lib64/libc-2.23.so)
      
      Secondly, while we send the message, we are suspended ('cos we're
      talking to a UNIX socket).  However, until we are resumed back
      again the reply might have came therefore subsequent
      dbus_pending_call_set_notify() has no effect and in fact the
      virNetDaemonGotInhibitReply() callback is never called. Thirdly,
      the dbus_connection_send_with_reply() has really stupid policy
      for return values. To cite the man page:
      
        Returns
            FALSE if no memory, TRUE otherwise.
      
      Yes, that's right. If anything goes wrong and it's not case of
      OOM then TRUE is returned, i.e. you're trying to pass FDs and
      it's not supported, or you're not connected, or anything else.
      Therefore, checking for return value of
      dbus_connection_send_with_reply() is not enoguh. We also have to
      check if @pendingReply is not NULL before proceeding any further.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ace45e67
  2. 05 7月, 2017 2 次提交
  3. 11 4月, 2017 1 次提交
  4. 13 4月, 2016 1 次提交
    • C
      rpc: daemon: Fix virtlog/virtlock daemon reload · 9b69f022
      Cole Robinson 提交于
      Trying to reload/SIGUSR1 virtlogd or virtlockd fails with:
      
      error : virNetDaemonRun:747 : internal error: Not all servers restored, cannot run server
      
      Commit 252610f7 changed the daemon state json to allow tracking
      multiple servers. However it missed clearing dmn->srvObject after
      the json is empty, like the previous code paths handled.  Later on in
      virNewDaemonRun, dmn->srvObject is expected to be empty otherwise we
      throw the above error.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1311013
      9b69f022
  5. 11 3月, 2016 5 次提交
  6. 17 2月, 2016 2 次提交
  7. 11 2月, 2016 1 次提交
    • M
      dbus: Don't unref NULL messages · 862298a2
      Michal Privoznik 提交于
      Apparently we are not the only ones with dumb free functions
      because dbus_message_unref() does not accept NULL either. But if
      I were to vote, this one is even more evil. Instead of returning
      an error just like we do it immediately dereference any pointer
      passed and thus crash you app. Well done DBus!
      
        Program received signal SIGSEGV, Segmentation fault.
        [Switching to Thread 0x7f878ebda700 (LWP 31264)]
        0x00007f87be4016e5 in ?? () from /usr/lib64/libdbus-1.so.3
        (gdb) bt
        #0  0x00007f87be4016e5 in ?? () from /usr/lib64/libdbus-1.so.3
        #1  0x00007f87be3f004e in dbus_message_unref () from /usr/lib64/libdbus-1.so.3
        #2  0x00007f87bf6ecf95 in virSystemdGetMachineNameByPID (pid=9849) at util/virsystemd.c:228
        #3  0x00007f879761bd4d in qemuConnectCgroup (driver=0x7f87600a32a0, vm=0x7f87600c7550) at qemu/qemu_cgroup.c:909
        #4  0x00007f87976386b7 in qemuProcessReconnect (opaque=0x7f87600db840) at qemu/qemu_process.c:3386
        #5  0x00007f87bf6edfff in virThreadHelper (data=0x7f87600d5580) at util/virthread.c:206
        #6  0x00007f87bb602334 in start_thread (arg=0x7f878ebda700) at pthread_create.c:333
        #7  0x00007f87bb3481bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
        (gdb) frame 2
        #2  0x00007f87bf6ecf95 in virSystemdGetMachineNameByPID (pid=9849) at util/virsystemd.c:228
        228         dbus_message_unref(reply);
        (gdb) p reply
        $1 = (DBusMessage *) 0x0
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      862298a2
  8. 10 7月, 2015 2 次提交
  9. 18 6月, 2015 1 次提交
  10. 16 6月, 2015 1 次提交