Segmentation fault???
I am doing numerical simulation under Red Hat Linux9.0 , but I met error sometime, and " Segmentation fault" is printed to the screen and the program stopped, I do not know why this happens, Help needed.
Thanks in advance! |
Re: Segmentation fault???
A segmentation fault generally points to a memory address error - usually caused by overrunning an array, in my experience. Try compiling with a -C option (for most compilers this enables array boundary checking) and see if it gives you any information when the program crashes.
|
Re: Segmentation fault???
Yes u r right? It happens to me when I forget to deallocate the arrays at the end of the program.(after allocating them at some point in the program). Hope it helps Bye
|
Re: Segmentation fault???
Just compile ur code using -g option eg $gcc -lm -g test.c
and then do $gdb a.out $gdb run Mostly program will crash, then type $gdb where It will show u the location of problem in ur code. Regards Sandip Jadhav -- http://www.aero.iitb.ac.in/userpages/sandipj |
All times are GMT -4. The time now is 17:34. |