<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yes, that certainly looks like a bug.  Thanks for the help!<div><br><div><div>On Jun 27, 2013, at 6:35 PM, Hiroyuki Chishiro <<a href="mailto:chishiro@cs.unc.edu">chishiro@cs.unc.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div> </div><div>Hi Glenn,</div><div> </div><div>I hit a bug in release_master() in "liblitmus/src/migration.c".</div><div> </div><div>  11  int release_master()<br>  12  {<br>  13  static const char NO_CPU[] = "NO_CPU";<br>

  14  char buf[5] = {0}; /* up to 9999 CPUs */<br>  15  int master = -1;<br>  16  <br>  17  int ret = read_file("/proc/litmus/release_master", &buf, sizeof(buf)-1);<br>  18  <br>  19  if ((ret > 0) && (strncmp(buf, NO_CPU, sizeof(NO_CPU)-1) != 0))<br>

  20  master = atoi(buf);<br>  21  <br>  22  return master;<br>  23  }<br> </div><div> </div><div>If /proc/litmus/release_master is "NO_CPU", then buf = "NO_C" in line 17 because sizeof(buf) - 1 = 4.</div>

<div>So "strncmp(buf, NO_CPU, sizeof(NO_CPU)-1) != 0" in line 19 is always true because sizeof(NO_CPU) - 1 = 6. </div><div> </div><div>I think that the size of buf should be 7.</div><div> </div><div>  14  char buf[7] = {0}; /* up to 999999 CPUs */<br>

 </div><div>- Hiro </div><div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 17, 2013 at 12:05 PM, Björn Brandenburg <span dir="ltr"><<a href="mailto:bbb@mpi-sws.org" target="_blank">bbb@mpi-sws.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
Glenn Elliott <<a href="mailto:gelliott@cs.unc.edu">gelliott@cs.unc.edu</a>> wrote:<br>
> Done.  I've removed up old branches that have been superseded.  Two new branches pushed to github.<br>
><br>
> prop/migration-final (2 commits): This branch implements the CPU affinity mask assignment based against partition/cluster assignment.  rtspin and rt_launch were also updated to include clustered scheduling options.  This branch has been rebased off of liblitmus/staging.<br>

><br>
> prop/rt_task-init-final (2 commits): This branch adds the init_rt_task_param() routine.  It also updates liblitmus code to: (1) use init_rt_task_param() or new sporadic_*() convenience routines,  and (2) express time in nanoseconds.  #2 is needed because the sporadic_*() routines expect nanosecond parameters (the old sporadic_task() used milliseconds).  Please note that this branch builds on top of prop/migration-final.  Please further note that this branch depends upon litmus-rt/staging's 181b6bb0f5f122741262edc7ac0eca86d3f6dd73.<br>

<br>
<br>
</div>Finally got around to merging this. Thanks a lot for the patches. I had to add one compile fix commit on top. GCC 4.4.5 uncovered some aliasing violations (fallout from the earlier -O2 patch).<br>
<br>
Thanks,<br>
Björn<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
litmus-dev mailing list<br>
<a href="mailto:litmus-dev@lists.litmus-rt.org">litmus-dev@lists.litmus-rt.org</a><br>
<a href="https://lists.litmus-rt.org/listinfo/litmus-dev" target="_blank">https://lists.litmus-rt.org/listinfo/litmus-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">Hiroyuki Chishiro</div><div style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">
Visiting Scholar</div><div style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">Department of Computer Science</div><div style="margin: 0px; color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">
The University of North Carolina at Chapel Hill</div>
</div>
_______________________________________________<br>litmus-dev mailing list<br><a href="mailto:litmus-dev@lists.litmus-rt.org">litmus-dev@lists.litmus-rt.org</a><br>https://lists.litmus-rt.org/listinfo/litmus-dev<br></blockquote></div><br></div></body></html>