Program started by PBSPro fails to open a network socket

Description

Build the following test program:

Build with
cl testsock.c ws2_32.lib

Prepare the following do_qsub.bat file:

replacing C:\abspath\to with the correct path to the testsock.exe binary.

Now run this command in a shell:
qsub -S C:\WINDOWS\System32\cmd.exe -o do_qsub.out -e do_qsub.err do_qsub.bat

type do_qsub.err shows:
s == INVALID_SOCKET, WSAGetLastError() = 10106

Uncommenting the
set SystemRoot=C:\WINDOWS
line in do_qsub.bat the program runs successfully.
type do_qsub.err shows:
s == 312
Please note that the number above may change.

The reason of the failure (WSAEPROVIDERFAILEDINIT) is that the environment created by PBSPro is missing the SystemRoot variable.

Acceptance Criteria

None

Status

Assignee

Hiren Vadalia

Reporter

Paolo Tosco

Severity

None

OS

None

Start Date

None

Pull Request URL

None

Story Points

1

Components

Fix versions

Affects versions

Priority

Low
Configure