All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH]libxc: fix a Segmentation fault
Date: Mon, 28 Jun 2010 14:45:55 +0800	[thread overview]
Message-ID: <4C284523.4000304@cn.fujitsu.com> (raw)

# xl list
xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error
Segmentation fault

This is because xc free the logger which xl created.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com> 

diff -r b622e411eef8 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c	Thu Jun 24 21:56:03 2010 +0100
+++ b/tools/libxc/xc_private.c	Mon Jun 28 22:48:07 2010 +0800
@@ -19,6 +19,7 @@
                                 xentoollog_logger *dombuild_logger,
                                 unsigned open_flags) {
     xc_interface xch_buf, *xch = &xch_buf;
+    int init_handler = 0;
 
     xch->fd = -1;
     xch->dombuild_logger_file = 0;
@@ -33,6 +34,7 @@
             xtl_createlogger_stdiostream(stderr, XTL_PROGRESS, 0);
         if (!xch->error_handler)
             goto err;
+        init_handler =1;
     }
 
     xch = malloc(sizeof(*xch));
@@ -52,7 +54,7 @@
     return xch;
 
  err:
-    if (xch) xtl_logger_destroy(xch->error_handler);
+    if (xch && init_handler) xtl_logger_destroy(xch->error_handler);
     if (xch != &xch_buf) free(xch);
     return 0;
 }

-- 
Regards
Yang Hongyang

             reply	other threads:[~2010-06-28  6:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28  6:45 Yang Hongyang [this message]
2010-06-28 15:54 ` [PATCH]libxc: fix a Segmentation fault Ian Jackson
2010-06-29  0:40   ` Yang Hongyang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C284523.4000304@cn.fujitsu.com \
    --to=yanghy@cn.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.