Hi David,

I went through this code and it's unlikely that the code below is the
culprit (though I agree it could have been better written). The reason
is that
a) The MonBurr buffer is never smaller than 2K.
b) The maximum size of anything we can ever put in the buffer is 1290:
8 (header) + 256 (hostname) + 1 (colon) + 1024 (path) + 1 (null byte)
c) The code verifies that there is enough buffer space left to accomodate
whatever size was computed and lengths are always tuncated if they exceed
the maximum units and the buffer is flushed and re-initialized if there is
insufficient space.

Admitedly, using strcpy() as opposed to strncpy() does not take into
account that the hostname may have been truncated to 256 (I will fix
that). However, unless the hostname was not null terminated it would never
be greater than 255 (the DNS maximum). If the hostname was not null
terminated then we should have seen crashes all over the place right off
the bat.

If you have a core file handy, please make it available along with the
Linux version it was generated on and the xroot release number
(presumably 3.3.3 in all cases). The more core files the better as
seeing an overlay pattern would help. My suspicion is that the object
which was in the runq was deleted without first being removed from the
runq. That's a more likely scenario at this point. Do you know what the
scheduler was trying to run?

Andy

On Thu, 5 Dec 2013, smithdh wrote:

> Hi,
>
> Some dpm-xrootd sites have reported crashes of their redirector xrootd 3.3.3 daemon (seen once at one SL5 site, and frequently at one SL6 site). (core dumps available, generally they are crashes in XrdScheduler methods because of corrupt XrdJob objects).
>
> I've done some investigation, initially to check if the dpm/dmlite components were at fault. In this case I think there is a problem in XrdXrootdMonitor::Redirect. This copy:
>
> [XrdXrootdMonitor.cc:788]
> strcpy(dest, hName); dest += hLen; *dest++ = ':';
>
> can overwrite past the end of the space allocated for the MonRdrBuff, e.g. if hName is somewhat more than 256 characters longer than Path and the starting point for the entry is close enough to the end of the buffer. I think this condition is now avoided in the master branch, after ipv6 related changes. Would it be cover this situation in 3.3.x ?
>
> Thanks,
> David
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/xrootd/xrootd/issues/64


Reply to this email directly or view it on GitHub.



Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1