[Gc] I/O issues

Nicolas Cannasse ncannasse at motion-twin.com
Fri Sep 19 03:52:07 PDT 2008


>>> In some rare cases, two of our threads get blocked in a I/O function 
>>> (either recv() , fread() , or __read_nocancel()). The two threads are 
>>> usually unrelated - one can be a MYSQL response beeing read while the 
>>> other is reading a file - but they get blocked at the same time. 
>>> Seems like a deadlock to me.
>>
>> Ok, we were able to locate the problem :
>>
>> It seems that using close() in a finalizer results in breaking the 
>> file descriptor table, and might actually close a fd that is still in 
>> use somewhere else - sometimes inside a read() - causing havoc in our 
>> application.

FYI, we located and fix the problem, which was not related to GC itself. 
It was a close() on the stdin that was not setting the fd to -1, and at 
finalization time another close() would close a random fd instead.

Best,
Nicolas


More information about the Gc mailing list