LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-27-2008, 03:24 AM   #1
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Rep: Reputation: 30
Question segmentation fault error


Hi
i am getting an error for my analog reports does anyone know how to resolve this problem the error is:
/home/admin/run-analog: line 8: 31079 Segmentation fault rmagic ./$i
/home/admin/run-analog: line 8: 31080 Segmentation fault rmagic ./$i
/home/admin/run-analog: line 8: 31081 Segmentation fault rmagic ./$i
/home/admin/run-analog: line 8: 31082 Segmentation fault rmagic ./$i
/home/admin/run-analog: line 8: 31083 Segmentation fault rmagic ./$i
/home/admin/run-analog: line 8: 31084 Segmentation fault rmagic ./$i
/home/admin/run-analog: line 8: 31085 Segmentation fault rmagic ./$i
there is more but its the same just different numbers
 
Old 05-27-2008, 08:09 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
what is /home/admin/run-analog? Is it a shell script? binary program? Did you write it? Do you have the source for it?

Segmentation fault means that a program has read/written memory outside of its memory allocation. It's impossible to tell why it's doing that without looking at the code.
 
Old 05-28-2008, 04:49 AM   #3
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
/home/admin/run-analog is a script that i use to run the report it has been working fine up till a couple of days ago
this is the script
Quote:
#!/bin/bash
cd /etc/analog/
#find /var/log/sitelogs/ -name "*.log" | xargs -L250 ~admin/dnstran1.5.2/dnstran -settings dnstran.conf
for i in `ls *.cfg`
do
analog +g$i
done
for i in `ls *.ini`
do
rmagic ./$i
done

# copy global previous report to a dated directory
mkdir -p /var/www/default_holding_page/reports/`date -d "$(date +%Y-%m-15) 1 month ago" +%Y-%m`
cp -r /var/www/default_holding_page/reports/prev /var/www/default_holding_page/reports/`date -d "$(date +%Y-%m-15) 1 month ago" +%Y-%m`
 
Old 05-28-2008, 01:26 PM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
is it possible that $i is empty?

maybe you (or someone else) changed an alias for 'ls' recently? If you "alias ls" does it give anything back?

Last edited by BrianK; 05-28-2008 at 01:29 PM.
 
Old 05-29-2008, 04:19 AM   #5
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
yes
# alias ls
alias ls='ls $LS_OPTIONS'
i also tried running rmagic on its own it still came up with the error
#rmagic site.ini
Segmentation fault

i reinstalled rmagic and tried again i got
# rmagic site.ini
gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
Can't call method "can" on an undefined value at /usr/share/rmagic/wadg/rm/Settings.pm line 928.

Last edited by mahmoud; 05-29-2008 at 10:51 AM.
 
Old 05-29-2008, 04:34 PM   #6
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
well, that alias line doesn't help at all without knowing what $LS_OPTIONS is.

that said, it sounds like you found your problem... rmagic is seg-faulting. Are you sure that site.ini file should work? I know nothing about rmagic (is it a Ruby binding for ImageMagick?), so it's going to be hard for me to help you from here on out, but I would double check that site.ini is a good file - maybe test it somewhere else with a working rmagic. If it's a good file, then I'd start looking at dependecies - something was probably updated without something else knowing about it. Did you install rmagic with your package management system or by hand? (that's a rhetorical question - if you did it by hand, I would try again with the package management system, even if it's an older version).

Good luck!
 
Old 05-30-2008, 03:29 AM   #7
mahmoud
Member
 
Registered: Apr 2006
Location: UK
Distribution: Mandriva, Debain, Redhat, Fedora, Ubuntu, FreeBSD
Posts: 269

Original Poster
Rep: Reputation: 30
the funny thing is it was working fine till some certain updates came in i used debain testing
so the update must have affected it in some way also its broken on all my serevrs
and i just installed a fresh one on my machine and it is broken as well. so i tried reinstalling it using aptitude
this is the error
# rmagic site.ini
Quote:
gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
Can't call method "can" on an undefined value at /usr/share/rmagic/wadg/rm/Settings.pm line 928.
also it was working fine, site.ini is just an example for the many config files i have
here are examples of my .ini and .cgf files in the /etc/analog folder
.ini
Quote:
[statistics]
File_In = /var/www/site/public/reports/report.dat
Frame_File_Out = index.html
Format= XHTML 1.0
Verbose = E

[reports]
Active_Column=R
File_Out = /var/www/site/public/reports/

Title_Font = Helvetica,Arial,sans-serif
Title_BG_Color = #000000
Title_Font_Color = #FFCC00

