[netperf-talk] Bug in UDP_STREAM test when built w/ omni tests enabled

Alexander Duyck alexander.h.duyck at intel.com
Thu Dec 1 16:21:30 PST 2011


On 12/01/2011 02:57 PM, Alexander Duyck wrote:
> On 12/01/2011 01:56 PM, Rick Jones wrote:
>> On 12/01/2011 01:47 PM, Alexander Duyck wrote:
>>> I pulled from top-of-trunk and it looks like it fixed it for me as 
>>> well.
>>
>> Good - keep in mind that netperf has never supported mixing versions. 
>> Often it will "just work" but that is "by chance" and there was a 
>> change in the control message size post 2.5.0...
>>
>> happy benchmarking,
>>
>> rick jones
> I saw that so I just went ahead and updated everything to the new 
> version.  I also tried out the new "omni" test options and it looks 
> like I found a few minor bugs.
>
> The first one is on my x86_64 based system I am seeing:
> OMNI %s TEST from ::0 (::) port 0 AF_INET6 to localhost (::1) port 0 
> AF_INET6
>
> instead of:
> OMNI Send|Recv TEST from ::0 (::) port 0 AF_INET6 to localhost (::1) 
> port 0 AF_INET6
>
> The quick fix for that seemed to be to make direction_str in 
> src/nettest_omni.c static.  Once I did that it fixed the issue.
>
> The other thing I noticed is that Local CPU Util was always reporting 
> as 0%.  It turns out that was essentially the same issue, and once I 
> made the variable declaration for local_cpu_utilization_double static 
> it began reporting the correct value.  Odds are most of the global 
> variables should probably be made static to avoid these kind of issues 
> from cropping up.
>
> Thanks,
>
> Alex

Ignore the earlier fix.  While it is probably a good idea to move the 
global variables to a static definition it isn't what really solved the 
bug.  The bug was a buffer overflow.  I had to change the loop to end on 
OUTPUT_END instead of NETPERF_OUTPUT_MAX in order for this loop setup to 
work correctly in print_omni_init_list().

   /* belts and suspenders everyone... */
   for (i = NETPERF_OUTPUT_UNKNOWN; i < OUTPUT_END; i++) {
     netperf_output_source[i].output_name = i;
     netperf_output_source[i].max_line_len = 0;
     netperf_output_source[i].tot_line_len = 0;
     netperf_output_source[i].line[0] = "";
     netperf_output_source[i].line[1] = "";
     netperf_output_source[i].line[2] = "";
     netperf_output_source[i].line[3] = "";
     netperf_output_source[i].brief = "";
     netperf_output_source[i].format = "";
     netperf_output_source[i].display_value = NULL;
     netperf_output_source[i].output_default = 1;
     netperf_output_source[i].output_group = 0;
   }

Thanks,

Alex



More information about the netperf-talk mailing list