Hi Mark,

I was doing some digging and found ( I think ) the section with a static buffer 
defined.
The section is in the shepherd code for the builtin_starter.c and it looks like 
the correct place...

code snippet:

/****** Shepherd/sge_set_environment() *****************************************
* NAME
* sge_set_environment () -- Read the environment from the "environment" file
* and store it in the appropriate environment, inherited or internal.
*
* SYNOPSIS
* int sge_set_environment(bool user_env)
*
* FUNCTION
* This function sets the internal environment (if INHERIT_ENV is set
* in execd_params). Optionally it reads the "environment" file
* written out by the execd and stores each entry in the environment.
*
* INPUTS
* bool user_env - True means set variables from the user's environment,
* false means just include the SGE_... variables
*
* RESULTS
* int - error code: 0: good, 1: bad
*
* NOTES
* MT-NOTE: sge_set_environment() is not MT safe
*******************************************************************************/
int sge_set_environment(bool user_env)
{
 const char *const filename = "environment";
 FILE *fp;
 char buf[10000], *name, *value, err_str[10000];
 int line=0;
...

while (fgets(buf, sizeof(buf), fp)) {
...

linux fgets:
fgets() reads in at most one less than size characters from stream 
and stores them into the buffer pointed to by s. Reading stops after 
an EOF or a newline. If a newline is read, it is stored into the buffer. 
A terminating null byte (aq\0aq) is stored after the last character in the 
buffer.

So, with this builtin starter method, the max variable size is set to 10000 
chars....

The use of a static buffer in this case can be problematic. I will verify that 
this is the section that is causing the
issues. If it is, I'll look into the proper way to patch this issue and submit 
for review.

Thanks,

Ed


-----Original Message-----
From: Mark Dixon [mailto:[email protected]]
Sent: Friday, August 9, 2013 04:18 AM
To: 'Ed Lauzier'
Cc: [email protected], [email protected]
Subject: Re: [SGE-discuss] [gridengine users] variable getting truncated in 
soge8.1.3 and OGS   2011.11p1

On Thu, 8 Aug 2013, Ed Lauzier wrote:
> Found this reference url from Dan T's blog site.....
> 
> https://blogs.oracle.com/templedf/entry/using_debugging_output
> 
> Will give it a go once I have spare cycles.....
> 
> -Ed
Hi Ed,You might also find this useful:
http://gridengine.org/pipermail/users/2013-February/005556.html
Mark-- 
-----------------------------------------------------------------
Mark Dixon 
 Email : [email protected]
HPC/Grid Systems Support 
 Tel (int): 35429Information Systems Services 
 Tel (ext): +44(0)113 343 5429
University of Leeds, LS2 9JT, UK
-----------------------------------------------------------------
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to