The exact reading of a particular /proc/<pid>/stat that my program does is

fscanf(StatFile,
"%d %18s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %ld",
  &pid, procName, &dummychar,
  &dummyint, &dummyint, &dummyint, &dummyint, &dummyint,
  &dummyui, &dummyul, &dummyul, &dummyul, &dummyul,
  &utime, &stime, &dummyul, &dummyul, &dummyul, &dummyul, &num_threads);

So [ if I've counted and compared the columns correctly as I write ] my program reads fields 14 and 15, utime and stime, the first two of the four you marked with ^.

Those two columns are what I suggested are askew or nonsensible in /proc/<pid>/stat.

From comparing the differences ( etch/2.6.18 | lenny/2.6.26 ) in the /proc/[number]/stat section of "man proc" I see that there are significant changes to the content of /proc/[number]/stat from 2.6.18 to 2.6.26.

Following my sense of these apparent errors in lenny/2.6.26 /proc/<pid>/utime and /proc/<pid>/stime, the next logical step seemed to be for me to start grepping through the kernel source to discover how the kernels ( 2.6.18 & 2.6.26 ) tabulate and write utime and stime. My experience in kernel programming & debugging is NaN close to zero: I balked at committing to that on my own, focused on cleaning up my own coding, and only later started searching bugreport to see if anything similar was being tracked.

It takes some effort on my part to overcome my initial reaction "oops, I've done something wrong with pthreads: something that worked on etch/2.6.18/gcc-4.1/-lpthread but entered a buisy wait or race on lenny/2.6.26/..." and suggest an error in the newer kernel.

Related to #517108, once I let myself think that "my problem" could be a kernel bug, I suspect plausible yes.

Looking over the list of open bugs fairly quickly / blythely here with "whee, lets see what one might suspect of the kernel" in mind: #489305 #521304 too ?

Could 411840 be related? : call to getpwuid() inside a process works, but kernel writes incorrectly to proc/(getpwuid())/stat?
- Stewart



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to