[SOLVED] Segmentation Fault

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
bsdboy
Cacti User
Posts: 87
Joined: Mon May 22, 2006 5:24 pm

[SOLVED] Segmentation Fault

Post by bsdboy »

Hello there, doing a new install and having a terrible time getting cacti to serve a page. The symptoms are:

When config.php is incorrect I get:
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
When the vars are correct in there I get a segmentation fault:
[root@my-cacti cacti]# php -e index.php
Segmentation fault
I am able to pull a phpinfo.php so it appears as if php is working but I'm wondering if the mysql module in php is causing this. Here are the apache logs:
[Mon Jan 14 13:40:03 2008] [notice] child pid 16463 exit signal Segmentation fault (11)
[Mon Jan 14 13:41:15 2008] [notice] child pid 16543 exit signal Segmentation fault (11)
[Mon Jan 14 13:41:53 2008] [notice] child pid 16544 exit signal Segmentation fault (11)
Here are my versions:
[root@my-cacti cacti]# cat /etc/redhat-release
CentOS release 4.5 (Final)
[root@my-cacti cacti]# mysql -V
mysql Ver 14.12 Distrib 5.0.51, for redhat-linux-gnu (i686) using EditLine wrapper
[root@my-cacti cacti]#
[root@my-cacti cacti]# php -v
PHP 5.2.4 (cli) (built: Jan 14 2008 13:19:22)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
[root@my-cacti cacti]#
[root@my-cacti cacti]# ls /source/cacti-0.8.7a
[root@my-cacti cacti]# ls /source/rrdtool-1.2.26
Here is the php ./configure if it helps:
'./configure' '--with-mysql=/usr/local/mysql' '--with-zlib-dir=/usr/include' '--with-config-file-path=/usr/local/php' '--enable-sockets' '--with-gd' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache/bin/apxs'
Just hoping someone has a suggestion :-)

I've also tried php5.2.5 and cacti-0.8.7a, same deal.

Thanks in advance!
Last edited by bsdboy on Wed Jan 16, 2008 10:45 am, edited 1 time in total.
windycn
Posts: 5
Joined: Mon Jan 10, 2005 9:22 am

I have the same problem

Post by windycn »

Here is my situation:

My envirnaments:
Linux 2.6.23.9-85.fc8 SMP x86_64
httpd: httpd-2.2.6-3.x86_64
php: php-5.2.4-3.x86_64
cacti: cacti-0.8.7a-1.fc8.x86_64
phpMyAdmin: phpMyAdmin-2.11.3-1.fc8.x86_64
mysql: mysql-5.0.45-6.fc8.x86_64
httpd -l:
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c


When I use phpMyAdmin to operate mysql without any problem, but when I
install cacti, enter
http://localhost/cacti/, then I got these error log:

[Mon Jan 14 21:57:13 2008] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)
[Mon Jan 14 21:57:13 2008] [notice] Digest: generating secret for
digest authentication ...
[Mon Jan 14 21:57:13 2008] [notice] Digest: done
[Mon Jan 14 21:57:13 2008] [notice] Apache/2.2.6 (Unix) DAV/2
PHP/5.2.4 configured -- resuming normal operations
[Mon Jan 14 21:57:31 2008] [notice] child pid 4302 exit signal
Segmentation fault (11)

most problem is [Mon Jan 14 21:57:31 2008] [notice] child pid 4302
exit signal Segmentation fault (11), then
nothing showed on the web client, for instance, mozilla.

apache accesslog:
[14/Jan/2008:22:25:48 +0800] "GET /cacti HTTP/1.1" 301 315 "-" "Mozilla/5.0

Anyone have any tips, thanks in advance

Zhou Zhen
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Hi

are you both running SELinux ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
windycn
Posts: 5
Joined: Mon Jan 10, 2005 9:22 am

Post by windycn »

NO, I disable selinux for this installation.

ps axZ | grep httpd:

- 22406 ? Ss 0:00 /usr/sbin/httpd
- 22407 ? S 0:00 /usr/sbin/httpd
- 22408 ? S 0:00 /usr/sbin/httpd
- 22410 ? S 0:00 /usr/sbin/httpd
- 22411 ? S 0:00 /usr/sbin/httpd
- 22412 ? S 0:00 /usr/sbin/httpd
- 22413 ? S 0:00 /usr/sbin/httpd
- 22414 ? S 0:00 /usr/sbin/httpd
- 22415 ? S 0:00 /usr/sbin/httpd

Nothing related root_u:system_r:httpd_t.

Thanks
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Have you created the MySQL database, added a MySQL user, flushed the privileges, and configured /path/to/cacti/include/config.php before accessing http://yourserver/cacti ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
windycn
Posts: 5
Joined: Mon Jan 10, 2005 9:22 am

Post by windycn »

very sorry, the result maybe shoot me by a gun.

I miss a step to create cacti database.

Anyway, thanks a lot.

Zhou Zhen
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Is it working now ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
windycn
Posts: 5
Joined: Mon Jan 10, 2005 9:22 am

Post by windycn »

yes, it works now.

Thanks a lot.
bsdboy
Cacti User
Posts: 87
Joined: Mon May 22, 2006 5:24 pm

Post by bsdboy »

Ack, i think I missed that step too :o

I'll try tonight and report afterwards...
bsdboy
Cacti User
Posts: 87
Joined: Mon May 22, 2006 5:24 pm

Post by bsdboy »

I've checked and it does appear as if I did set up mysql correctly... Here is my install doc.
# Install MySQL5
wget http://mysql.he.net/Downloads/MySQL-5.0 ... .51.tar.gz
zcat mysql-5.0.51.tar.gz |tar xvf -
cd mysql-5.0.51
./configure --prefix=/usr/local/mysql
make
make install

# Do some post installation stuff for mysql
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
scripts/mysql_install_db --user=mysql
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
rm -f /etc/my.cnf
cp support-files/my-medium.cnf /etc/my.cnf
echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf
echo /usr/local/lib >> /etc/ld.so.conf
/sbin/ldconfig
cp support-files/mysql.server /etc/init.d/mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
cd /etc/rc3.d/
ln -s ../init.d/mysql S85mysql
ln -s ../init.d/mysql K85mysql
cd /etc/rc5.d/
ln -s ../init.d/mysql S85mysql
ln -s ../init.d/mysql K85mysql
cd /etc/init.d/
chmod 755 mysql
/usr/local/mysql/bin/mysqladmin -u root password 'mypass'
I've blasted the current mysql install and am going to rebuild from source just to be sure.
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Have you tried with the MySQL RPMS provided by CentOS ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
bsdboy
Cacti User
Posts: 87
Joined: Mon May 22, 2006 5:24 pm

Post by bsdboy »

Ah, found the problem... I hadn't imported cacti.sql
mysql -u cactiuser cactidb -p < cacti.sql
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests