Re: Segmentation fault

From: Mysidia (
Date: 09/14/01

> > Program received signal SIGSEGV, Segmentation fault.
> > _IO_new_fclose (fp=0x0) at iofclose.c:50
> > 50      iofclose.c: No such file or directory.
> >         in iofclose.c

do a bt go up the call stack and try and find out where it's happening,
the backtarce as you showed it is useless except to show that fclose
is possibly not being called correctly.

the asserted condition for calling fclose is that the parameter points
to a valid FILE* structure such as that returned by fopen -- it has
to be set up with an open file, IOW:


has undefined behavior, and:


Also has undefined behavior.
If you've made other modifications 'fp' might have been the hapless
victim of corruption; however.

Note that some C libraries will check for and throw away NULL fcloses
silently, others will not check and memory corruption results;
fclose as found in MSVC++ does a direct assert() on the condition.


   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST