PDA

View Full Version : Segmentation fault



kmn2446
03-13-2004, 07:05 PM
When I run a simple ray tracing program under Mandrake 9.2, I got an error message saying "Segmentation fault". This program runs perfectly with VC++.
Could anyone point out what might be the cause?
Thanks in advance

Deiussum
03-15-2004, 05:22 AM
Segmentation faults are usually caused by the same thing that page faults are caused by in Windows. Touching memory in some way that you have no right to be touching it. (e.g. going beyond the bounds of an array, accessing a dangling pointer, writing to memory that only has read access, etc.)

Overmind
03-16-2004, 12:00 AM
Technically speaking Deiussum is right, but it could also be that you call a function with wrong parameters...

Try to run the program in a debugger to find out where the segfault is happening.

jide
03-16-2004, 08:36 AM
Originally posted by kmn2446:
When I run a simple ray tracing program under Mandrake 9.2, I got an error message saying "Segmentation fault". This program runs perfectly with VC++.
Could anyone point out what might be the cause?
Thanks in advance

Somehow windows programs don't run under linux and vice-versa. It's generally a programmer's fault.

Hope this helps.

Deiussum
03-16-2004, 08:53 AM
Originally posted by jide:
Somehow windows programs don't run under linux and vice-versa. It's generally a programmer's fault.

Hope this helps.

Since he mentions VC++, I would assume he has source code and is compiling it separately for each OS and not trying to use the same binary for both.

Although, if he's only compiling it with VC++ and expecting the .exe to run in Linux, you could be right here... http://www.opengl.org/discussion_boards/ubb/smile.gif