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

Use anonymous namespaces to avoid duplicate symbols #11066

Merged
merged 1 commit into from
Sep 2, 2015

Conversation

wmtan
Copy link
Contributor

@wmtan wmtan commented Sep 1, 2015

Bug fix. Totally technical.
Can be backported to 7_5_X if requested.
In RecoEgamma/EgammaTools/plugins, there are free function templates in different files that have the same signature. These are violations of the ODR (one definition rule).
The reason this problem has not yet been seen before is that the function templates in question are declared "inline". However, "inline" is only a suggestion to the compiler. When compiled in debug mode (-O0), in-lining was apparently turned off. This did not cause a link error, as function templates are not instantiated until run time. However, it caused the wrong function to be called in several cases, causing relvals 4.53, 135.4, and 1330.0 to fail.
The fix is to put the templates inside an anonymous namespace, so each template is not seen outside the compilation unit. This fixes the failing relvals.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2015

A new Pull Request was created by @wmtan for CMSSW_7_6_X.

Use anonymous namespaces to avoid duplicate symbols

It involves the following packages:

RecoEgamma/EgammaTools

@cmsbuild, @cvuosalo, @slava77 can you please review it and eventually sign? Thanks.
@Sam-Harper, @lgray this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.
@Degano you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@Dr15Jones
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2015

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2015

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2015

@slava77
Copy link
Contributor

slava77 commented Sep 1, 2015

@wmtan we will need it for 75X and 74X

@slava77
Copy link
Contributor

slava77 commented Sep 1, 2015

+1

for #11066 d5f3cb5

  • code changes are as expected
  • jenkins tests pass and comparisons with the baseline show no relevant differences (PU JetID differences showing up in DQM are unrelated and I'm still investigating them)

@wmtan
Copy link
Contributor Author

wmtan commented Sep 1, 2015

@slava77 OK, I will do PRs for this in 7_5_X and 7_4_X.

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 1, 2015

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_6_X IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@slava77
Copy link
Contributor

slava77 commented Sep 1, 2015

On 9/1/15 5:06 PM, wmtan wrote:

@slava77 https://github.com/slava77 OK, I will do PRs for this in
7_5_X and 7_4_X.

Thank you, Bill

For 74X, please check if it merges against #10649
... some of the files are still only in #10649, which is supposed to
become "good to merge"
some time this week.
So, the backport from you may need to be picked up by Giovanni in that
large PR
or put on hold.


Reply to this email directly or view it on GitHub
#11066 (comment).

@wmtan
Copy link
Contributor Author

wmtan commented Sep 1, 2015

@slava77 The easiest thing to do is to hold up on the backport of this to 7_4_X until after #10649 is merged.

@davidlange6
Copy link
Contributor

+1

cmsbuild added a commit that referenced this pull request Sep 2, 2015
Use anonymous namespaces to avoid duplicate symbols
@cmsbuild cmsbuild merged commit 5ec3e31 into cms-sw:CMSSW_7_6_X Sep 2, 2015
@wmtan wmtan deleted the UseNamespace branch September 14, 2015 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants