[PATCH] Fix libgfortran ftell/fgetc/fputs/ttynam

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Nov 26 21:40:00 GMT 2005


On Sat, Nov 26, 2005 at 04:20:15PM -0500, Jakub Jelinek wrote:
> Hi!
> 
> On Sat, Nov 26, 2005 at 02:12:49PM -0500, Jack Howarth wrote:
> > (gdb) bt
> > #0  0x9002b8a8 in semaphore_wait_signal_trap ()
> > #1  0x900019cc in pthread_mutex_lock ()
> > #2  0x0024297c in find_unit_1 (n=10, do_create=1) at ../../../gcc-4.1-20051125/libgfortran/../gcc/gthr-posix.h:521
> > #3  0x002417d8 in data_transfer_init (dtp=0xbffff2cc, read_flag=3843) at ../../../gcc-4.1-20051125/libgfortran/io/transfer.c:1203
> > #4  0x00002b7c in MAIN__ () at ftell_1.f90:7
> > #5  0x00002c24 in main (argc=14, argv=0xf03) at ../../../gcc-4.1-20051125/libgfortran/fmain.c:18
> > (gdb) 
> 
> Oops, sorry.  While I ran LD_PRELOAD=libpthread.so.0 make check-gfortran
> back in mid October when I wrote the initial version of the patch, I forgot
> to run it again now and apparently there were 5 find_unit calls added
> in the mean time.  Since my patch all find_unit calls if it returned
> non-NULL need a matching unlock_unit call after the caller is done with the
> unit, the following patch adds that.  Tested with
> LD_PRELOAD=libpthread.so.0 make check-gfortran on x86_64-linux
> (where I managed to reproduce the fgetc_1.f90 etc. failures without
> this patch).
> Ok for HEAD/4.1?
> 

I would prefer to have Jack test the patch, but I've
through it and it looks correct to me.   If Jack doesn't
respond in the nest 24 hours, go ahead an commit.  If
he responses with a positive result before then, please
commit.  If stevenb or pbrook approves the patch now,
well then ... commit.

-- 
Steve



More information about the Fortran mailing list