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 08-29-2015, 11:58 AM   #1
yogeshjadhav96
Member
 
Registered: Jul 2015
Location: Bangalore, India
Distribution: RHEL 7
Posts: 36

Rep: Reputation: Disabled
What is mean by "program terminated with signal 11 segmentation fault"


Hi All,

Today some crashe files generated in /var/crash/user-processed/some-file-names

When I ran gdb some-file-name
I got this:

"Program terminated by signal 11 segmentation fault"

May I know what is mean by this. What may be the reason to generate these crash files
 
Old 08-29-2015, 12:26 PM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
http://stackoverflow.com/questions/1...ation-fault-11
 
Old 08-29-2015, 10:33 PM   #3
ratt_salad
LQ Newbie
 
Registered: Jul 2015
Location: Canada
Distribution: PCLinuxOS
Posts: 14

Rep: Reputation: Disabled
Signal 11 (segmentation fault) means that the program accessed an unassigned memory location. It is usually a bug in the code.
For example allocating a buffer larger than available memory, not checking to see if the pointer to the buffer is non-NULL and then writing to the (non-existent) buffer.

Last edited by ratt_salad; 08-29-2015 at 10:37 PM.
 
1 members found this post helpful.
Old 09-02-2015, 03:18 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,308

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
A classic example is writing/reading past the end of a string in C (technically array-of-char).
Of course this can happen to any array type, but this is the most common ime.

I once had to debug a prod prog that only occasionally died... turned out that a particular 'string' declaration was just one char short (when inc the need for a char slot for the terminating \0) of the longest string it would receive.
Of course it only happened for that one incoming string, all the others were shorter, so it seemed random at the time...
 
Old 09-02-2015, 12:49 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,814
Blog Entries: 13

Rep: Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875Reputation: 4875
Did you type the backtrace "bt" command in GDB? That should show you where you were last and help you to examine variables, pointers, and so forth so that you can debug this. Note that it is helpful to have debug for GDB enabled when you compile the program, if you are compiling it. Another thing to do is enable core file dumping and see if you get a core file and then subsequently use GDB on the core file.

Happen to have an example of a segment violation from a former question, as well as GDB, and what have you:
Code:
#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{
    int *bad_addr = NULL;  // Since the address is 0x00000000 or NULL, attempting to write to that is a violation

    *bad_addr = 12345; // This is when the violation should occur

    return 0;
}
Compiling this:
Code:
gcc -o segv -ggdb segv.c
When running it either within GDB or analyzing a core file dump, it brings you to the line *bad_addr = 12345; or identifies segv.c:8 which is the number of that line.

But ... if you're not compiling, and also do not have the source, then it will be difficult to get to the bottom of this problem without the assistance of the author of the program or the actual source so that you can build it and debug it.
 
1 members found this post helpful.
Old 09-29-2015, 03:52 AM   #6
yogeshjadhav96
Member
 
Registered: Jul 2015
Location: Bangalore, India
Distribution: RHEL 7
Posts: 36

Original Poster
Rep: Reputation: Disabled
Thanks rtmistler
 
  


Reply

Tags
crash


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
Program has been terminated receiving signal 11 (Segmentation fault) Kronus980 Programming 4 03-09-2013 12:36 AM
Program received signal SIGSEGV, Segmentation fault go939 Programming 4 08-22-2007 06:54 PM
sunbird 0.3 does not start, error: Segmentation fault : "$prog" ${1+"$@"} polemon Ubuntu 8 01-08-2007 04:22 AM
why iam getting problems like "...too many files opened" or "segmentation fault" naren_0101bits Linux - Newbie 2 07-19-2004 12:20 PM
"segmentation fault" when run a simple c program acer_peri Programming 11 05-28-2004 04:14 AM

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

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