------- Comment #11 from jpr at csc dot fi  2008-02-06 20:54 -------
Subject: Re:  I/O leaks handles/memory on Windows XP


I had a look: the problem seems to be with the logic of  mutex->counter in
gcc/config/i386/gthr-win32.c. Libgfortran makes the  following calls 
during an internal write

1) __gthr_win32_mutex_init_function()
   - sets counter=-1
   - creates a semaphore (the windows handle!)

2)__gthr_win32_mutex_lock()
    - increments counter (now 0)

3) __gthr_win32_mutex_unlock()
   - decrements counter (now -1 again)
   - would release the semaphore, if counter >= 0 but doesn't...!

not a libfortran bug after all(?)


>
>
> ------- Comment #10 from Jerry_V_DeLisle at rl dot gov  2008-02-06 20:25 
> -------
> Reply to comment #9:
>
> This is a very important observation.  I have checked the code and we have 
> code
> that free's the internal unit (free_internal_unit) and I have confirmed that 
> it
> is called correctly after every write.
>
> My current thinking now is that we are not locking/unlocking the unit 
> correctly
> and maybe it is this lock that is leaving behind a windows handle.  Stay 
> tuned,
> and thanks for reporting this observation.
>
>
> -- 
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35063
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35063

Reply via email to