HTCondor Project List Archives



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Condor-devel] Windows users using batch files with long arguments pre 6.8 triggers crash



In case anyone else comes up against the same issue on an older system

Using arguments greater than about 255 characters for .bat or .cmd
files from windows will crash the starter due to a buffer overrun.
There is no short term solution apart from putting the arguments into
the environment and reading them out in the batch file.

the bug is in VanillaProc::StartJob() but is fixed in 6.8.0 and I
assume referred to by the

char tmp[_POSIX_PATH_MAX];
...
sprintf ( tmp, "%s=\"/Q /C condor_exec.bat %s\"", ATTR_JOB_ARGUMENTS,
job_args );

"Fixed a number of potential static buffer overflows in various Condor
daemons and libraries."

comment in the version history.

Took me a while to track it down as there is very little info on what
is happening even with D_FULLDEBUG so thought I would pass this along
to anyone else who uses windows and might encounter this if there
users start pushing the limits.

I did not take the time to check much deeper but note that if
_POSIX_PATH_MAX is not being defined by something I can't see (the
limits.h or such like) then the value of 4096 is incorrect from
windows XP onwards since you can use 32K worth of arguments.

On windows 2000 it is actually worse, being MAX_PATH (255 IIRC) rather
than 4096.

What version of windows do you compile condor on for release these days?

Matt