LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2009, 01:27 AM   #1
wkirubakaran
LQ Newbie
 
Registered: Mar 2009
Posts: 1

Rep: Reputation: 0
How to handle Segmentation Fault


Hello Friends. I am a newbie to Linux. The program that was
working perfectly ok in Unix is failing with segmentation fault.
The program aborts immediately. Is there way to make the program
continue further instead of aborting ?
 
Old 03-24-2009, 04:52 PM   #2
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
Short answer, no.

A segmentation fault occurs when a program attempts to access a memory address which is not allocated to it. If the operating system detects a program doing this then the offending program will be immediately terminated by the OS to prevent potential interference with other programs.

Ultimately, the only way to get the program running on Linux is to identify and fix the problem. If you wrote the program yourself, its time to start debugging! You may find the "valgrind" program helps to identify the problem.

Obviously, I can't say exactly what causes the problem, but common causes include use of uninitialised or NULL pointers, and loops that iterate round an array going too far.

Assuming you have access to the code, and its not too big, then post it here and with any luck someone will be able to spot the problem.
 
  


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 mr_empty Fedora 5 12-19-2006 08:35 AM
Why segmentation fault? Superdude Programming 15 12-08-2006 03:01 AM
LXer: Windows Guru: Why Samba can't handle Vista... And It's Not Samba's Fault LXer Syndicated Linux News 0 04-01-2006 05:03 AM
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
segmentation fault ice99 Linux - Software 1 08-19-2005 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:55 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