LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 04-07-2005, 02:15 PM   #1
siemens
LQ Newbie
 
Registered: Mar 2005
Posts: 18

Rep: Reputation: 0
Unhappy c++ semantation fault


i'm trying to run a c++ program but i get only "segmantaion fault"...

what is it and how can i solve this problem?

thanks
 
Old 04-07-2005, 04:05 PM   #2
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Segmentation fault is a very generic problem and could be caused by any number of things depending on what you're doing. It results from some sort of memory allocation or access problem, often relating to pointers. Commonly it's because you try to access an area of memory you have not malloc'd or you are trying to access a memory that has already been freed.
 
Old 04-08-2005, 07:30 AM   #3
nukeu666
Member
 
Registered: Mar 2004
Location: India
Distribution: MDK, Fedora, Debian Unstable (current)
Posts: 80

Rep: Reputation: 15
your program must be trying to read outside arays
post the code here
 
Old 04-08-2005, 01:43 PM   #4
Komakino
Senior Member
 
Registered: Feb 2004
Location: Somerset, England
Distribution: Slackware 10.2, Slackware 10.0, Ubuntu 9.10
Posts: 1,938

Rep: Reputation: 55
Quote:
Originally posted by nukeu666
your program must be trying to read outside arays
post the code here
Or one of a hundred other things..!
 
Old 04-10-2005, 01:50 PM   #5
nukeu666
Member
 
Registered: Mar 2004
Location: India
Distribution: MDK, Fedora, Debian Unstable (current)
Posts: 80

Rep: Reputation: 15
hes looks like a noob and noobs have bad array handling skills
 
Old 04-11-2005, 11:18 AM   #6
dave_starsky
Member
 
Registered: Oct 2003
Location: UK, Manchester
Distribution: Gentoo (2.6.10-r4) & Ubuntu
Posts: 145

Rep: Reputation: 16
A good idea is to stick in some printf() statements, then you can track down exactly where your program dies, then when you look it might just be something really obvious.
 
Old 04-11-2005, 03:30 PM   #7
enemorales
Member
 
Registered: Jul 2004
Location: Santiago, Chile
Distribution: Ubuntu
Posts: 410

Rep: Reputation: 31
He never said he wrote the program. He is just trying to run it.
 
Old 04-12-2005, 07:10 AM   #8
dave_starsky
Member
 
Registered: Oct 2003
Location: UK, Manchester
Distribution: Gentoo (2.6.10-r4) & Ubuntu
Posts: 145

Rep: Reputation: 16
Quote:
Originally posted by enemorales
He never said he wrote the program. He is just trying to run it.
Good point
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
Segmentation fault sin-x Slackware 2 01-12-2005 03:01 PM
What is segmentation fault? koyi Programming 3 08-30-2003 12:03 AM
segmentation fault... perdesiz Linux - Software 1 08-18-2003 01:55 AM
C Segmentation Fault fatman Programming 20 04-02-2003 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:55 PM.

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