[smokeping-users] Memory allocation error with smokeping.cgi/Smokeping.pm (2.0.9)

Sandor W. Sklar ssklar at stanford.edu
Sun Apr 8 03:27:19 CEST 2007


Hi, everyone ... hope I'm missing something simple here.  Sorry for  
the length of this email, I wanted to make it clear that I've tried  
pretty hard to solve this on my own, with no luck.   I've looked  
through the mailing list archives, and the closest I've seen to my  
problem is ...

<http://www.mail-archive.com/smokeping-users%40lists.oetiker.ch/ 
msg01909.html>

... but its not quite the same, and doesn't point to anything that  
might help me.

The system is a Sun X2200 M2, 2x 1.8 GHz Opteron processors, running  
RHEL 4u4 X86_64.  All of the pieces of rrdtool and the libraries it  
uses were compiled from source, on this system, following the  
instructions on the rrdtool website.

I'm having problems getting smokeping.cgi working.  The daemon  
process is running fine, but when I try to load the smokeping.cgi  
script, I get:

[Sat Apr 07 16:53:53 2007] [error] [client 171.66.16.78] [Sat Apr  7  
16:53:53 2007] smokeping.cgi: Can't load '/usr/local/lib/perl/5.8.5/ 
x86_64-linux-thread-multi/auto/RRDs/RRDs.so' for module RRDs:  
librrd.so.2: failed to map segment from shared object: Cannot  
allocate memory at /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/ 
DynaLoader.pm line 230.
[Sat Apr 07 16:53:53 2007] [error] [client 171.66.16.78] [Sat Apr  7  
16:53:53 2007] smokeping.cgi:  at /opt/home/smokeping/lib/ 
Smokeping.pm line 13
[Sat Apr 07 16:53:53 2007] [error] [client 171.66.16.78] [Sat Apr  7  
16:53:53 2007] smokeping.cgi: Compilation failed in require at /opt/ 
home/smokeping/lib/Smokeping.pm line 13.
[Sat Apr 07 16:53:53 2007] [error] [client 171.66.16.78] [Sat Apr  7  
16:53:53 2007] smokeping.cgi: BEGIN failed--compilation aborted at / 
opt/home/smokeping/lib/Smokeping.pm line 13.
[Sat Apr 07 16:53:53 2007] [error] [client 171.66.16.78] [Sat Apr  7  
16:53:53 2007] smokeping.cgi: Compilation failed in require at /opt/ 
home/smokeping/public_html/smokeping.cgi line 9.
[Sat Apr 07 16:53:53 2007] [error] [client 171.66.16.78] [Sat Apr  7  
16:53:53 2007] smokeping.cgi: BEGIN failed--compilation aborted at / 
opt/home/smokeping/public_html/smokeping.cgi line 9.

... in the apache server's error_log.  I've eliminated SpeedyCGI as  
the culprit; I get the same effect whether the shebang line is #!/usr/ 
bin/perl or #!/usr/bin/speedy.

The weird thing is that I have no problem running the script from the  
command-line, as the user that the webserver is running as:

[wwwuser at caprica ~]$ ~smokeping/public_html/smokeping.cgi
### fping seems to report in 1 milliseconds
Expires: Sun, 08 Apr 2007 00:04:09 GMT
Date: Sat, 07 Apr 2007 23:59:09 GMT
Content-Type: text/html; charset=iso-8859-15

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Cache-Control" content="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Refresh" CONTENT="300">
<TITLE>SmokePing Latency Page for smokeping</TITLE>
( ... snip ... )

... and I have no problem in general with the RRDs; the following  
test script works both from the command line and via the webserver:

##############################################################

#!/usr/bin/perl -w
# -*-perl-*-

use lib qw(/opt/home/smokeping/lib);
use lib qw(/usr/local/lib/perl /usr/local/lib/perl/5.8.5 /usr/local/ 
lib/perl/5.8.5/x86_64-linux-thread-multi);

use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

use strict;
use CGI;
use RRDs;
#use Smokeping 2.000009;

my $cgi = new CGI;

print $cgi->header;

print "<html><head></head><body>\n";

RRDs::create ("/tmp/test.rrd", "--step", "300",
               "DS:foobar:COUNTER:1800:0:4294967295",
               "RRA:AVERAGE:0.5:1:2016");

my $ERR = RRDs::error;

if ($ERR) {
         print "RRDs::create error was: $ERR\n<br><br>"
} else {
         my $hash = RRDs::info "/tmp/test.rrd";
         foreach my $key (keys %$hash) {
                 print "$key is $$hash{$key}\n<br>";
         };
};

print "</body></html>\n";

#############################################################

... but if I *uncomment* the "use Smokeping 2.000009" line in the  
above script, I get this error in the error_log ...

[Sat Apr 07 17:34:08 2007] [error] [client 171.66.16.78] Out of memory!
[Sat Apr 07 17:34:08 2007] [error] [client 171.66.16.78] [Sat Apr  7  
17:34:08 2007] rrdtest.cgi: Callback called exit at /opt/home/ 
smokeping/public_html/rrdtest.cgi line 12.
[Sat Apr 07 17:34:08 2007] [error] [client 171.66.16.78] [Sat Apr  7  
17:34:08 2007] rrdtest.cgi: END failed--call queue aborted at /opt/ 
home/smokeping/public_html/rrdtest.cgi line 11.
[Sat Apr 07 17:34:08 2007] [error] [client 171.66.16.78] [Sat Apr  7  
17:34:08 2007] Carp.pm: Callback called exit at /usr/lib/perl5/5.8.5/ 
CGI/Carp.pm line 314.
[Sat Apr 07 17:34:08 2007] [error] [client 171.66.16.78] [Sat Apr  7  
17:34:08 2007] rrdtest.cgi: BEGIN failed--compilation aborted at /opt/ 
home/smokeping/public_html/rrdtest.cgi line 12.

This system should have enough memory available:

[smokeping at caprica ~]$ free -m
              total       used       free     shared    buffers      
cached
Mem:          2007       1765        241          0        561         
735
-/+ buffers/cache:        468       1538
Swap:         4094          0       4094

... and the user account involved here ("wwwuser", the apache user)  
have what I think are reasonable limits set:

[wwwuser at caprica ~]$ id ; ulimit -a
uid=60009(wwwuser) gid=60009(wwwgroup) groups=60009(wwwgroup)
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals                 (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16383
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

... so I really don't know what else to try here.  Any pointers or  
suggestions, please?

Thanks,
	-s-






More information about the smokeping-users mailing list