LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 10-12-2005, 09:07 AM   #1
winterhunter
Member
 
Registered: Oct 2005
Distribution: Ubuntu Edgy
Posts: 58

Rep: Reputation: 15
Segmentation faults


Hi everyone,

I'm kind of new to Linux (though I have some programming background), and I keep getting this annoying "segmentation faults" when I run some programs that I've downloaded.

I use the configure scripts, make gives some warnings but no errors, make install reports nothing... but when I try to run the application I get a segmentation fault.

BTW: what is a segmentation fault? Is is some kind of protected mode exception (yeah, my programming skills REALLY are outdated) under linux?

The last two examples I remember are E-UAE and Ur-Quan Masters 0.4.

For example, the latter gives me this :

------------------------------------------
The Ur-Quan Masters v0.4.0 (compiled Oct 12 2005 13:26:53)
This software comes with ABSOLUTELY NO WARRANTY;
for details see the included 'COPYING' file.

Initializing base SDL functionality.
Using SDL version 1.2.9 (compiled with 1.2.9)
Warning: There's no 'packages/addons' directory in the 'content' directory;
'--addon' options are ignored.
Initializing Pure-SDL graphics.
SDL driver used: x11
SDL initialized.
Initializing Screen.
Set the resolution to: 640x480x32
0 joysticks were found.
Initializing SDL audio subsystem.
SDL audio subsystem initialized.
Opening SDL audio device.
using dsp at 44100 Hz 16 bit stereo, 4096 samples audio buffer
Initializing mixer.
Mixer initialized.
Initializing sound decoders.
Sound decoders initialized.
'lbm/title.ani' -- 19 bytes
Segmentation fault
-------------------------------------------

I'm running SuSE 9.3 on a Athlon 64 3000+.

Any idea how can I solve this recurring problem ?


Thanks!
 
Old 10-12-2005, 09:31 AM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
I'm not sure how to solve the specific problem you have.. but I can explain what a Segmentation fault is.

A segfault occurs when a piece of memory is access in a method not allowed. Usually, but not always, this involves even access/loading an uninitialized pointer or a NULL pointer.
 
Old 10-12-2005, 09:33 AM   #3
dinolinux
Member
 
Registered: Jun 2005
Location: Oslo, Norway
Distribution: Slackware 11, Solaris 10, Solaris 9, Sourcemage 0.9.6
Posts: 322

Rep: Reputation: 31
Hello

Segmentation fault happens when a program uses memory that it can't use.

Have you recently installed any memory? The problem may be that your memory is too slow or you have different memory speeds. Try running a memtest for some hours and see what happens.
 
Old 10-12-2005, 09:58 AM   #4
winterhunter
Member
 
Registered: Oct 2005
Distribution: Ubuntu Edgy
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks for the answers!

@dinolux
As for having installed new memory, the answer's no. And the memtest programs I've run didn't detect any kind of failure. Besides, it's deterministic: no matter how many programs I have loaded into memory, they only ones that produce segfaults are the one who always did.

@jtshaw
Why would some programs that compile on other machines generate a segfault when compiled on mine? Can it be some kind of problem/obsolescence with GCC/glibc/SDL/whatever? The only "common points" between both programs are GCC/glibc/make and I think SDL.
 
Old 10-12-2005, 10:19 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally posted by winterhunter
Why would some programs that compile on other machines generate a segfault when compiled on mine? Can it be some kind of problem/obsolescence with GCC/glibc/SDL/whatever? The only "common points" between both programs are GCC/glibc/make and I think SDL.
Do you get the same warning (see below) with programs compiled (and running) on other machines.
Quote:
Warning: There's no 'packages/addons' directory in the 'content' directory;
If not, it might be a variable that's not (correctly) initialized if there's nothing in the given directory. Next the program might still try to access it without testing first with the segfault as a result. I make this type of mistakes quite often myself when I'm programming; most of the time I'll find them in the initial testing phase.

Last edited by Wim Sturkenboom; 10-12-2005 at 10:21 AM.
 
Old 10-14-2005, 03:06 AM   #6
winterhunter
Member
 
Registered: Oct 2005
Distribution: Ubuntu Edgy
Posts: 58

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Wim Sturkenboom
Do you get the same warning (see below) with programs compiled (and running) on other machines.
Actually, it is normal that the program gives that warning, and should work without addons. Just for the sake of it, I've tried installing some addons... Didn't get the warning, but still had a segfault.

But now I've managed to get a different kind of error!

I've installed the latest version of GCC, and recompiled the game in question. Well, no more segfaults, but the game can't open the data files (which are in .zip format) anymore. Actually, even the linker doesn't want to link libz anymore, saying it is "outdated or something".

This compiling stuff is getting quite frustrating!!!
 
  


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
Some help with segmentation faults? captainslushie Linux - Software 5 06-23-2005 02:59 PM
Segmentation Faults. Terroth Linux - Hardware 1 06-19-2005 05:16 AM
Segmentation Faults ryankask Mandriva 2 06-13-2005 07:10 PM
Segmentation Faults? DoomsdayChef Linux - Newbie 2 10-18-2003 08:18 AM
Segmentation Faults? floyd Linux - General 5 09-01-2003 11:54 PM


All times are GMT -5. The time now is 07:28 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration