When you are in gdb after the seg fault, the first thing you need is a backtrace.
Maybe that will be all you need, or maybe what you see in the backtrace will just tell you where to look next.
Type the command
backtrace
in gdb, and you will get a call stack of how your program reached the incorrect call to fseek.
Quote:
I cann't find the fseek.c
|
There is no reason to want to look at fseek.c. You already can see that fp=0 on entry to fseek, so you know that the error is in whatever provides that fp value, not in fseek itself. Maybe that error is in the function that directly called fseek or maybe it is in something further up the call stack.