Data_Font = Helvetica,Arial,sans-serif
Data_Color_1 = #D0FFD0
Data_Color_2 = #F0FFF0
Data_Total_Color = #FFCC66
Data_Header_Color = #9999CC

[QUICK]
Rows = ALL

[graphs]
BG_Color = #FFFFCC

[navigation]
File_Out = nav.html

[website]
Title = Web Statistics for www.site.com
Webmaster = info@domain.co.uk
Base_URL = http://www.site.com
.cfg
Quote:
OUTFILE /var/www/site/public/reports/report.dat
APACHELOGFORMAT (%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{forensic-id}n\")
APACHELOGFORMAT (%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\")
LOGFILE /var/log/sitelogs/*site-access.log
LOGFILE /var/log/sitelogs/*site-access.log.gz
HOSTNAME "www.site.com"
HOSTURL "http://www.site.com"
IMAGEDIR "http://www.site.com/reports/"
REFREPEXCLUDE http://www.site.com/*
REFSITEEXCLUDE http://www.site.com/
CONFIGFILE ./common.inc
i also checked in the syslog and found and error
May 30 10:20:29 gaffer kernel: rmagic[29640]: segfault at 0000000b eip 08097496 esp bfb03098 error 4

Last edited by mahmoud; 05-30-2008 at 05:00 AM.
 
Old 06-11-2008, 11:24 AM   #8
chetoo
LQ Newbie
 
Registered: Jun 2008
Location: Spain
Distribution: Ubuntu,Gentoo,Debian
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by mahmoud View Post
yes
i reinstalled rmagic and tried again i got
# rmagic site.ini
gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
Can't call method "can" on an undefined value at /usr/share/rmagic/wadg/rm/Settings.pm line 928.
I get a similar one:

Code:
gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
Can't call method "can" on an undefined value at /usr/share/rmagic/wadg/rm/Settings.pm line 918.
Mine is:
Code:
# cat /etc/issue      
Debian GNU/Linux lenny/sid \n \l
 
Old 10-22-2008, 06:29 AM   #9
kenmiles
LQ Newbie
 
Registered: Oct 2008
Location: Newcastle upon Tyne
Distribution: Ubuntu 8.04
Posts: 6

Rep: Reputation: 0
Quote:
Originally Posted by chetoo View Post
I get a similar one:

Code:
gd warning: one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully
Can't call method "can" on an undefined value at /usr/share/rmagic/wadg/rm/Settings.pm line 918.
Did you ever find a solution to this problem as I am getting the same when trying to run rmagic.
Regards, Kenneth.
 
Old 10-26-2008, 05:31 AM   #10
chetoo
LQ Newbie
 
Registered: Jun 2008
Location: Spain
Distribution: Ubuntu,Gentoo,Debian
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by kenmiles View Post
Did you ever find a solution to this problem as I am getting the same when trying to run rmagic.
Regards, Kenneth.
Nop, still the same some months after, and even after a dist-upgrade. Could it be some weird data on hte log files? I do not know.
 
Old 02-24-2009, 01:11 PM   #11
jwadsack
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0
A solution was posted over at Launchpad (see below). You need to make a minor patch to the Settings.pm file because of a change in how gd library works.


--- Settings-orig.pm 2009-01-09 08:42:44.000000000 +0900
+++ Settings.pm 2009-01-09 08:43:07.000000000 +0900
@@ -907,7 +907,7 @@
# Check GD for support of desired output format. If none
# given or not capable, then set output format accordingly.
#
- my $g = new GD::Image(0,0);
+ my $g = new GD::Image(1,1);

if( defined $self->val( 'graphs', 'Format' ) ) {
if( $self->val( 'graphs', 'Format' ) =~ /jpe?g/i ) {


I have verified that this works. I'll get a patched Report Magic released in a few weeks but it may take a while to get through the distros.

--
Jeremy Wadsack

Forum won't let me post a URL so you'll have to piece this together:

https
://
bugs.
launchpad.
net/ubuntu/+source/rmagic/+bug/315280
 
Old 02-24-2009, 01:12 PM   #12
jwadsack
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0
Here's the URL in once piece (so that search engines can credit the source and provide affinity):

https://bugs.launchpad.net/ubuntu/+s...ic/+bug/315280
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
segmentation fault error dianarani Linux - Hardware 16 02-28-2008 07:19 AM
getting segmentation fault error sanjuonline1 Programming 2 02-14-2007 05:27 AM
Segmentation Fault ERROR bluechicken Programming 8 06-30-2005 07:02 AM
Segmentation fault + error on bootup xushi Slackware 9 01-03-2005 05:37 PM
Segmentation Fault Error ashwinipahuja Programming 1 03-29-2004 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration