| Barry Margolin 2005-12-17, 2:48 am |
| In article <1134785590.144935.212950@z14g2000cwz.googlegroups.com>,
"friend.05@gmail.com" <hirenshah.05@gmail.com> wrote:
> In my program I am getting following error. what kind of error is this
> and how can I debug it.
>
>
> Program received signal SIGSEGV, Segmentation fault.
> 0xff31f69c in time () from /usr/lib/libc.so.1
It's a segmentation violation, which means that the program tried to
access memory that was not assigned to it, or attempted to write to
memory marked read-only. It usually comes from indirecting through
uninitialized pointer variables, or from using a string literal in a
place that requires a modifiable string.
You can debug it by running your program under a debugger. You'll then
see which call to time() had the problem, and you should be able to
figure out why the time_t* parameter isn't set properly (probably
because you forgot to call malloc()).
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
|