Yaroslav Halchenko wrote:
Dear Rick and Erik,
Thank you for your rapid attempt to resolve the issue.
I've got the trunk, rebuild debian package, deployed on both nodes, but
the problem persisted.
So much for that hope :)
To double-check what was running version here is
strings output (could not find --version switch or smth like that in
netperf):
right --version is not in netperf2, only netperf4 :) netperf2 is
strictly getopt(). I'll have to see if -V is available or not - -v is
already taken.
node3:/var/tmp# strings /usr/bin/netperf | grep 2.4
@(#)netlib.c (c) Copyright 1993-2006 Hewlett-Packard Company. Version 2.4.2
@(#)netsh.c (c) Copyright 1993-2004 Hewlett-Packard Company. Version 2.4.0
@(#)nettest_sctp.c (c) Copyright 2005 Hewlett-Packard Co. Version 2.4.1
@(#)netcpu_procstat.c (c) Copyright 2005. Version 2.4.0
I'm not always good about keeping the what strings up to date.
Another note: when running with -d (debug mode) it stalls instead of
segfaulting:
....
remote listen done.
About to start a timer for 1 seconds.
proc_stat_buf cpu 3098850 1145379525 31538156 28808563 1052301 296357 1541322 0
cpu0 1631885 572241410 16902161 13707535 500678 154683 719211 0
cpu1 1466965 573138115 14)
res[0] is 13707535
Hmm, looks like some sort of issue in calculating the size of the buffer
it should use when reading from /proc/stat. Any chance at a gdb
backtrace just for grins?
Looking at get_cpu_idle in src/netcpu_procstat.c I can see where I make
what is probably a very bad assumption about being able to print
proc_stat_buf as a string - ass-u-me-ing it will be null terminated is
probably not a good idea.
This patch should fix that, and add some additional debugging output:
Index: src/netcpu_procstat.c
===================================================================
--- src/netcpu_procstat.c (revision 59)
+++ src/netcpu_procstat.c (working copy)
@@ -50,12 +50,20 @@
#define N_CPU_LINES(nr) (nr == 1 ? 1 : 1 + nr)
static int proc_stat_fd = -1;
-static char* proc_stat_buf = NULL;
+static char *proc_stat_buf = NULL;
static int proc_stat_buflen = 0;
void
cpu_util_init(void)
{
+
+ if (debug) {
+ fprintf(where,
+ "cpu_util_init enter, proc_stat_fd %d proc_stat_buf %p\n",
+ proc_stat_fd,
+ proc_stat_buf);
+ fflush(where);
+ }
if (proc_stat_fd < 0) {
proc_stat_fd = open (PROC_STAT_FILE_NAME, O_RDONLY, NULL);
if (proc_stat_fd < 0) {
@@ -66,12 +74,21 @@
if (!proc_stat_buf) {
proc_stat_buflen = N_CPU_LINES (lib_num_loc_cpus) * CPU_LINE_LENGTH;
+ if (debug) {
+ fprintf(where,
+ "lib_num_loc_cpus %d lines %d CPU_LINE_LENGTH %d
proc_stat_buflen %d\n",
+ lib_num_loc_cpus,
+ N_CPU_LINES(lib_num_loc_cpus),
+ CPU_LINE_LENGTH,
+ proc_stat_buflen);
+ fflush(where);
+ }
proc_stat_buf = (char *)malloc (proc_stat_buflen);
if (!proc_stat_buf) {
fprintf (stderr, "Cannot allocate buffer memory!\n");
exit (1);
- };
- };
+ }
+ }
return;
}
@@ -104,6 +121,15 @@
if (!proc_stat_buf) {
proc_stat_buflen = N_CPU_LINES (lib_num_loc_cpus) * CPU_LINE_LENGTH;
+ if (debug) {
+ fprintf(where,
+ "calibrate: lib_num_loc_cpus %d lines %d CPU_LINE_LENGTH
%d proc_stat_buflen %d\n",
+ lib_num_loc_cpus,
+ N_CPU_LINES(lib_num_loc_cpus),
+ CPU_LINE_LENGTH,
+ proc_stat_buflen);
+ fflush(where);
+ }
proc_stat_buf = (char *)malloc (proc_stat_buflen);
if (!proc_stat_buf) {
fprintf (stderr, "Cannot allocate buffer memory!\n");
@@ -126,7 +152,7 @@
read (proc_stat_fd, p, proc_stat_buflen);
if (debug) {
- fprintf(where,"proc_stat_buf %s\n",p);
+ fprintf(where,"proc_stat_buf '%.*s'\n",proc_stat_buflen,p);
fflush(where);
}
/* Skip first line (total) on SMP */
but I do not expect it to fix the underlying problem.
Another Debian-only issue:
zcat /usr/share/doc/netperf/changelog.gz
See the file Release_Notes.node3:/var/tmp#
node3:/var/tmp# zcat /usr/share/doc/netperf/changelog.gz; echo
See the file Release_Notes.
node3:/var/tmp# find /usr/share/doc/netperf -iname *Release*
node3:/var/tmp#
So Release_Notes seems to be missing
Not sure what to say about that one. They are in the svn respository.
rick
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]