Page 1 of 1
Segmentation Fault
Posted: Fri May 14, 2004 3:14 am
by fran
hello to all!, could anybody tell me how to avoid the run time error: "segmentation fault" when I run my programs, they work perfectly under windows.

thank you.
Posted: Fri May 14, 2004 7:54 am
by Dominik Michniewski
Check carefully pointers (if you use it) or how can you index arrays ... This two reasons causes most of such errors
Best regards
DM
Posted: Sat May 22, 2004 5:35 pm
by fran
I have this problem when I use STL's vectors, maps, etc.
I suppose I should control their sizes...
thanks

Posted: Sat May 22, 2004 5:36 pm
by fran
I have this problem when I use STL's vectors, maps, etc.
I suppose I should control their sizes...
thanks

Posted: Sat May 22, 2004 9:00 pm
by jagadish
the simplest solution is to use GCC compiler to check your code before submiting .. u may then use gdb to step through the code
to exactly know which statement results in segmentation fault
Posted: Thu Jul 29, 2004 9:52 am
by Pavl0
in stl you must resize tables,vectors etc. some times j think
but j don't know execly becose j don't use stl
but if you use normal table[12] end your prog will call table[19] it will be segmentation
Posted: Fri Jul 30, 2004 12:23 am
by Alessandro
Simple solution: throw Windows out of the window and install Linux! I used Windows for years, now I think a true programmer can't bear with its lack of trasparence. Linux is full of instruments and utilities for a programmer.
I just use gcc/gdb/gprof from the shell...
(Sorry if I made some mistakes with the language)
Ale