Subject: | Build Issues Related to wchan |
Hi:
On my system (Debian unstable), I'm having difficulty building your
package because of empty files in /proc/*/wchan
Basically, your module expects it to contain one or more lines, but if
it doesn't, like on my system:
$ cat /proc/1/wchan
$
Then your module fails explosively. I'm really not even sure if this is
a problem with my Debian environment or whether it is an issue with your
module, and from my research I can't even tell what 'wchan' is for.
Notably, 'man ps' has this explanation:
wchan WCHAN name of the kernel function in which the process
is sleeping, a "-" if the process is running, or a "*" if the process is
multi-threaded and ps is not displaying threads.
But the explanation doesn't mean a whole lot to me.
Anyway, while packaging your module for Debian I found that the
following patch fixes the build failures we have been having:
--- a/lib/Sys/Statistics/Linux/Processes.pm
+++ b/lib/Sys/Statistics/Linux/Processes.pm
@@ -321,6 +321,9 @@
if (open my $fh, '<', "$file->{basedir}/$pid/$file->{wchan}") {
$stats{$pid}{wchan} = <$fh>;
+ unless (defined $stats{$pid}{wchan}) {
+ $stats{$pid}{wchan} = '';
+ }
chomp($stats{$pid}{wchan});
} else {
delete $stats{$pid};
Note that this fixes the issue noted in this Debian bug report:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539984
Any help you could provide us to track down the cause of this issue
would be great (and we would be tremendously appreciative), otherwise
the above patch seems to "fix" things for us...
Cheers,
Jonathan