This is a followup to #8105.
More trivial changes merged into one PR.
This is a followup to #8105.
More trivial changes merged into one PR.
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) This is achieved easily when there is only one commit.
Squashed.
Please review.
12 | @@ -13,7 +13,7 @@ class reverse_lock 13 | { 14 | public: 15 | 16 | - explicit reverse_lock(Lock& lock) : lock(lock) { 17 | + explicit reverse_lock(Lock& _lock) : lock(_lock) {
I think this patch changes the binaries.
Interesting. I do not see why it should change binaries, but will investigate.
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.
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.
OK then, going to add squashme commit fixing this.
Can you also squash it? Otherwise no one can start review to check if the binaries are the same.
Why you can't start to check if it is not squashed? I do not understand...
Having the squashme commit clearly marked enables us to discuss the change needed.
And if you need all-in-one diff, you can use https://patch-diff.githubusercontent.com/raw/bitcoin/bitcoin/pull/8655.diff
In this particular case, the requirement for same-binary makes the diff longer than needed. But I agree that in this case, it is better to have the same binary just to be sure.
Well, I don't want to redo the check a third time when you squash.
I understand this ;-)
@laanwj Can ask you to do your different-binary-function analysis on this PR? Or better: can you publish your tool? ;-)
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.
pagelocker going to be removed in #8753...
Squashed.
Two functions differ:
LockedPageManagerBase<MemoryPageLocker>::LockedPageManagerBase(unsigned long)
TorController::TorController(event_base*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
From a quick look at the assembly differences it looks like the same problem as before.
The first one is clear (page_size in the body to _page_size). The second one target -> _target.
Both are stupid to be done IMO 8)
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 bitcoind binaries for 2f71490 and 4731cab but don't see any function-level differences, will investigate further.
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. (building without assertions would get identical binaries though, that's probably what @MarcoFalke did) I can also confirm binaries are identical w/out assertions.
ACK https://github.com/bitcoin/bitcoin/pull/8655/commits/4731cab8fbff51a8178c85d572e2482040278616
Huh, I did not disable assertions. Just building as usual and making sure that the clientversion does not influence the binaries. Then calling objdump -d and diff the output.
Then calling objdump -d and diff the output.
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.