[patch, fortran, gcc] PR35063 [Regression wrt g77] I/O leaks handles/memory on Windows XP

Jerry DeLisle jvdelisle@verizon.net
Fri Feb 8 23:44:00 GMT 2008


Hi all,

This patch fixes this bug.  Danny Smith provided the portion that added the 
needed CloseHandle to destroy the mutex properly.  I developed the portion in 
unit.c that uses this, with his suggestions.

Regression tested on x86-64, tested on Cygwin that it fixes both cases in 
comments 1 and 7.  Test likewise by Mikko on mingw.

I think this should get into 4.3.

Ok to commit?  I need a gcc maintainer to approve as well.

Regards,

Jerry

2008-02-08  Danny Smith  <dannysmith@users.sourceforge.net>

	PR gcc/35063
	* gthr-win32.h (__gthread_mutex_destroy_function): New function
	to CloseHandle after unlocking to prevent accumulation of handle
	count.

2008-02-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
	PR libfortran/35063
	* io/unit.c (destroy_unit_mutex): New function that uses
	__gthread_mutex_destroy_function or pthread_mutex_destroy after
	unlocking and before free_mem for final closure of I/O unit.
	(delete_root): Use new function.
	(free_internal_unit): Likewise.
	(close_unit_1): Likewise.



More information about the Fortran mailing list