fclose(stdout)
Andreas Jaeger
aj@arthur.rhein-neckar.de
Tue May 25 08:27:00 GMT 1999
>>>>> Jonathan Larmour writes:
> The following case crashes with a SEGV on my glibc 2.1 system. But I can't
> see any changes in 2.1.1 that would have fixed this. Any ideas?
Most probably a broken installation of glibc or egcs. Do you have in
/usr/include or /usr/local/include some old glibc 2.0 or libc5 headers
instead of glibc 2.1 headers ?
Andreas
> #include <stdio.h>
> int main()
> {
> printf("hi\n");
> fclose(stdout);
> return 0;
> }
> Program received signal SIGSEGV, Segmentation fault.
> 0x4006aa70 in _IO_new_fclose (fp=0x8049630) at iofclose.c:45
> iofclose.c:45: No such file or directory.
> (gdb) bt
> #0 0x4006aa70 in _IO_new_fclose (fp=0x8049630) at iofclose.c:45
> #1 0x80484da in main () at fff.c:6
> (gdb) p *fp
> $1 = {_flags = -72539124, _IO_read_ptr = 0x0, _IO_read_end = 0x0,
> _IO_read_base = 0x0,
> _IO_write_base = 0x0, _IO_write_ptr = 0x0, _IO_write_end = 0x0,
> _IO_buf_base = 0x0,
> _IO_buf_end = 0x0, _IO_save_base = 0x0, _IO_backup_base = 0x0,
> _IO_save_end = 0x0,
> _markers = 0x0, _chain = 0x40102400, _fileno = -1, _blksize = 0,
> _old_offset = -1,
> _cur_column = 0, _vtable_offset = -72 'ø', _shortbuf = "", _lock =
> 0x40102450, _offset = -1,
> _unused2 = {0, 0, 134518092, 0, 0, 1074810016, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> 0}}
> (gdb) p stdout
> $2 = (FILE *) 0x8049630
> As a result of this a rebuild of egcs cpp now segfaults the same way at
> cccp.c:2183 (current CVS). I have the impression that this probably *is*
> fixed, so its just a matter of knowing where/when. Ideas? Installation
> problem?
> Jifl
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de
More information about the Libc-hacker
mailing list