[socket]: dup missing - which causes running out of file descriptors
|Reported by:||emitrax||Owned by:||axeld|
|Component:||Network & Internet/Stack||Version:||R1/pre-alpha1|
After running for a few minutes a simple multi threading application of mine, which basically open a tcp socket, dup it, pass it to a thread and then close it, I ran out of file descriptors. Too many open files is the error I get.
I looked at the code, and I found that normal calls that are made on file descriptors, like sockets are on Unix systems, are forwarded to the net module, which does not implement any dup function, which can be legally call on a socket in unix. So in my case, what happens is that the kernel dup the file descriptor, but never close it because the close on the same fd is forwared to the ipv4 module.