LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Program received signal SIGSEGV, Segmentation fault (https://www.linuxquestions.org/questions/linux-newbie-8/program-received-signal-sigsegv-segmentation-fault-509681/)

dayalan_cse 12-12-2006 06:29 AM

Program received signal SIGSEGV, Segmentation fault
 
hai everyone,

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 182898743328 (LWP 22952)]
0x0000002a95da0340 in ?? ()
from /remote/data1/read.c

please help me to resolve this problem.


Thanks & Regards
dayalan

i_grok 12-12-2006 08:38 AM

It means that the read.c code tried to access memory incorrectly. Did you write read.c yourself?

dayalan_cse 12-13-2006 09:29 AM

Quote:

Originally Posted by i_grok
It means that the read.c code tried to access memory incorrectly. Did you write read.c yourself?

yes its my code only. can you please give me some more information about the SIGSEGV 11 signal and how to use the gdb to know the cause where it is happening in the code.


Thanks & Regards
dayalan

chrism01 12-13-2006 06:08 PM

Usually it means it read off the end of a 'string' ie char array; usually means last element of array was not '\0' ie the string terminator.

i_grok 12-13-2006 11:35 PM

Unfortunately, there are a lot of ways that this can happen. If your code isn't too complicated, please post it here and we might find the problem.

To learn gdb better, I would suggest searching for "gdb tutorial" on google. You'll find plenty of good examples. It, too, can be complicated, though.

matthewg42 12-13-2006 11:59 PM

Here's a description of SEGV which I wrote a week or two ago: http://www.linuxquestions.org/questi...29#post2533129

cyber-worx 12-14-2006 04:20 AM

Your attempting to access memory outside of your stack space.

Please paste your code :-)

dayalan_cse 12-14-2006 11:37 PM

do you mean that stack space is not enough to execte the code
 
Quote:

Originally Posted by cyber-worx
Your attempting to access memory outside of your stack space.

Please paste your code :-)

hai everyone,

thanks for the inputs from all.

do you mean that to execute my code stack is not enough and my code tries to access out of allocated memory because of this reason am i getting this Segmentation fault (SIGSEGV 11 signal).

can you please give me some information about the tools in linux for how to trace on this segmentation issues or some other run time problems ( Dynamic execution ) problems.

i know only GDB tool. other than this tool do you know some other tools ( means to view the memory opcode and datas where and why segementation happens like that ).


Thanks & Regards
dayalan

matthewg42 12-15-2006 12:05 AM

gdb should be all you need, although if you are uncomfortable with the text interface, you could try one of the many GUIs which run on top of it. For data structures, ddd is quite nice (although the GUI is a little quirky).


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