------- Comment #21 from jvdelisle at gcc dot gnu dot org 2008-02-08 03:14 ------- The problem manifests with:
$ gfc -v Using built-in specs. Target: i686-pc-cygwin Configured with: ../gcc43/configure --prefix=/usr/local/gfortran --enable-languages=c,fortran --disable-bootstrap --enable-threads=posix --enable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-nls --disable-libmudflap --disable-shared --disable-win32-registry --with-system-zlib --enable-checking=release --enable-werror --without-included-gettext --without-x --enable-libgomp Thread model: posix gcc version 4.3.0 20080128 (experimental) [trunk revision 131899] (GCC) I removed the mutex_lock code from the relevant sections of libgfortran/io/unit.c for internal units and the handle count growth goes away. This confirms the problem. I am still working the solution and have two approaches. One is to modify the mutex_unlock to delete the semaphore created and thus release the handle (Danny Smith idea). The other is to keep track of units assigned as internal and not create a new unit structure, but reuse the old. Stay tuned. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35063