Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-ASCII char in xroot error message #1501

Closed
belforte opened this issue Sep 1, 2021 · 3 comments
Closed

non-ASCII char in xroot error message #1501

belforte opened this issue Sep 1, 2021 · 3 comments
Assignees
Milestone

Comments

@belforte
Copy link

belforte commented Sep 1, 2021

looks like recent xroot (4.12.3-llifpc2) insert (at least at times) a non ASCII character at the end of an error message, see screenshot below.
This breaks current code which reports and parse those messages.
Can it be avoided ?
While I only have an example from using CMS code , @makortel says that in this case it just prints xrootd message "as is"
Screenshot from 2021-08-31 17-48-12
Of course we can filter for non-ASCII on our side, but @klannon suggested to report this to you as well for a proper resolution. In this I am the current maintainer of a tool which relies on CMS framework reports, so am 2 software layers (CMSSW and CMS/WMCore) away from xroot, simply acting as messenger here, but I doubt I can be of further help.
Thanks

@simonmichal
Copy link
Contributor

@belforte : thank you for reporting this issue and sorry for replaying with such a delay!

Could you you test with the latest release, I believe this should have been fixed in: 22d308a

@belforte
Copy link
Author

thanks @simonmichal . Unfortunately I am stuck with what version of xroot is built with CMSSW. But this should be easy to check on your side, just try to open a non-existing file. In any case I believe you can close.

@amadio
Copy link
Member

amadio commented Dec 1, 2022

Commit 22d308a likely fixes this, but it looks like commit a20fe39 could have introduced a potential off by one error. The function where the message comes from is below.

https://github.com/xrootd/xrootd/blob/v5.5.1/src/XrdCms/XrdCmsCluster.cc#L2031-L2045

If n could be off by one here, it could cause an extra '\0' character to be shown in the output due to Sel.Resp.Data containing two NUL characters at the end instead of just one. More specifically, in line 2040 if n is less than the size of the buffer, it's incremented by one, which adds the extra NUL character (note the +1 that should already account for it the line above).

@amadio amadio self-assigned this Jan 30, 2023
@amadio amadio added this to the 5.5.3 milestone Feb 13, 2023
amadio added a commit to amadio/xrootd that referenced this issue Feb 13, 2023
amadio added a commit to amadio/xrootd that referenced this issue Feb 13, 2023
amadio added a commit to amadio/xrootd that referenced this issue Feb 14, 2023
@amadio amadio closed this as completed in 9987b4b Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants