This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] xenpm fail

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] xenpm fail
From: "Zhang, Yang Z" <yang.z.zhang@xxxxxxxxx>
Date: Fri, 29 Oct 2010 16:32:54 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "ian.jackson@xxxxxxxxxx" <ian.jackson@xxxxxxxxxx>, "ian.campbell@xxxxxxxxxx" <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 29 Oct 2010 01:34:41 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Act3Q+Glq+9nJFP2QEaRRp4TlseWvA==
Thread-topic: xenpm fail
Hi ian
I find Cs 22292 cause xenpm broken. When run "xenpm start" or "xenpm 
get-cpuidle-states" and other xenmpm command, it will get segment fault. 
After do some investigation, I find call xc_pm_get_cxstat() will free the 
For example:
Here is some code form my test.c.

struct xc_cx_stat cxstatinfo, *cxstat = &cxstatinfo;

cxstat->triggers = malloc(max_cx_num * sizeof(uint64_t)); 

if ( !cxstat->triggers ) {
        printf("get memory fail");
        return NOMEM;
ret = xc_pm_get_cxstat(xc_handle, cpu, cxstat);
printf("triggers=%lx \n", cxstat->triggers[0]);

Run it, and it will show segment fault at print the cxtat->tiggers[0]. It seems 
that xc_pm_get_cxstat() will free cxstat->triggers which we allocate memory 
before, and then when try to touch cxstat->tiggers[0], the issue raised.
If remove the patch 22292, everything is ok.

best regards

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>