Feels like it might have something to do with sockets... The error is at line 47 of threadm.t. The file handle GEN1 just happens to be open and at line 1 or 835...
It's most likely in one of the modules that are used or required. Try to grep some of those.