-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Do not shadow variables (trivials) #8655
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
Conversation
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits Also, I was wondering how much is left until we can enable Wshadow |
I can squash when the review is finished, no problem. I think it is much easier reviewing separately. |
@paveljanik The diff is just 20 lines and I think trying to compile before/after and compare the objdump is sufficient to review. (Maybe skim over the diff once) |
a023a05
to
d3eff19
Compare
Squashed. |
Please review. |
@@ -13,7 +13,7 @@ class reverse_lock | |||
{ | |||
public: | |||
|
|||
explicit reverse_lock(Lock& lock) : lock(lock) { | |||
explicit reverse_lock(Lock& _lock) : lock(_lock) { |
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.
I think this patch changes the binaries.
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.
Interesting. I do not see why it should change binaries, but will investigate.
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.
Wladimir investigated in #8793. It changes the binaries.
Technically it can be done by changing lock
to _lock
in the body of the function. But we decided that it is wrong to do that.
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.
Well in the case of the GUI that was the decision, as an exception.
As I said there, for the consensus code I would require the binaries to be the same. This is much closer to that.
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.
OK then, going to add squashme commit fixing this.
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.
Well, I don't want to redo the check a third time when you squash.
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.
I understand this ;-)
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.
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.
@laanwj Can ask you to do your different-binary-function analysis on this PR? Or better: can you publish your tool? ;-)
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.
I'll take a look. Aand maybe release the script, though it's a Chthonic monstriosity with tentacles spreading to other unpublished tools, so I have to figure out what to collect along the way.
|
93dd3c7
to
ca6bf63
Compare
89df412
to
a413d9d
Compare
Squashed. |
Two functions differ:
From a quick look at the assembly differences it looks like the same problem as before. |
The first one is clear ( |
a413d9d
to
4731cab
Compare
But done... And squashed. The diff is a bit longer now. |
Identical binaries ACK 4731cab |
@MarcoFalke What tool are you using to generate the identical binary results? |
I've put up my script here: https://github.com/laanwj/bitcoin-maintainer-tools BTW: I don't get identical |
OK, found the reason: -2f71490.o/src/support/libbitcoin_util_a-pagelocker.o: file format elf64-x86-64
+4731cab.o/src/support/libbitcoin_util_a-pagelocker.o: file format elf64-x86-64
Contents of section .group:
0000 01000000 57000000 ....W...
@@ -314,9 +314,9 @@
0000 626f6f73 743a3a20 6d757465 7820636f boost:: mutex co
0010 6e737472 7563746f 72206661 696c6564 nstructor failed
0020 20696e20 70746872 6561645f 6d757465 in pthread_mute
- 0030 785f696e 69740000 21287061 67655f73 x_init..!(page_s
- 0040 697a6520 26202870 6167655f 73697a65 ize & (page_size
- 0050 202d2031 292900 - 1)).
+ 0030 785f696e 69740000 21285f70 6167655f x_init..!(_page_
+ 0040 73697a65 20262028 5f706167 655f7369 size & (_page_si
+ 0050 7a65202d 20312929 00 ze - 1)). This is a string emitted by an assertion. You're never going to get this right. ACK 4731cab |
4731cab Do not shadow variables (Pavel Janík)
Huh, I did not disable assertions. Just building as usual and making sure that the clientversion does not influence the binaries. Then calling |
Ok, that explains it, because that doesn't detect changes in data sections. I always diff the assembly as well as comparing sha256sums of the stripped executables just in case. |
4731cab Do not shadow variables (Pavel Janík)
4731cab Do not shadow variables (Pavel Janík)
Backport bloom filter improvements Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7113 - bitcoin/bitcoin#7818 - Only the second commit (to resolve conflicts). - bitcoin/bitcoin#7934 - bitcoin/bitcoin#8655 - Partial backport to help resolve conflicts. - bitcoin/bitcoin#9060 - bitcoin/bitcoin#9223 - bitcoin/bitcoin#9644 - Partial backport to help resolve conflicts. - bitcoin/bitcoin#9916 - bitcoin/bitcoin#9750 - bitcoin/bitcoin#13176 - bitcoin/bitcoin#13948 - bitcoin/bitcoin#16073 - bitcoin/bitcoin#18670 - bitcoin/bitcoin#18806 - Reveals upstream's covert fix for CVE-2013-5700. - bitcoin/bitcoin#19968
Backport bloom filter improvements Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#7113 - bitcoin/bitcoin#7818 - Only the second commit (to resolve conflicts). - bitcoin/bitcoin#7934 - bitcoin/bitcoin#8655 - Partial backport to help resolve conflicts. - bitcoin/bitcoin#9060 - bitcoin/bitcoin#9223 - bitcoin/bitcoin#9644 - Partial backport to help resolve conflicts. - bitcoin/bitcoin#9916 - bitcoin/bitcoin#9750 - bitcoin/bitcoin#13176 - bitcoin/bitcoin#13948 - bitcoin/bitcoin#16073 - bitcoin/bitcoin#18670 - bitcoin/bitcoin#18806 - Reveals upstream's covert fix for CVE-2013-5700. - bitcoin/bitcoin#19968
This is a followup to #8105.
More trivial changes merged into one PR.