This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: [Various] libc/1208: segfault in fclose on fdopen'ed FILE pointer
- To: hjl@lucon.org (H.J. Lu)
- Subject: Re: [Various] libc/1208: segfault in fclose on fdopen'ed FILE pointer
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: 18 Jul 1999 22:18:40 +0200
- Cc: libc-alpha@sourceware.cygnus.com (libc-alpha Mailinglist), sascha@schumann.cx
- References: <19990718180613.6EABF57B9@ocean.lucon.org>
>>>>> H J Lu writes:
>>
>> >Number: 1208
>> >Category: libc
>> >Synopsis: segfault in fclose on fdopen'ed FILE pointer
>> >Confidential: no
>> >Severity: serious
>> >Priority: medium
>> >Responsible: libc-gnats
>> >State: open
>> >Class: sw-bug
>> >Submitter-Id: unknown
>> >Arrival-Date: Sat Jul 17 13:30:01 EDT 1999
>> >Last-Modified:
>> >Originator: sascha@schumann.cx
>> >Organization:
>> net
>> >Release: 2.1.1
>> >Environment:
>> Alpha, egcs 1.1.2, Linux 2.2.10
>> >Description:
>> The following program segfaults on Alpha, but not on x86. We eventually hit
>> this particular bug in one program on x86, but I'm not able to produce a short
>> test program which works on that platform.
>>
>> $ gdb fd
>> GNU gdb 4.17.0.11 with Linux support
>> ...
>>
>> (gdb) r
>> Starting program: /home/sas/fd
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x20000183000 in _IO_new_fclose ()
>> (gdb) bt
>> #0 0x20000183000 in _IO_new_fclose ()
>> #1 0x120000580 in main () at fd.c:14
>> #2 0x2000014f990 in __libc_start_main ()
>>
>> (14 is the fclose statement)
>>
>> >How-To-Repeat:
>> #include <stdio.h>
>> #include <sys/types.h>
>> #include <sys/stat.h>
>> #include <fcntl.h>
>> #include <unistd.h>
>>
>> main() {
>> int f;
>> FILE *f2;
>>
>> f = open("/dev/stdin", O_RDONLY);
>> f2 = fdopen(f, "r");
>> fclose(f2);
>> close(f);
>> }%0
HJ> I tried this program on my alpha box with glibc 2.1.1 and egcs
HJ> 1.1.2. It works just fine. If you can tell me how to reproduce
HJ> it on my alpha. I will look into it.
Read all emails, please. That program is just fine. Sascha didn't
provide a test program (he only offered the source but didn't ask for
them;-) to reproduce the bug.
Andreas
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de