This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [Various] libc/1208: segfault in fclose on fdopen'ed FILE pointer


> 
> >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

I tried this program on my alpha box with glibc 2.1.1 and egcs
1.1.2. It works just fine. If you can tell me how to reproduce
it on my alpha. I will look into it.


H.J.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]