Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-02-2003, 06:26 AM
|
#1
|
LQ Newbie
Registered: Mar 2003
Distribution: Redhat
Posts: 14
Rep:
|
Segmentation Fault
I have recently put together a new comoputer, I think it's a 2GHZ athalon (quite an improvement over the 233 MHZ pentium I had been using). I have installed Redhat 8.0, and it seems to work for the most part. I have a perl script that I use to resize jpg files, which uses ImageMagick, and it works on the three other computers I use, all ao which have some version or other of Redhat on them. When I run this little script on my new computer it tells me segmentation fault. First, what, more or less, is a segmentation fault?
I have tried to troubleshoot the program by commenting out all of the lines that reffered to ImageMagick, and then running the program to see which line was causing the error. It seems that the offending line is the following:
$image->Read(file=>\*PICS);
I don't know if this is a hardware problem or a software problem, and I have no idea how to proceed. I would deeply appreciate any help.
Thanks
|
|
|
03-02-2003, 08:19 AM
|
#2
|
Member
Registered: Mar 2003
Location: Everett
Distribution: Slackware
Posts: 805
Rep:
|
What is the error message?
|
|
|
03-02-2003, 08:44 AM
|
#3
|
Member
Registered: Feb 2003
Location: Switzerland, Berne
Distribution: Slackware 9.0
Posts: 186
Rep:
|
A segfault (=Segmentation Fault) is an unexpected error in a programm routine. Simply: Your programm crashed.
|
|
|
03-02-2003, 08:53 AM
|
#4
|
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503
Rep:
|
Quote:
I have a perl script that I use to resize jpg files, which uses ImageMagick, and it works on the three other computers I use, all ao which have some version or other of Redhat on them.
|
If these are older versions of RedHat then they probably have different versions of perl on them. Is it possible that the newer version of perl that you have is not backwards compatible?
|
|
|
03-02-2003, 09:56 AM
|
#5
|
LQ Newbie
Registered: Mar 2003
Distribution: Redhat
Posts: 14
Original Poster
Rep:
|
The error message is simply "Segmentation fault" with exactly that capitalization(or lack thereof). It is a very simple script (I'm a simple programmer) so it seems unlikely that it would be a change in perl or the perl interface to ImageMagick. Do you think that I should contact the ImageMagick people and ask them? I will include the whole script since it is so short. I use it all the time, and if anyone else wants to use it, feel free. You have to make sure that you have the perl interface to ImageMagick installed.
#!/usr/bin/perl
#Program to resize all .jpg files in current directory and save them as a.jpg. first argument is height, second argument is width.
$width=pop(@ARGV);
$height=pop(@ARGV);
use Image::Magick;
$image = Image::Magick->new;
@files=`ls *.jpg`;
foreach $file (@files){
$file=~s/.jpg//;
chomp ($file);
open PICS, "<${file}.jpg" or die "cannot open ${file}.jpg";
binmode PICS;
$image->Read(file=>\*PICS);
close PICS;
$image->Resize(width=>$width, height=>$height);
print "${file}a.jpg\n";
open PICS, ">${file}a.jpg" or die "cannot open ${file}a.jpg";
$image->Write(file=>PICS);
close PICS;
undef @$image;
}
|
|
|
03-02-2003, 12:04 PM
|
#6
|
Member
Registered: Feb 2003
Distribution: Debian
Posts: 797
Rep:
|
Quote:
I have recently put together a new comoputer, I think it's a 2GHZ athalon
|
umm...you built a computer, but don't know exactly what the cpu is....?
Quote:
First, what, more or less, is a segmentation fault?
|
Segemntation fault is when your program tries to use memory that has not been allocated to it - since, you wrote this program, maybe you should look through it for memory problems - most likely a buffer overrun.
|
|
|
03-02-2003, 08:36 PM
|
#7
|
Member
Registered: Mar 2002
Location: Debian Galaxy
Distribution: Debian
Posts: 711
Rep:
|
I would run
www.memtest86.com
for 15-30 mins before jumping into conclusion.
|
|
|
All times are GMT -5. The time now is 11:47 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|