I think there's a descriptor leak in Unix.close_process_full and possibly other close_process* functions. If there's an error in closing one of the descriptors, I think the correct behavior would be to close the rest nevertheless before throwing a Unix_error exception. I think this can happen in some conditions (SIGPIPE?) even without having explicitly closed some of the descriptors. Now I have a situation where a mere Unix.close_process_full will result in a descriptor leak but explicitly trying to close them one by one will not. Sami