WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Fwd: Error while compiling with new RR scheduler

To: Ananth <cbananth@xxxxxxxxx>
Subject: Re: [Xen-devel] Fwd: Error while compiling with new RR scheduler
From: George Dunlap <dunlapg@xxxxxxxxx>
Date: Mon, 27 Apr 2009 13:59:26 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 27 Apr 2009 05:59:58 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=TCe5heqFcw+oQZxxc4hcuUyEJGOlYjVKJwoQeHvJjhk=; b=uH/nbaeOOCGIUEEQ4xAHRdHOtNO4PPosRfyqRm42gOK2YYvMvzoTAzceGchcNnEX2s z+hI0WYf0tYbszjSVo6dpVEAJ6cz/l3aSI9jy9aReA0VQndqNyVeEtEDiYtpd7HnxKum 83lzvTxOwalkGRDDgwxj1aPvYHRndYocwLVFM=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Qi9zdtOoZp9ziDBU3DUnbBqM7qWysid7l6AF02ibDf2Bsr7v03wdKgHaXTIr8ipqRK RtjHhMGkC8s4Ze+fzv6HpkgGQILPVvsjjbTjt4ftqs7berI136gvuKO+eoz6M+v1EngG loEQX8IrBfbggciXMhxs1funLgWs5rm3UtWCY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <bdf293de0904240813w5fc2c43fu4b1b05399b0ecc8d@xxxxxxxxxxxxxx>
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>
References: <bdf293de0904240655v472f4137l9e31e26b0ab2f034@xxxxxxxxxxxxxx> <bdf293de0904240813w5fc2c43fu4b1b05399b0ecc8d@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The message says it pretty clearly:  you return the value of ret, but
there are control paths in the function for which ret.task is not set.
 Namely, if list_empty(runq) is true, then you will return an
uninitialized value, which may be anything (garbage on the stack,
NULL, &c).  This will most likely cause Xen to crash, as
xen/common/schedule.c assumes that ret.task will be a valid, non-NULL
pointer.

If you happen to know that runq is never empty, then you don't need
the if statement.  If it may be empty, then you need an else clause to
return the idle vcpu for that processor.

 -George

2009/4/24 Ananth <cbananth@xxxxxxxxx>:
> Hi,
> I figured out that the error was because of a missing ' ; ' . This has been 
> fixed now. I have attached the modified code.
> While compiling I am getting the below error message.
>
> cc1: warnings being treated as errors
> sched_rrobin.c: In function ‘rrobin_schedule’:
> sched_rrobin.c:74: error: ‘ret.task’ may be used uninitialized in this 
> function
>
> Please guide.
>
> Thanks & Regards
> Ananth
>
>
> ---------- Forwarded message ----------
> From: Ananth <cbananth@xxxxxxxxx>
> Date: Fri, Apr 24, 2009 at 7:25 PM
> Subject: Error while compiling with new RR scheduler
> To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
>
>
> Hi,
> Please find attached the source code of Round Robin scheduler which I am 
> trying to add to Xen 3.3.1.
> I am facing the following error messages while compiling the same.
>
> sched_rrobin.c:31: error: two or more data types in declaration specifiers
>
> sched_rrobin.c: In function ‘rrobin_vcpu_init’:
>
> sched_rrobin.c:34: error: incompatible types in return
>
> sched_rrobin.c:51: error: incompatible types in return
>
> sched_rrobin.c:94: error: initialization from incompatible pointer type
>
> I believe the error in line 94 is causing the rest of the error messages. I 
> have checked with the structure definition in sched-if.h as well as the 
> implementation of the same in other schedulers such as SEDF and Credit.
>
> Request you to kindly provide your feedback regarding the same.
>
> Thanks & Regards
> Ananth
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel