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

XrdClUtils :: RHEL7 build fails "attribute warn_unused_result [-Werror=unused-result]" #606

Closed
zvada opened this issue Oct 20, 2017 · 23 comments

Comments

@zvada
Copy link

zvada commented Oct 20, 2017

Build of xrootd-4.7.1-rc2 for RHEL7 platform in koji fails on declared with attribute warn_unused_result [-Werror=unused-result] -- a warning that gets turned into an error:

/builddir/build/BUILD/xrootd-4.7.1-rc2/src/./XrdCl/XrdClUtils.hh:282:31: error: ignoring return value of 'int setfsuid(__uid_t)', declared with attribute warn_unused_result [-Werror=unused-result]
           setfsuid(pPrevFsUid);
                               ^
[ 53%] /builddir/build/BUILD/xrootd-4.7.1-rc2/src/./XrdCl/XrdClUtils.hh:286:31: error: ignoring return value of 'int setfsgid(__gid_t)', declared with attribute warn_unused_result [-Werror=unused-result]
           setfsgid(pPrevFsGid);
                               ^

Bit of googling suggested workaround using cast to (void) to ignore it but including such patch doesn't help either and I see same build error:

/builddir/build/BUILD/xrootd-4.7.1-rc2/src/./XrdCl/XrdClUtils.hh:282:38: error: ignoring return value of 'int setfsuid(__uid_t)', declared with attribute warn_unused_result [-Werror=unused-result]
           (void) setfsuid(pPrevFsUid);
                                      ^
/builddir/build/BUILD/xrootd-4.7.1-rc2/src/./XrdCl/XrdClUtils.hh:286:38: error: ignoring return value of 'int setfsgid(__gid_t)', declared with attribute warn_unused_result [-Werror=unused-result]
           (void) setfsgid(pPrevFsGid);
                                      ^

Full build.log you can find here.

Build for RHEL6 works just fine.

Thanks,
Marian

@ljanyst
Copy link
Contributor

ljanyst commented Oct 20, 2017

Certain distributions of glibc seem to use __attribute__((warn_unused_result)) more aggressively than others. Function calls declared this way are not voidable. The rationale is here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509

@gbitzes
Copy link
Contributor

gbitzes commented Oct 23, 2017

Hello,

I'm not able to reproduce this issue, the build succeeds for me on RHEL 7. Instead of (void) setfsuid(pPrevFsUid);, could you try something like the following?

// ignore return value
if(setfsuid(pPrevFsUid)) { }

If this works for you, we can merge it.

@simonmichal
Copy link
Contributor

I cannot reproduce it either (and we build with mock for all slc and fedora platforms, and with koji for slc 6 and 7). Is there anything specific about your koji build?

I wouldn't dwell on it too much, @gbitzes : could you simply add a log message (dump) in the destructor saying that the uid has been changed from x to y?

@gbitzes
Copy link
Contributor

gbitzes commented Oct 23, 2017

@simonmichal : Done, I added a commit to the existing pull request.

@simonmichal
Copy link
Contributor

@zvada : could you try #605 ?

@zvada
Copy link
Author

zvada commented Oct 23, 2017

@simonmichal: which commit try out then? 08d4646 or cd33790?

@zvada
Copy link
Author

zvada commented Oct 23, 2017

Oh, per your comment about "log message (dump)" to @gbitzes I think this one should be tested cd33790. Or all files updated here need a test? Going to try out.

@simonmichal
Copy link
Contributor

@zvada : actually cd33790 should fix your build problem, but you will also need 08d4646 to avoid ugly merge ;-)

@zvada
Copy link
Author

zvada commented Oct 23, 2017

I've put both commits into one patch - see this gist. And, scratch build for el7 passed now without an error!!!

Thanks,
Marian

@simonmichal
Copy link
Contributor

Looks good :-)

Can we close this one, as the build failure has been addressed?

Michal

@zvada
Copy link
Author

zvada commented Oct 24, 2017

Yep, we can close. Do we get rc3 soon or all will go to official release cut soon? We have OSG development freeze on Monday, Oct 30. Would be great we can make non-RC release into the OSG schedule. Is it possible?

@simonmichal
Copy link
Contributor

If this is the only issue with RC2 (and so far it is) then there's no need for RC3, I already ported those 2 commits to stable-4.7.x, by the end of the week, I'll cut the release.

@zvada
Copy link
Author

zvada commented Oct 24, 2017

We haven't had chance test it fully yet due block by build error but we are installing it now and should confirm whether all is good or not within a couple of days. Thanks!

@simonmichal
Copy link
Contributor

OK, I'm waiting for a green light from you to do the release ;-)
I suppose we have time until Monday morning, if I do the release on Monday morning this would be enough for you due to the time difference, right?

@zvada
Copy link
Author

zvada commented Oct 27, 2017

Hi @simonmichal,

I believe I can confirm that issues addressed are gone after deploying rc2 in question. We've tested this on our StashCache instances at Nebraska and UChicago and also https+segfault issues for CMS@Florida didn't reappear (yet). :)

Please, do the release!

Thanks,
Marian

PS: Just a reminder include in the release also XrdUtils patch for the flawless SL7 build, please.

@xrootd-dev
Copy link

xrootd-dev commented Oct 27, 2017 via email

@zvada
Copy link
Author

zvada commented Oct 30, 2017

Hi Andy,

you mentioned in the other email thread you already have bug fix for it. Could this get into testing of yet another RC or are you guys considering make it available in official cut and when if so?

I'd like to see whether we can still push this into OSG release or not within few days. Even there is freeze scheduled for Oct 30th at OSG we could push this back a bit if we know what's your plan -- OSG definitely won't accept RC in the production release, however.

Thanks,
Marian

@xrootd-dev
Copy link

xrootd-dev commented Oct 30, 2017 via email

@simonmichal
Copy link
Contributor

Hi Marian,

I just created RC3, it's under testing now, We'll approximately need 1-2 days to test it.
So if everything is fine, I could do the release on Wednesday morning (Andy is confident
about his patch).

Is this OK for you?

Cheers,
Michal

@zvada
Copy link
Author

zvada commented Oct 30, 2017

Yes, that sounds good! I'll ask to make special on-hold in the OSG release process and wait till Wednesday for latest non-RC of xrootd. Crossing fingers that all tests go well. We may also try put RC3 in some of our tests in US, let's see.

Thanks,
Marian

@zvada
Copy link
Author

zvada commented Nov 2, 2017

@abh3, @simonmichal: assuming "XRootD 4.7.1 bugfix release" announced yesterday includes latest patches not previously tested in RC3 we did build from the final tag v4.7.1 for the coming OSG release as well. Just wanted to make sure this was the right course of action and things should be aligned with all recent code changes. Thanks.

@simonmichal
Copy link
Contributor

@zvada : yes that's the right thing to do :-)
Just for the record, 4.7.1 includes just one patch that was not tested in RC3: 3c78db5
(which I tested in my testbed)

@zvada
Copy link
Author

zvada commented Nov 2, 2017

Perfect, that's what I thought. So we have built in OSG as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants