-
Notifications
You must be signed in to change notification settings - Fork 149
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
Modify vector's size instead of capacity to avoid bounds-checking failures #1630
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would appear that this pull request is based on a previous version. Specifically, line 572 was added to XrdMacaroonsHandler.cc and should have appeared as
macaroon_resp.push_back((char)0);
and does not appear in this pull request. Could you rebase your branch to the latest master and resubmit the pull request?
@simpsonst : thanks a lot for your PR! My understanding is that those 3 commits are yours: Set vector's logical size to avoid bounds-checking failure. Now, we need to rework the PR so it contains only those 3 commits, unfortunately in the current form we cannot merge it because it pollutes the history, which in turn makes it very difficult to cut bugfix releases. What I would suggest is that you either:
Let me know if you need any help! |
Thanks @simonmichal, I figured I might have butchered it.
That's produced a conflict on
...and used the default commit message. I presume the next step is to push my local
But please advise! |
@simpsonst : I think you first need to replace the local version of
|
3d71783
to
5ea2004
Compare
Done(?)! Thanks. |
Perfect, thanks a lot! I think it can be merged now :-) |
There are three commits, each to a distinct file. All involve using
vector::resize
instead ofreserve
, andvector::size
instead ofcapacity
, and the unmodified code produces a bounds-checking assertion failure invector::operator[]
when compiled with-D_GLIBCXX_ASSERTIONS
. A smoke test was applied to the first two commits to verify that they eliminate a problem.The first (in
XrdMacaroonsHandler.cc
) specifically fixes #1614. Although already closed, I think this change would be more readable.The second (in
XrdTpcStream.hh
) is in code that was not engaged/discovered during the smoke test until the first was fixed.The third (in
XrdThrottleManager.cc
) was found just by a scan of the code, and is not engaged by our configuration. However, addingxrootd.fslib throttle default
does engage it, and causes the assertion failure as soon as the process starts up without the fix.