Segmentation fault when adding nodes

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
User avatar
chercen
Posts: 41
Joined: Sun Apr 09, 2006 4:16 pm
Location: Spain

Segmentation fault when adding nodes

Post by chercen »

Hi all,

I have just installed Weathermap and I am getting a seg fault when trying to add nodes.
If I run "php weathermap ....." with a simple file (no nodes, just background and legend) it works fine. However, when I add a simple node it crashes with the following debug output:
prompt# php ./weathermap --config /var/www/cacti/plugins/weathermap/configs/Internet.conf --debug --output weathermap_2.png --htmloutput weathermap_2.html

Content-type: text/html
X-Powered-By: PHP/4.3.2

------------------------------------
Starting PHP-Weathermap run, with config: /var/www/cacti/plugins/weathermap/configs/Internet.conf
Setting bandwidth (100 -> 100 bps, 100 -> 100 bps, KILO = 1000)i/plugins/weathermap/configs/Internet.conf --output weathermap_2.png --htmloutput weathermap_.
Saving Default Node: DEFAULT
Setting bandwidth (100M, 100M)
Saving Default Link: DEFAULT
Saving Node: PP8KFOM1
Already have 7 scales, no defaults added.
Cycle 100 - set 0 and Skipped 0 for unresolved dependencies
Running Pre-Processing Plugins...
Running WeatherMapPreProcessorTest->run()
Test Preprocessor in the hizouse
Finished Pre-Processing Plugins...
Running Init() for Data Source Plugins...
Running WeatherMapDataSource_cactihost->Init()
ReadData CactiHost: Can only run from Cacti environment.
Removing WeatherMapDataSource_cactihost from Data Source roster
Running WeatherMapDataSource_dbsample->Init()
Running WeatherMapDataSource_external->Init()
Running WeatherMapDataSource_mrtg->Init()
Running WeatherMapDataSource_rrd->Init()
Running WeatherMapDataSource_snmp->Init()
SNMP DS: snmpget() not found. Do you have the PHP SNMP module?
Removing WeatherMapDataSource_snmp from Data Source roster
Running WeatherMapDataSource_static->Init()
Running WeatherMapDataSource_tabfile->Init()
Finished Initialising Plugins...
================== ReadData: Updating link data for all links and nodes


ReadData for NODE ROUTER1:
ReadData: No targets for NODE ROUTER1
ReadData: Setting 0,0

ReadData Completed.
--------------
Running Post-Processing Plugins...
Running WeatherMapPostProcessorTest->run()
weathermappostprocessortest Not Enabled
Finished Post-Processing Plugins...
AllocateScaleColours: DEFAULT KEYTEXT (0,0,0)
AllocateScaleColours: DEFAULT KEYBG (255,255,255)
AllocateScaleColours: DEFAULT BG (255,255,255)
AllocateScaleColours: DEFAULT TITLE (0,0,0)
AllocateScaleColours: DEFAULT TIME (0,0,0)
AllocateScaleColours: DEFAULT 1:10 (140,0,255)
AllocateScaleColours: DEFAULT 10:25 (32,32,255)
AllocateScaleColours: DEFAULT 25:40 (0,192,255)
AllocateScaleColours: DEFAULT 40:55 (0,240,0)
AllocateScaleColours: DEFAULT 55:70 (240,240,0)
AllocateScaleColours: DEFAULT 70:85 (255,192,0)
AllocateScaleColours: DEFAULT 85:100 (255,0,0)
Node->pre_render: Label Metrics are: 28 x 13 -> 32 x 17
Segmentation fault
Installation:

Red Hat EL3
Cacti 0.8.6j
weathermap 0.9
gd-1.8.4-12
PHP 4.3.2 (cgi) ---- Copyright (c) 1997-2003 The PHP Group, Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

Any help would be appreciated....

Thanks in advance,

Regards


[/quote]
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

What is your php.ini memory_limit?

There are only two things I know of that cause segfaults like this: one is memory_limit being reached and the other is a GD bug that is most common in Debian/Ubuntu, which is described in the weathermap FAQ.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
chercen
Posts: 41
Joined: Sun Apr 09, 2006 4:16 pm
Location: Spain

Post by chercen »

Hi Howie,

Our memory_limit=96M, I already increased it due to our large cacti installation. I have tried to make it bigger, e.g. 160M, but that doesnt help.

Could it be due to a bug? Wouldnt it crash just with just a background and a legend (and it doesnt)? I have read the "Seg fault bug" in gd, solved by installing gd2-xpm, but the thing is that RHEL3 does not provide gd-2...

Regards,

Howie wrote:What is your php.ini memory_limit?

There are only two things I know of that cause segfaults like this: one is memory_limit being reached and the other is a GD bug that is most common in Debian/Ubuntu, which is described in the weathermap FAQ.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

chercen wrote:Hi Howie,

Our memory_limit=96M, I already increased it due to our large cacti installation. I have tried to make it bigger, e.g. 160M, but that doesnt help.

Could it be due to a bug? Wouldnt it crash just with just a background and a legend (and it doesnt)? I have read the "Seg fault bug" in gd, solved by installing gd2-xpm, but the thing is that RHEL3 does not provide gd-2...

Regards,

Howie wrote:What is your php.ini memory_limit?

There are only two things I know of that cause segfaults like this: one is memory_limit being reached and the other is a GD bug that is most common in Debian/Ubuntu, which is described in the weathermap FAQ.
OK - so how did you get GD2? Is it compiled from source? or the one built in to php? or something else... the problem affects that specific version of GD, when compiled from source. It doesn't affect newer ones, or the one built into PHP, as I understand it...
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
chercen
Posts: 41
Joined: Sun Apr 09, 2006 4:16 pm
Location: Spain

Post by chercen »

Hi Howie,

Sorry for my English, I didnt say what I wanted to say :-)

I meant that I read the post that said that the gd bug could be solved by installing gd2-xpm, I didnt mean that I got any gd2 :-) In fact that could be a good point to confirm that it is a gd bug, however I do not know hot to get gd2-xpm for RHEL3...

Regards,

Howie wrote:
chercen wrote:Hi Howie,

Our memory_limit=96M, I already increased it due to our large cacti installation. I have tried to make it bigger, e.g. 160M, but that doesnt help.

Could it be due to a bug? Wouldnt it crash just with just a background and a legend (and it doesnt)? I have read the "Seg fault bug" in gd, solved by installing gd2-xpm, but the thing is that RHEL3 does not provide gd-2...

Regards,

Howie wrote:What is your php.ini memory_limit?

There are only two things I know of that cause segfaults like this: one is memory_limit being reached and the other is a GD bug that is most common in Debian/Ubuntu, which is described in the weathermap FAQ.
OK - so how did you get GD2? Is it compiled from source? or the one built in to php? or something else... the problem affects that specific version of GD, when compiled from source. It doesn't affect newer ones, or the one built into PHP, as I understand it...
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

chercen wrote:Hi Howie,

Sorry for my English, I didnt say what I wanted to say :-)

I meant that I read the post that said that the gd bug could be solved by installing gd2-xpm, I didnt mean that I got any gd2 :-) In fact that could be a good point to confirm that it is a gd bug, however I do not know hot to get gd2-xpm for RHEL3...
I think gd2-xpm is the debian package name. I think it's either gd or gd-devel for redhat. However, RHEL3 is unlikely to have a very-latest-version GD...

Before worrying too much, let's see if this is the same problem. Try commenting out line 4299 of Weathermap.class.php (that's the ImageAlphaBlending() line) by putting a # at the beginning. I think you will get a successful map, but maybe with some strange rendering around nodes. Maybe it's acceptable to you.

The solution to keep alpha blending would be to recompile either GD from source, then PHP from source to use it, OR php from source to use it's built-in GD, which has already fixed this problem.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
chercen
Posts: 41
Joined: Sun Apr 09, 2006 4:16 pm
Location: Spain

Post by chercen »

Hi Howie,

Got it... I tried commenting out that line but it didnt help, the output debug was exactly the same.
After that, I compiled php 5.2.1 with some bundled libraries and run "php weathermap ...", and it worked:
.....
AllocateScaleColours: DEFAULT 55:70 (240,240,0)
AllocateScaleColours: DEFAULT 70:85 (255,192,0)
AllocateScaleColours: DEFAULT 85:100 (255,0,0)
Node->pre_render: Label Metrics are: 28 x 13 -> 32 x 17
Drawing KEY for DEFAULT if necessary.
Drawing 7 colours into SCALE
Writing PNG file
So it seems that the problem is related to php or some other library (perhaps gd...). Maybe it would have been better to rebuild gd to check that bug, but I was wishing to use php5 instead of php4, and probably I will do the change with the new version.

Thanks for your help,

Regards

Howie wrote:
chercen wrote:Hi Howie,

Sorry for my English, I didnt say what I wanted to say :-)

I meant that I read the post that said that the gd bug could be solved by installing gd2-xpm, I didnt mean that I got any gd2 :-) In fact that could be a good point to confirm that it is a gd bug, however I do not know hot to get gd2-xpm for RHEL3...
I think gd2-xpm is the debian package name. I think it's either gd or gd-devel for redhat. However, RHEL3 is unlikely to have a very-latest-version GD...

Before worrying too much, let's see if this is the same problem. Try commenting out line 4299 of Weathermap.class.php (that's the ImageAlphaBlending() line) by putting a # at the beginning. I think you will get a successful map, but maybe with some strange rendering around nodes. Maybe it's acceptable to you.

The solution to keep alpha blending would be to recompile either GD from source, then PHP from source to use it, OR php from source to use it's built-in GD, which has already fixed this problem.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest