From: Ananth Subject: Re: Fwd: Error while compiling with new RR scheduler Date: Mon, 27 Apr 2009 18:45:22 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0583507668==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --===============0583507668== Content-Type: multipart/alternative; boundary=001485f9234c8a4046046889236f --001485f9234c8a4046046889236f Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hello, Thank you so much for pointing it out. How could I miss something so obvious. I am able to compile it now. I will get back to you in case I get into any issues during run time. Thank you. Regards Ananth On Mon, Apr 27, 2009 at 6:29 PM, George Dunlap wrote: > 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 : > > 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 =91rrobin_schedule=92: > > sched_rrobin.c:74: error: =91ret.task=92 may be used uninitialized in t= his > function > > > > Please guide. > > > > Thanks & Regards > > Ananth > > > > > > ---------- Forwarded message ---------- > > From: Ananth > > Date: Fri, Apr 24, 2009 at 7:25 PM > > Subject: Error while compiling with new RR scheduler > > To: "xen-devel@lists.xensource.com" > > > > > > Hi, > > Please find attached the source code of Round Robin scheduler which I a= m > 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 =91rrobin_vcpu_init=92: > > > > 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 message= s. > 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@lists.xensource.com > > http://lists.xensource.com/xen-devel > > > > > --001485f9234c8a4046046889236f Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hello,
Thank you so much for pointing it out. How could I miss something= so obvious. I am able to compile it now. I will get back to you in case I = get into any issues during run time.

Thank you.

Regards
Ananth

On Mon, Apr 27, 2009 at 6:29 PM, G= eorge Dunlap <dun= lapg@umich.edu> wrote:
The message says it pretty clearly: =A0you return the value of ret, but
there are control paths in the function for which ret.task is not set.
=A0Namely, if list_empty(runq) is true, then you will return an
uninitialized value, which may be anything (garbage on the stack,
NULL, &c). =A0This 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. =A0If it may be empty, then you need an else clause to return the idle vcpu for that processor.

=A0-George

2009/4/24 Ananth <cbananth@gmail.c= om>:
> 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 =91rrobin_schedule=92:
> sched_rrobin.c:74: error: =91ret.task=92 may be used uninitialized in = this function
>
> Please guide.
>
> Thanks & Regards
> Ananth
>
>
> ---------- Forwarded message ----------
> From: Ananth <cbananth@gmail.= com>
> Date: Fri, Apr 24, 2009 at 7:25 PM
> Subject: Error while compiling with new RR scheduler
> To: "xen-devel@l= ists.xensource.com" <xen-devel@lists.xensource.com>
>
>
> 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 specif= iers
>
> sched_rrobin.c: In function =91rrobin_vcpu_init=92:
>
> 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 typ= e
>
> I believe the error in line 94 is causing the rest of the error messag= es. I have checked with the structure definition in sched-if.h as well as t= he implementation of the same in other schedulers such as SEDF and Credit.<= br> >
> Request you to kindly provide your feedback regarding the same.
>
> Thanks & Regards
> Ananth
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenso= urce.com
> htt= p://lists.xensource.com/xen-devel
>
>

--001485f9234c8a4046046889236f-- --===============0583507668== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0583507668==--