This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: IO_DEBUG in libio/Makefile
- To: libc-hacker@cygnus.com
- Subject: Re: IO_DEBUG in libio/Makefile
- From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
- Date: 08 Apr 1999 10:29:47 +0200
- References: <u86778chbg.fsf@arthur.rhein-neckar.de>
Andreas Jaeger <aj@arthur.rhein-neckar.de> writes:
|> PR libc/1069 reported a problem with a call to fseek on a non-opened
|> filehandle. The program worked when statically linked but fails
|> dynamically linked. Jon Sherling pointed out that this results from
|> different definitions for CHECK_FILE in libio/libioP.h. Only with
|> IO_DEBUG set (which is set for the static library), a test function is
|> used to check the FILE handle.
|>
|> Is this really intented? Shouldn't IO_DEBUG always be off - and
|> perhaps switched on only in some special debugging library ?
First of all, using a closed stdio filehandle in any way is a big no-no.
Jon's program does not work at all, it is just broken, and crashing is a
completely adequate outcome. And IO_DEBUG isn't even effective here
because it accesses memory that has already been freed, thus it can crash
as well. So i'd agree that it should be removed.
Andreas.
--
Andreas Schwab "And now for something
schwab@issan.cs.uni-dortmund.de completely different"
schwab@gnu.org