1 2020-09-24T00:00:02  *** rah1 has quit IRC
  2 2020-09-24T00:02:40  *** kristapsk has quit IRC
  3 2020-09-24T00:03:03  *** kristapsk has joined #bitcoin-core-dev
  4 2020-09-24T00:12:02  *** davterra has quit IRC
  5 2020-09-24T00:12:22  *** pinheadmz has joined #bitcoin-core-dev
  6 2020-09-24T00:13:32  *** pinheadm_ has quit IRC
  7 2020-09-24T00:16:00  *** davterra has joined #bitcoin-core-dev
  8 2020-09-24T00:22:05  *** nirik-fre has joined #bitcoin-core-dev
  9 2020-09-24T00:35:12  *** kristapsk has quit IRC
 10 2020-09-24T00:35:52  *** kristapsk has joined #bitcoin-core-dev
 11 2020-09-24T00:38:34  *** nirik-fre has quit IRC
 12 2020-09-24T00:43:22  *** kristapsk has quit IRC
 13 2020-09-24T00:47:49  *** S3RK has quit IRC
 14 2020-09-24T00:48:01  *** S3RK has joined #bitcoin-core-dev
 15 2020-09-24T00:54:02  *** TheRec has quit IRC
 16 2020-09-24T00:54:45  *** TheRec has joined #bitcoin-core-dev
 17 2020-09-24T00:58:19  *** AaronvanW has joined #bitcoin-core-dev
 18 2020-09-24T01:03:00  *** spinza has quit IRC
 19 2020-09-24T01:03:42  *** spinza has joined #bitcoin-core-dev
 20 2020-09-24T01:28:44  *** AaronvanW has quit IRC
 21 2020-09-24T01:31:08  *** xchg has joined #bitcoin-core-dev
 22 2020-09-24T01:43:18  *** Eagle[TM] has joined #bitcoin-core-dev
 23 2020-09-24T01:44:47  *** EagleTM has quit IRC
 24 2020-09-24T01:48:23  *** Highway61 has quit IRC
 25 2020-09-24T02:21:00  *** Althea-told-me has quit IRC
 26 2020-09-24T02:22:01  <luke-jr> FWIW, I just had a 0.13 wallet go corrupt (so sipa's instance probably wasn't a regression)
 27 2020-09-24T02:29:59  *** tryphe has quit IRC
 28 2020-09-24T02:30:42  *** tryphe has joined #bitcoin-core-dev
 29 2020-09-24T02:32:53  *** meshcollider has joined #bitcoin-core-dev
 30 2020-09-24T02:46:25  <luke-jr> anyone know off-hand what GCC we use in gitian builds? :x
 31 2020-09-24T02:48:45  <sipa> linux builds use bionic, so GCC 7 i believe
 32 2020-09-24T02:49:09  *** andreacab has joined #bitcoin-core-dev
 33 2020-09-24T02:51:19  <luke-jr> sipa: do you happen to know this bug in detail enough, to be able to reasonably tell if we would be affected at all?
 34 2020-09-24T02:53:06  <luke-jr> I suppose the only way to be _sure_ would be to do a before/after build using GCC master and master minus 1
 35 2020-09-24T02:53:29  <sipa> luke-jr: affected, i think yes - in particular the cnetaddr code may incorrectly classify IP addresses
 36 2020-09-24T02:53:52  <sipa> i'll look deeper into whether that is actually an issue
 37 2020-09-24T02:54:17  *** andreacab has quit IRC
 38 2020-09-24T03:00:02  *** xchg has quit IRC
 39 2020-09-24T03:00:48  <luke-jr> it would be funny if compilers turned memcmp(…) > -2 and  memcmp(…) < 2 into a constant 1 <.<
 40 2020-09-24T03:01:43  <sipa> actually, looking at the code in 0.20, and my understanding of the bug, i don't see why it wouldn't make IsIPv4() return true for literally every address
 41 2020-09-24T03:03:05  <sipa> so i'm probably misunderstanding the bug
 42 2020-09-24T03:07:26  <luke-jr> h mm
 43 2020-09-24T03:09:37  <roconnor> Based on my limited experimation it does seem limited to cases where the static array begins with 0.
 44 2020-09-24T03:09:44  <roconnor> Though I don't really understand why.
 45 2020-09-24T03:09:59  <sipa> that happens to be the case for the IsIPv4 code
 46 2020-09-24T03:11:47  <luke-jr> is it constexpr?
 47 2020-09-24T03:12:10  <sipa> it should be
 48 2020-09-24T03:12:35  <luke-jr> FWIW it looks like the fix is a clean apply to 10.2, so I'm doing a before/after build
 49 2020-09-24T03:12:51  <sipa> what fix? to what?
 50 2020-09-24T03:13:06  <luke-jr> https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=d5803b9876b3d11c93d1a10fabb3fbb1c4a14bd6;hp=3e99ed65cbedf7a6c0abb9cd63c191326995fd34
 51 2020-09-24T03:13:29  <sipa> https://github.com/bitcoin/bitcoin/blob/v0.20.1/src/netaddress.cpp#L12 and https://github.com/bitcoin/bitcoin/blob/v0.20.1/src/netaddress.cpp#L127
 52 2020-09-24T03:13:54  <luke-jr> sipa: I'm building Knots with 10.2 and then 10.2 patched with the fix, then comparing to see if anything changed
 53 2020-09-24T03:14:03  <sipa> ah, good idea
 54 2020-09-24T03:14:44  <roconnor> Does IsIPv4 always return true?
 55 2020-09-24T03:15:15  <luke-jr> I guess if it only affects a minority of nodes, it could and we might not notice?
 56 2020-09-24T03:15:57  <sipa> this test should fail: https://github.com/bitcoin/bitcoin/blob/v0.20.1/src/test/netbase_tests.cpp#L53
 57 2020-09-24T03:16:11  <sipa> (is IsIPv6() calls !IsIPv4() && ...)
 58 2020-09-24T03:16:18  <luke-jr> hrm
 59 2020-09-24T03:19:06  <luke-jr> doh, was building with LLVM
 60 2020-09-24T03:19:10  * luke-jr starts over quickly
 61 2020-09-24T03:24:02  *** bitcoin-git has joined #bitcoin-core-dev
 62 2020-09-24T03:24:02  <bitcoin-git> [bitcoin] ajtowns closed pull request #19970: sync.h: fix LockAssertion error reporting (master...202009-lockassertion) https://github.com/bitcoin/bitcoin/pull/19970
 63 2020-09-24T03:24:03  *** bitcoin-git has left #bitcoin-core-dev
 64 2020-09-24T03:26:06  *** AaronvanW has joined #bitcoin-core-dev
 65 2020-09-24T03:30:45  <roconnor> https://github.com/bitcoin/bitcoin/blob/0.20/src/netaddress.cpp#L237 also. ... assuming that IsIPv4 somehow isn't always returning true.
 66 2020-09-24T03:31:03  <roconnor> Though that test file does seem to be run.
 67 2020-09-24T03:47:14  *** sr_gi has quit IRC
 68 2020-09-24T03:47:50  *** sr_gi has joined #bitcoin-core-dev
 69 2020-09-24T03:57:01  *** gholms1 has joined #bitcoin-core-dev
 70 2020-09-24T03:59:49  *** AaronvanW has quit IRC
 71 2020-09-24T04:09:08  *** davec has quit IRC
 72 2020-09-24T04:09:30  *** davec has joined #bitcoin-core-dev
 73 2020-09-24T04:28:35  *** dermoth has quit IRC
 74 2020-09-24T04:30:55  *** dermoth has joined #bitcoin-core-dev
 75 2020-09-24T04:43:55  *** tralfaz has joined #bitcoin-core-dev
 76 2020-09-24T04:47:14  *** davterra has quit IRC
 77 2020-09-24T05:12:41  *** ossifrage_ has joined #bitcoin-core-dev
 78 2020-09-24T05:13:35  *** S3RK has quit IRC
 79 2020-09-24T05:14:03  *** S3RK has joined #bitcoin-core-dev
 80 2020-09-24T05:15:35  *** ossifrage has quit IRC
 81 2020-09-24T05:32:30  *** tralfaz is now known as davterra
 82 2020-09-24T05:34:41  *** MrPaz has quit IRC
 83 2020-09-24T05:56:49  *** AaronvanW has joined #bitcoin-core-dev
 84 2020-09-24T06:00:01  *** gholms1 has quit IRC
 85 2020-09-24T06:11:57  *** jonatack has quit IRC
 86 2020-09-24T06:12:48  *** jonatack has joined #bitcoin-core-dev
 87 2020-09-24T06:21:13  *** sdx23 has joined #bitcoin-core-dev
 88 2020-09-24T06:21:41  *** sdx23 is now known as Guest48547
 89 2020-09-24T06:28:32  *** gloriazhao has quit IRC
 90 2020-09-24T06:29:26  *** AaronvanW has quit IRC
 91 2020-09-24T06:35:38  *** balbirs has quit IRC
 92 2020-09-24T06:35:57  *** balbirs has joined #bitcoin-core-dev
 93 2020-09-24T06:50:50  *** andreacab has joined #bitcoin-core-dev
 94 2020-09-24T06:55:35  *** andreacab has quit IRC
 95 2020-09-24T07:01:16  <kallewoof> sipa: technically it was thursday when you said 'hi' 12 hours ago. it just wasn't thursday in the right place (it was thursday in japan tho)
 96 2020-09-24T07:06:40  *** opsec_x12 has joined #bitcoin-core-dev
 97 2020-09-24T07:07:33  *** sdaftuar has quit IRC
 98 2020-09-24T07:07:59  *** sdaftuar has joined #bitcoin-core-dev
 99 2020-09-24T07:12:26  *** andreacab has joined #bitcoin-core-dev
100 2020-09-24T07:16:07  *** justanotheruser has quit IRC
101 2020-09-24T07:19:48  *** marcoagner has joined #bitcoin-core-dev
102 2020-09-24T07:36:23  *** S3RK has quit IRC
103 2020-09-24T07:36:29  *** S3RK has joined #bitcoin-core-dev
104 2020-09-24T07:39:29  *** andreacab has quit IRC
105 2020-09-24T07:39:55  *** andreacab has joined #bitcoin-core-dev
106 2020-09-24T07:45:37  *** andreacab has quit IRC
107 2020-09-24T07:53:12  *** bitcoin-git has joined #bitcoin-core-dev
108 2020-09-24T07:53:12  <bitcoin-git> [bitcoin] naumenkogs closed pull request #19958: p2p: Better document features of feelers (master...2020-09-rename-feeler-to-probe) https://github.com/bitcoin/bitcoin/pull/19958
109 2020-09-24T07:53:13  *** bitcoin-git has left #bitcoin-core-dev
110 2020-09-24T07:53:32  *** bitcoin-git has joined #bitcoin-core-dev
111 2020-09-24T07:53:32  <bitcoin-git> [bitcoin] naumenkogs reopened pull request #19958: p2p: Better document features of feelers (master...2020-09-rename-feeler-to-probe) https://github.com/bitcoin/bitcoin/pull/19958
112 2020-09-24T07:53:40  *** bitcoin-git has left #bitcoin-core-dev
113 2020-09-24T08:06:41  *** andreacab has joined #bitcoin-core-dev
114 2020-09-24T08:12:37  <sipa> kallewoof: timezones are evil
115 2020-09-24T08:15:36  *** AaronvanW has joined #bitcoin-core-dev
116 2020-09-24T08:21:31  *** sipsorcery has joined #bitcoin-core-dev
117 2020-09-24T08:23:55  *** jonatack has quit IRC
118 2020-09-24T08:36:26  *** Guest48547 has quit IRC
119 2020-09-24T08:41:34  *** bitcoin-git has joined #bitcoin-core-dev
120 2020-09-24T08:41:35  <bitcoin-git> [bitcoin] jnewbery opened pull request #20008: [Backport] #19839 and #19842 to v0.20 (0.20...2020-09-appveyor-backport) https://github.com/bitcoin/bitcoin/pull/20008
121 2020-09-24T08:41:47  *** bitcoin-git has left #bitcoin-core-dev
122 2020-09-24T08:42:04  <jnewbery> wumpus: those appveyor commits fixed my issue. I've opened a PR to just backport those two commits. Thanks for your help!
123 2020-09-24T08:51:00  *** andreacab has quit IRC
124 2020-09-24T08:52:53  *** andreacab has joined #bitcoin-core-dev
125 2020-09-24T08:57:49  *** andreacab has quit IRC
126 2020-09-24T09:02:57  *** jonatack has joined #bitcoin-core-dev
127 2020-09-24T09:04:25  *** kexkey has quit IRC
128 2020-09-24T09:05:05  *** AaronvanW has quit IRC
129 2020-09-24T09:05:31  *** AaronvanW has joined #bitcoin-core-dev
130 2020-09-24T09:08:59  *** andreacab has joined #bitcoin-core-dev
131 2020-09-24T09:09:17  *** jonatack has joined #bitcoin-core-dev
132 2020-09-24T09:19:56  *** davec has quit IRC
133 2020-09-24T09:21:52  *** bshum1 has joined #bitcoin-core-dev
134 2020-09-24T09:34:15  *** sr_gi7 has joined #bitcoin-core-dev
135 2020-09-24T09:34:39  *** sr_gi has quit IRC
136 2020-09-24T09:34:39  *** sr_gi7 is now known as sr_gi
137 2020-09-24T09:35:32  *** andreacab has quit IRC
138 2020-09-24T09:37:45  *** andreacab has joined #bitcoin-core-dev
139 2020-09-24T09:49:27  *** bitcoin-git has joined #bitcoin-core-dev
140 2020-09-24T09:49:27  <bitcoin-git> [bitcoin] naumenkogs closed pull request #19843: Refactoring and minor improvement for self-advertisements (master...2020-08-refactor-advertiselocal) https://github.com/bitcoin/bitcoin/pull/19843
141 2020-09-24T09:49:29  *** bitcoin-git has left #bitcoin-core-dev
142 2020-09-24T09:49:47  *** bitcoin-git has joined #bitcoin-core-dev
143 2020-09-24T09:49:47  <bitcoin-git> [bitcoin] naumenkogs reopened pull request #19843: Refactoring and minor improvement for self-advertisements (master...2020-08-refactor-advertiselocal) https://github.com/bitcoin/bitcoin/pull/19843
144 2020-09-24T09:49:49  *** bitcoin-git has left #bitcoin-core-dev
145 2020-09-24T09:54:46  *** S3RK has quit IRC
146 2020-09-24T09:55:20  *** S3RK has joined #bitcoin-core-dev
147 2020-09-24T09:58:03  *** S3RK has quit IRC
148 2020-09-24T09:58:04  *** justinmoon has quit IRC
149 2020-09-24T09:58:13  *** S3RK has joined #bitcoin-core-dev
150 2020-09-24T10:00:04  *** justinmoon has joined #bitcoin-core-dev
151 2020-09-24T10:05:38  *** mrostecki has joined #bitcoin-core-dev
152 2020-09-24T10:10:03  *** vasild has quit IRC
153 2020-09-24T10:12:05  *** vasild has joined #bitcoin-core-dev
154 2020-09-24T10:18:23  *** Lonny59Schumm has joined #bitcoin-core-dev
155 2020-09-24T10:20:02  *** andreacab has quit IRC
156 2020-09-24T10:20:28  *** andreacab has joined #bitcoin-core-dev
157 2020-09-24T10:25:13  *** andreacab has quit IRC
158 2020-09-24T10:36:06  *** S3RK has quit IRC
159 2020-09-24T10:36:32  *** S3RK has joined #bitcoin-core-dev
160 2020-09-24T10:59:53  *** jonatack has quit IRC
161 2020-09-24T11:03:30  *** Highway61 has joined #bitcoin-core-dev
162 2020-09-24T11:07:06  *** S3RK has quit IRC
163 2020-09-24T11:07:16  *** S3RK has joined #bitcoin-core-dev
164 2020-09-24T11:08:19  *** S3RK has joined #bitcoin-core-dev
165 2020-09-24T11:13:31  *** tralfaz has joined #bitcoin-core-dev
166 2020-09-24T11:13:31  *** andreacab has joined #bitcoin-core-dev
167 2020-09-24T11:13:44  *** S3RK has quit IRC
168 2020-09-24T11:15:23  *** davterra has quit IRC
169 2020-09-24T11:28:09  *** andreacab has quit IRC
170 2020-09-24T11:28:39  *** andreacab has joined #bitcoin-core-dev
171 2020-09-24T11:30:44  *** Lonny59Schumm has quit IRC
172 2020-09-24T11:31:46  *** MrPaz has joined #bitcoin-core-dev
173 2020-09-24T11:34:18  *** andreacab has quit IRC
174 2020-09-24T11:34:44  *** andreacab has joined #bitcoin-core-dev
175 2020-09-24T11:39:19  *** andreacab has quit IRC
176 2020-09-24T11:46:44  *** mrostecki has quit IRC
177 2020-09-24T11:49:52  *** jonatack has joined #bitcoin-core-dev
178 2020-09-24T11:52:21  *** andreacab has joined #bitcoin-core-dev
179 2020-09-24T11:56:04  *** andreacab has quit IRC
180 2020-09-24T11:56:30  *** andreacab has joined #bitcoin-core-dev
181 2020-09-24T11:57:29  <wumpus> jnewbery: great! yes, seems good to backport them separately and get them in first
182 2020-09-24T12:00:02  *** bshum1 has quit IRC
183 2020-09-24T12:00:56  *** mrostecki has joined #bitcoin-core-dev
184 2020-09-24T12:01:29  *** andreacab has quit IRC
185 2020-09-24T12:08:15  *** bitcoin-git has joined #bitcoin-core-dev
186 2020-09-24T12:08:16  <bitcoin-git> [bitcoin] laanwj pushed 3 commits to 0.20: https://github.com/bitcoin/bitcoin/compare/30926997fa15...80aa83aa4064
187 2020-09-24T12:08:17  <bitcoin-git> bitcoin/0.20 ad99777 Aaron Clauson: Set appveyor vm version to previous Visual Studio 2019 release.
188 2020-09-24T12:08:18  <bitcoin-git> bitcoin/0.20 498b7cb Aaron Clauson: Update the vcpkg checkout commit ID in appveyor config.
189 2020-09-24T12:08:18  <bitcoin-git> bitcoin/0.20 80aa83a Wladimir J. van der Laan: Merge #20008: [Backport] #19839 and #19842 to v0.20
190 2020-09-24T12:08:20  *** bitcoin-git has left #bitcoin-core-dev
191 2020-09-24T12:08:35  *** bitcoin-git has joined #bitcoin-core-dev
192 2020-09-24T12:08:35  <bitcoin-git> [bitcoin] laanwj merged pull request #20008: [Backport] #19839 and #19842 to v0.20 (0.20...2020-09-appveyor-backport) https://github.com/bitcoin/bitcoin/pull/20008
193 2020-09-24T12:08:36  *** bitcoin-git has left #bitcoin-core-dev
194 2020-09-24T12:21:57  *** jackalope has joined #bitcoin-core-dev
195 2020-09-24T12:23:16  *** bitcoin-git has joined #bitcoin-core-dev
196 2020-09-24T12:23:16  <bitcoin-git> [bitcoin] jnewbery closed pull request #19759: [doc] Struct members should have m_ prefix (master...2020-08-struct-members) https://github.com/bitcoin/bitcoin/pull/19759
197 2020-09-24T12:23:17  *** bitcoin-git has left #bitcoin-core-dev
198 2020-09-24T12:33:30  *** jonatack has quit IRC
199 2020-09-24T12:36:45  *** Chris_Stewart_5 has joined #bitcoin-core-dev
200 2020-09-24T13:06:24  *** andreacab has joined #bitcoin-core-dev
201 2020-09-24T13:08:41  *** andreaca_ has joined #bitcoin-core-dev
202 2020-09-24T13:11:14  *** andreaca_ has quit IRC
203 2020-09-24T13:12:25  *** andreacab has quit IRC
204 2020-09-24T13:30:27  *** jackalope has quit IRC
205 2020-09-24T13:30:44  *** gatox has joined #bitcoin-core-dev
206 2020-09-24T13:39:05  *** Guyver2 has joined #bitcoin-core-dev
207 2020-09-24T13:40:37  *** S3RK has joined #bitcoin-core-dev
208 2020-09-24T13:41:17  *** S3RK_ has joined #bitcoin-core-dev
209 2020-09-24T13:45:12  *** S3RK has quit IRC
210 2020-09-24T13:49:13  *** opsec_x12 has quit IRC
211 2020-09-24T13:51:09  *** andreacab has joined #bitcoin-core-dev
212 2020-09-24T13:57:50  *** DeanGuss has quit IRC
213 2020-09-24T13:58:54  *** S3RK_ has quit IRC
214 2020-09-24T14:01:46  *** davterra has joined #bitcoin-core-dev
215 2020-09-24T14:04:23  *** tralfaz has quit IRC
216 2020-09-24T14:05:05  *** tralfaz has joined #bitcoin-core-dev
217 2020-09-24T14:05:06  *** Landryl has quit IRC
218 2020-09-24T14:05:43  *** davterra has quit IRC
219 2020-09-24T14:12:53  *** Landryl has joined #bitcoin-core-dev
220 2020-09-24T14:17:14  *** S3RK has joined #bitcoin-core-dev
221 2020-09-24T14:21:39  *** S3RK has quit IRC
222 2020-09-24T14:25:01  *** kexkey has joined #bitcoin-core-dev
223 2020-09-24T14:25:03  *** davec has joined #bitcoin-core-dev
224 2020-09-24T14:27:42  *** DeanGuss has joined #bitcoin-core-dev
225 2020-09-24T14:31:34  *** tralfaz is now known as davterra
226 2020-09-24T14:33:08  *** S3RK has joined #bitcoin-core-dev
227 2020-09-24T14:38:01  *** S3RK has quit IRC
228 2020-09-24T14:38:36  *** DeanGuss has quit IRC
229 2020-09-24T14:39:01  *** DeanGuss has joined #bitcoin-core-dev
230 2020-09-24T14:39:32  *** DeanGuss has quit IRC
231 2020-09-24T14:41:02  *** DeanGuss has joined #bitcoin-core-dev
232 2020-09-24T14:42:15  *** harding has quit IRC
233 2020-09-24T14:43:07  *** harding has joined #bitcoin-core-dev
234 2020-09-24T14:47:13  *** Talkless has joined #bitcoin-core-dev
235 2020-09-24T14:49:13  *** S3RK has joined #bitcoin-core-dev
236 2020-09-24T14:49:37  *** andreacab has quit IRC
237 2020-09-24T14:50:04  *** andreacab has joined #bitcoin-core-dev
238 2020-09-24T14:52:15  *** davterra has quit IRC
239 2020-09-24T14:52:52  *** davterra has joined #bitcoin-core-dev
240 2020-09-24T14:53:44  *** S3RK has quit IRC
241 2020-09-24T14:54:37  *** andreacab has quit IRC
242 2020-09-24T14:54:51  *** andreacab has joined #bitcoin-core-dev
243 2020-09-24T14:56:40  *** promag has joined #bitcoin-core-dev
244 2020-09-24T15:00:02  *** gatox has quit IRC
245 2020-09-24T15:10:58  *** Talkless has quit IRC
246 2020-09-24T15:22:03  *** erwin_bullet has joined #bitcoin-core-dev
247 2020-09-24T15:22:04  *** tralfaz has joined #bitcoin-core-dev
248 2020-09-24T15:25:03  *** davterra has quit IRC
249 2020-09-24T15:27:23  *** mrostecki has quit IRC
250 2020-09-24T15:32:24  *** tralfaz is now known as davterra
251 2020-09-24T15:37:15  *** andreacab has quit IRC
252 2020-09-24T15:37:41  *** andreacab has joined #bitcoin-core-dev
253 2020-09-24T15:42:31  *** andreacab has quit IRC
254 2020-09-24T15:44:31  *** wumpus has quit IRC
255 2020-09-24T15:44:37  *** dr-orlovsky has quit IRC
256 2020-09-24T15:45:53  *** dr-orlovsky has joined #bitcoin-core-dev
257 2020-09-24T15:52:36  *** andreacab has joined #bitcoin-core-dev
258 2020-09-24T15:57:58  *** promag has quit IRC
259 2020-09-24T16:01:01  *** mrostecki has joined #bitcoin-core-dev
260 2020-09-24T16:11:03  *** davterra has quit IRC
261 2020-09-24T16:11:45  *** davterra has joined #bitcoin-core-dev
262 2020-09-24T16:11:46  *** owowo has quit IRC
263 2020-09-24T16:16:00  *** owowo has joined #bitcoin-core-dev
264 2020-09-24T16:16:11  *** andreacab has quit IRC
265 2020-09-24T16:16:37  *** andreacab has joined #bitcoin-core-dev
266 2020-09-24T16:16:56  *** S3RK has joined #bitcoin-core-dev
267 2020-09-24T16:20:32  *** justanotheruser has joined #bitcoin-core-dev
268 2020-09-24T16:21:09  *** andreacab has quit IRC
269 2020-09-24T16:21:22  *** S3RK has quit IRC
270 2020-09-24T16:33:17  *** S3RK has joined #bitcoin-core-dev
271 2020-09-24T16:37:20  *** andreacab has joined #bitcoin-core-dev
272 2020-09-24T16:37:34  *** S3RK has quit IRC
273 2020-09-24T16:37:43  *** braydonf has quit IRC
274 2020-09-24T16:47:37  *** andreacab has quit IRC
275 2020-09-24T16:48:03  *** andreacab has joined #bitcoin-core-dev
276 2020-09-24T16:50:43  *** braydonf has joined #bitcoin-core-dev
277 2020-09-24T16:50:51  *** S3RK has joined #bitcoin-core-dev
278 2020-09-24T16:51:05  *** Victorsueca has quit IRC
279 2020-09-24T16:52:49  *** andreacab has quit IRC
280 2020-09-24T16:55:39  *** S3RK has quit IRC
281 2020-09-24T16:56:53  *** S3RK has joined #bitcoin-core-dev
282 2020-09-24T17:01:25  *** S3RK has quit IRC
283 2020-09-24T17:03:15  *** andreacab has joined #bitcoin-core-dev
284 2020-09-24T17:07:56  *** andreacab has quit IRC
285 2020-09-24T17:08:22  *** andreacab has joined #bitcoin-core-dev
286 2020-09-24T17:09:47  *** filchef has joined #bitcoin-core-dev
287 2020-09-24T17:12:56  *** S3RK has joined #bitcoin-core-dev
288 2020-09-24T17:13:05  *** andreacab has quit IRC
289 2020-09-24T17:17:43  *** S3RK has quit IRC
290 2020-09-24T17:32:05  *** jonatack has joined #bitcoin-core-dev
291 2020-09-24T17:48:39  *** DeanGuss has quit IRC
292 2020-09-24T17:49:07  *** DeanGuss has joined #bitcoin-core-dev
293 2020-09-24T17:57:01  *** troygiorshev has joined #bitcoin-core-dev
294 2020-09-24T17:57:50  *** DeanGuss has quit IRC
295 2020-09-24T18:00:02  *** erwin_bullet has quit IRC
296 2020-09-24T18:10:00  *** DeanGuss has joined #bitcoin-core-dev
297 2020-09-24T18:11:33  *** watchtower has joined #bitcoin-core-dev
298 2020-09-24T18:13:33  *** DeanGuss has quit IRC
299 2020-09-24T18:14:16  *** DeanGuss has joined #bitcoin-core-dev
300 2020-09-24T18:14:34  *** watchtower has quit IRC
301 2020-09-24T18:20:51  *** m4v1 has joined #bitcoin-core-dev
302 2020-09-24T18:30:08  *** opsec_x12 has joined #bitcoin-core-dev
303 2020-09-24T18:37:00  <luke-jr> sipa: a ton of CNetAddr stuff is changed
304 2020-09-24T18:38:40  <sipa> luke-jr: yes, i was talking about the 0.20.1 codebase fwiw
305 2020-09-24T18:38:49  <sipa> i think it's the same in master though
306 2020-09-24T18:39:43  <luke-jr> _ZN26PartiallySignedTransaction11UnserializeI11CDataStreamEEvRT_
307 2020-09-24T18:40:04  <luke-jr> this seems to be the worst of it
308 2020-09-24T18:40:52  <sipa> that's a function you see changed with the gcc patch?
309 2020-09-24T18:42:05  <luke-jr> yes
310 2020-09-24T18:42:35  <luke-jr> is there a good way to get objdump disassembly without addresses and similar diff-complicating stuff?
311 2020-09-24T18:45:58  <luke-jr> https://dpaste.com/23HQPNBF4
312 2020-09-24T18:47:26  <luke-jr> list of changed code symbols: https://dpaste.com/GU4GPSPB8
313 2020-09-24T18:52:03  *** andreacab has joined #bitcoin-core-dev
314 2020-09-24T19:00:09  <MarcoFalke> (been offline from IRC for two weeks. If there are any questions I missed, let me know)
315 2020-09-24T19:00:16  <MarcoFalke> Also meeting time?
316 2020-09-24T19:00:22  <jonasschnelli> jep
317 2020-09-24T19:00:43  *** mrostecki has quit IRC
318 2020-09-24T19:01:10  <sipa> hi
319 2020-09-24T19:01:15  *** wumpus has joined #bitcoin-core-dev
320 2020-09-24T19:01:17  <sipa> MarcoFalke: wb
321 2020-09-24T19:02:20  <MarcoFalke> sipa: The qa-assets can be cloned with --depth=1, but it shouldn't make a difference right now, as all files were append only
322 2020-09-24T19:02:30  <MarcoFalke> Might change when we start deleting fuzz seeds
323 2020-09-24T19:02:37  <wumpus> #startmeeting
324 2020-09-24T19:02:37  <lightningbot> Meeting started Thu Sep 24 19:02:37 2020 UTC.  The chair is wumpus. Information about MeetBot at http://wiki.debian.org/MeetBot.
325 2020-09-24T19:02:37  <lightningbot> Useful Commands: #action #agreed #help #info #idea #link #topic.
326 2020-09-24T19:02:41  <jonasschnelli> hi
327 2020-09-24T19:02:43  <jonatack> hi
328 2020-09-24T19:02:43  <MarcoFalke> hi
329 2020-09-24T19:02:45  <hebasto> hi
330 2020-09-24T19:02:46  <amiti> hi
331 2020-09-24T19:02:50  <fjahr> hi
332 2020-09-24T19:02:51  <luke-jr> hi
333 2020-09-24T19:02:53  <sipa> hi
334 2020-09-24T19:02:53  <achow101> hi
335 2020-09-24T19:03:09  <wumpus> #bitcoin-core-dev Meeting: wumpus sipa gmaxwell jonasschnelli morcos luke-jr sdaftuar jtimon cfields petertodd kanzure bluematt instagibbs phantomcircuit codeshark michagogo marcofalke paveljanik NicolasDorier jl2012 achow101 meshcollider jnewbery maaku fanquake promag provoostenator aj Chris_Stewart_5 dongcarl gwillen jamesob ken281221 ryanofsky gleb moneyball kvaciral ariard digi_james
336 2020-09-24T19:03:11  <wumpus> amiti fjahr jeremyrubin lightlike emilengler jonatack hebasto jb55 elichai2
337 2020-09-24T19:03:28  <meshcollider> hi
338 2020-09-24T19:03:49  <jnewbery> hi
339 2020-09-24T19:03:58  <wumpus> one proposed topic: what sipa just said (will have to look up in the log what :-)
340 2020-09-24T19:04:18  <sipa> wumpus: #20005
341 2020-09-24T19:04:19  <gribble> https://github.com/bitcoin/bitcoin/issues/20005 | memcmp with constants that contain zero bytes are broken in GCC · Issue #20005 · bitcoin/bitcoin · GitHub
342 2020-09-24T19:04:38  <luke-jr> https://dpaste.com/GU4GPSPB8 <-- affected symbols in bitcoind
343 2020-09-24T19:04:42  <jeremyrubin> hi
344 2020-09-24T19:04:42  <wumpus> I see
345 2020-09-24T19:05:11  <sipa> yeah i just wanted to draw attention to this potentially very scary bug
346 2020-09-24T19:05:26  <wumpus> how did they manage to break such a basic library function
347 2020-09-24T19:05:30  <kanzure> hi
348 2020-09-24T19:05:38  <luke-jr> wumpus: they turned it into strcmp sometimes it looks like
349 2020-09-24T19:05:43  <sipa> wumpus: it's not a libc bug, it's bug in gcc's implementation of __builtin_memcmp
350 2020-09-24T19:05:50  <luke-jr> at least the consensus code seems to have dodged it
351 2020-09-24T19:06:08  <sipa> but otherwise yes, this is really concerning
352 2020-09-24T19:06:20  <sipa> i believe none of our gitian builds are affected, as we use older GCCs
353 2020-09-24T19:06:27  <sipa> can someone verify that?
354 2020-09-24T19:06:32  <wumpus> that's at least good to know, let me see
355 2020-09-24T19:06:50  <luke-jr> macOS build should use LLVM IIRC
356 2020-09-24T19:06:57  <sipa> luke-jr: indeed
357 2020-09-24T19:07:06  <jeremyrubin> sipa: is this a generaly class of bugs do you reckon or pretty specific to memcmp? should we be auditing all builtins?
358 2020-09-24T19:07:10  <MarcoFalke> sipa: Gitian should use 7 and 8
359 2020-09-24T19:07:11  <luke-jr> I *assume* LLVM didn't reimplement this bug
360 2020-09-24T19:07:13  <wumpus> gcc 8 it seems
361 2020-09-24T19:07:46  <sipa> jeremyrubin: i don't think we have the manpower to do actual auditing of all of gcc's builtins (and other potential bugs), nor is that our job
362 2020-09-24T19:07:50  <jonasschnelli> bionic uses gcc 7, right?
363 2020-09-24T19:08:06  <luke-jr> jonasschnelli: yes
364 2020-09-24T19:08:12  <wumpus> jonasschnelli: but we explicitly install 8 for some platforms
365 2020-09-24T19:08:17  <luke-jr> ^
366 2020-09-24T19:08:28  <sipa> jeremyrubin: i think it's important to note that while the bug was known, we stumbled upon it in the libsecp256k1 repo, in a test
367 2020-09-24T19:08:48  <jonasschnelli> Ah. Yes. Arm / risc uses gcc-8
368 2020-09-24T19:08:54  <luke-jr> hmm
369 2020-09-24T19:08:56  <sipa> so that's kind of a sign that our processes are at least capable of catching some issues like this
370 2020-09-24T19:09:06  <luke-jr> sipa: should I be concerned I *didn't* get any libsecp symbols in my comparison?
371 2020-09-24T19:09:25  <wumpus> I honestly don't now how to prevent us being affected by problems like this
372 2020-09-24T19:09:26  <luke-jr> or is the test only in a newer version?
373 2020-09-24T19:09:26  <sipa> luke-jr: no, i think this is expected (it's in code added in a new test)
374 2020-09-24T19:09:28  <wumpus> computers are broken
375 2020-09-24T19:09:35  <jonasschnelli> indeed
376 2020-09-24T19:10:09  <sipa> reality is often disappointing
377 2020-09-24T19:10:11  <wumpus> I can understand libc bugs in some cases but this is something so low-level
378 2020-09-24T19:10:40  <sipa> anyway, i think we should see what performance impact building with -fno-builtin-memcmp has
379 2020-09-24T19:10:51  <wumpus> sipa: yes but only for affected compilers
380 2020-09-24T19:10:58  <sipa> if that is sufficiently low, i think that's a sufficient solution - perhaps restricted to GCC 9 and 10
381 2020-09-24T19:10:59  <luke-jr> sipa: that won't fix C++ afaik
382 2020-09-24T19:11:06  <sipa> luke-jr: it will
383 2020-09-24T19:11:29  <sipa> luke-jr: std::lexicographical_compare (in the .h file) just calls __builting_memcmp
384 2020-09-24T19:11:38  <MarcoFalke> Should we also add a test that fails with gcc9/10?
385 2020-09-24T19:11:39  <wumpus> I don't even care about peformance there, just add the option, it needs to be correct, if people want performance don't use a broken compiler
386 2020-09-24T19:11:46  <sipa> MarcoFalke: definitely
387 2020-09-24T19:11:52  <luke-jr> sipa: -fno-builtin-* doesn't affect __builtin_*
388 2020-09-24T19:12:00  <sipa> luke-jr: hmm!
389 2020-09-24T19:12:09  <sipa> that's a good point, let's test that
390 2020-09-24T19:12:18  <wumpus> that's the important thing thoug hthat it fixes the issue, a test like MarcoFalke says makes a lot of sense
391 2020-09-24T19:12:35  <luke-jr> at least GCC's docs suggest to whitelist builtins, one should use -fno-builtin and call __builtin_* directly ;)
392 2020-09-24T19:13:00  <wumpus> or just fail compiling on affected compilers, they're going to backport a fix right?
393 2020-09-24T19:13:09  <sipa> wumpus: yes
394 2020-09-24T19:13:12  <luke-jr> wumpus: supposedly, but it looks non-trivial and they haven't yet
395 2020-09-24T19:13:15  *** tralfaz has joined #bitcoin-core-dev
396 2020-09-24T19:13:28  <wumpus> I'd prefer things to build at all on compilers with a broken memcmp
397 2020-09-24T19:13:33  <wumpus> +not
398 2020-09-24T19:13:44  <sipa> it's fixed in master, but not in any release
399 2020-09-24T19:14:06  <jonatack> gcc 9.3 and 10.1 seem afficted
400 2020-09-24T19:14:15  <wumpus> (whatever we end up doing, we need a test for this in configure)
401 2020-09-24T19:14:18  <luke-jr> personally, I neutered my builtin memcmp to always fail (fallback to libc) and am rebuilding my system
402 2020-09-24T19:14:40  <sipa> wumpus: my first thought was adding a configure test that exploits the bug... but that won't work when crosscompiling
403 2020-09-24T19:14:43  <sipa> i think?
404 2020-09-24T19:14:57  <luke-jr> well, crosscompiling, we can't run it
405 2020-09-24T19:14:58  <wumpus> sipa: ... ugh
406 2020-09-24T19:15:03  <luke-jr> why not add a sanity check? we have others
407 2020-09-24T19:15:09  <sipa> unless we assume that building for the host platform is always similarly affected as the target platform
408 2020-09-24T19:15:12  <wumpus> yes, you'd need to run it to figure it out right
409 2020-09-24T19:15:14  <jeremyrubin> Is memcmp constexpr?
410 2020-09-24T19:15:21  <jeremyrubin> Maybe it can static_assert...
411 2020-09-24T19:15:26  <sipa> jeremyrubin: it's a C function constexpr is a C++ concept
412 2020-09-24T19:15:29  <wumpus> holy shit this is *really* bad
413 2020-09-24T19:15:41  <luke-jr> sipa: bad assumption
414 2020-09-24T19:15:51  <sipa> luke-jr: yes, i think so
415 2020-09-24T19:15:52  <wumpus> maybe it could expect the symbols generated or something, if it generates a call to strcpy instead?
416 2020-09-24T19:16:08  <sipa> wumpus: there are no calls involved
417 2020-09-24T19:16:09  <luke-jr> wumpus: it doesn't
418 2020-09-24T19:16:14  <sipa> it's the autogenerated builtin code that is wrong
419 2020-09-24T19:16:19  <luke-jr> wumpus: it's unrolling the memcmp
420 2020-09-24T19:16:22  <wumpus> ok...
421 2020-09-24T19:16:23  *** davterra has quit IRC
422 2020-09-24T19:16:31  <sipa> which makes it implementation something more or less equal to strcmp rather than memcmp
423 2020-09-24T19:16:52  <luke-jr> basically turns it into if (a[0] == "x" && a[1] == "x" && …)
424 2020-09-24T19:17:11  <luke-jr> aiui
425 2020-09-24T19:17:24  <wumpus> that's impossible to check in a platform independent way
426 2020-09-24T19:17:43  *** tralfaz has quit IRC
427 2020-09-24T19:17:44  <jonatack> it's unclear to me if the patch is in the gcc 10.2 release?
428 2020-09-24T19:17:50  <luke-jr> jonatack: no
429 2020-09-24T19:17:52  <sipa> jonatack: it is not in any release
430 2020-09-24T19:18:00  <jonatack> thank you
431 2020-09-24T19:18:03  <real_or_random> fwiw, this is (part of) the GCC patch that fixes this: https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/builtins.c;h=228db78f32bfdcce31e23850e878843d7a45adcc;hp=eb662112b32e5ad377d2a865d9977c64dc12cc93;hb=d5803b9876b3d11c93d1a10fabb3fbb1c4a14bd6;hpb=3e99ed65cbedf7a6c0abb9cd63c191326995fd34
432 2020-09-24T19:18:21  <jeremyrubin> Could we wrap memcmp with a compile time wrapper that static asserts we aren't using a const array with a 0 byte? Not sure if you can enable-if-fu around constexpr args.
433 2020-09-24T19:18:38  <real_or_random> it's hard to read but I think it's possible to deduce a few condition under which this bug can't happen
434 2020-09-24T19:18:42  <sipa> jeremyrubin: that's not a solution
435 2020-09-24T19:18:43  <jeremyrubin> The bug only happens when it's a const array right?
436 2020-09-24T19:18:45  *** cepheus17 has joined #bitcoin-core-dev
437 2020-09-24T19:19:05  <sipa> jeremyrubin: if we can identify all potentially affected code paths, we could just replace them with my_memcmp that doesn't have the bug too
438 2020-09-24T19:19:31  <jeremyrubin> ah right you're worried about other stdlib calls and stuff.
439 2020-09-24T19:19:37  *** cepheus17 has left #bitcoin-core-dev
440 2020-09-24T19:19:37  <wumpus> but C++ also generates memcmps it's not just our own code
441 2020-09-24T19:19:49  <wumpus> it's a very low-level function
442 2020-09-24T19:19:52  <luke-jr> sipa: I just did that? :P
443 2020-09-24T19:20:02  <sipa> right - "all code paths" also contains std::lexicographical_compare and a few other things
444 2020-09-24T19:20:10  <sipa> luke-jr: right, but not in a guaranteed automated way
445 2020-09-24T19:20:23  <sipa> luke-jr: it's a really useful way of finding potential issues now, though
446 2020-09-24T19:20:26  <sipa> thanks for that
447 2020-09-24T19:21:29  <sipa> i've tried making configure detect the version of GCC, and so far been unsuccesful
448 2020-09-24T19:22:03  <sipa> my google-fu led me to 9-year old stackoverflow posts with comments "ah yes, that doesn't work anymore, let's just delete that functionality" from the m4 gcc scripts
449 2020-09-24T19:22:09  <sipa> (though i'm sure people with more autoconf skills can do better)
450 2020-09-24T19:22:11  <luke-jr> >_<
451 2020-09-24T19:22:28  <sipa> the idea is that in general you should test for compiler features, rather than exact versions
452 2020-09-24T19:22:36  <sipa> which is absolutely true, except for bug workarounds :p
453 2020-09-24T19:22:37  <wumpus> and as soon as the patch is backported to gcc 9 and 10 it will become more difficult too
454 2020-09-24T19:22:38  <luke-jr> sipa: ideally, yes
455 2020-09-24T19:22:52  <luke-jr> sipa: even for bug workarounds, you can't use the version number to see that my GCC is patched ;)
456 2020-09-24T19:23:02  <sipa> that's true, but it's a safe superset
457 2020-09-24T19:23:07  <wumpus> worse, some distributions might backport the single patch without changing the version number
458 2020-09-24T19:23:25  <wumpus> sure, it dpeends on what it does in that case
459 2020-09-24T19:23:26  <sipa> anyway, what's the plan?
460 2020-09-24T19:23:33  <wumpus> if it only passes an extra command line flag it's ok
461 2020-09-24T19:23:35  <sipa> i think the first thing to do is add a unit test that catches the bug
462 2020-09-24T19:23:54  <luke-jr> sipa: why not sanity test?
463 2020-09-24T19:23:55  <sipa> though we also need to make sure it doesn't become an "expected failure" thing that people ignore
464 2020-09-24T19:23:56  <wumpus> but it shouldn't fail the build for versions that have been fixed
465 2020-09-24T19:24:08  <sipa> luke-jr: that's a good point
466 2020-09-24T19:24:24  <wumpus> a sanity check makes sense
467 2020-09-24T19:24:43  *** tralfaz has joined #bitcoin-core-dev
468 2020-09-24T19:25:01  <luke-jr> the GCC bug tracker has a reduced test (note the first test *didn't* fail on my unpatched GCC)
469 2020-09-24T19:25:02  *** tralfaz is now known as davterra
470 2020-09-24T19:25:03  *** andreacab has quit IRC
471 2020-09-24T19:25:29  <sipa> luke-jr: yeah, it seems the cases you need to catch it differ slightly between gcc 9 and 10
472 2020-09-24T19:25:49  <luke-jr> hmm
473 2020-09-24T19:26:01  <luke-jr> I wonder if that means different code could be affected by GCC 9?
474 2020-09-24T19:26:09  <luke-jr> or is GCC 9's affected a strict subset of GCC 10's?
475 2020-09-24T19:26:15  <sipa> we also should figure out if -fno-builtin-memcmp fixes std::lexicographical_compare
476 2020-09-24T19:26:30  *** mrostecki has joined #bitcoin-core-dev
477 2020-09-24T19:26:33  <luke-jr> I very doubt it does
478 2020-09-24T19:26:37  <sipa> luke-jr: i don't know
479 2020-09-24T19:27:09  <sipa> i don't want to monopolize the meeting with this; we can also continue discussion on #20005
480 2020-09-24T19:27:11  <gribble> https://github.com/bitcoin/bitcoin/issues/20005 | memcmp with constants that contain zero bytes are broken in GCC · Issue #20005 · bitcoin/bitcoin · GitHub
481 2020-09-24T19:27:31  <sipa> but i think this is deserves some priority
482 2020-09-24T19:27:32  <wumpus> we don't have any proposed topics at least
483 2020-09-24T19:27:58  <wumpus> but we can go to high priority for review if this topic is finished
484 2020-09-24T19:28:54  <wumpus> #topic High priority for review
485 2020-09-24T19:29:07  <wumpus> https://github.com/bitcoin/bitcoin/projects/8  13 blockers, 1 bugfix, 2 chasing concept ACK
486 2020-09-24T19:29:14  <real_or_random> i'm somewhat curious to add a patch to GCC that makes it emit a message if it applies this optimization wrongly. that may be possible with some effort given that we have the GCC patch that fixes the issue. but not sure if I'll find time
487 2020-09-24T19:29:42  <sipa> real_or_random: luke modified his compiler with the patch, and then tried to see which symbols differ before and after
488 2020-09-24T19:29:59  <sipa> (we can continue after the high priority for review topic)
489 2020-09-24T19:30:03  <real_or_random> sipa: oh I missed that, cool
490 2020-09-24T19:30:06  <real_or_random> yes
491 2020-09-24T19:30:59  <wumpus> patching gcc is not a solution that we can rely on in general as most people don't build their own gcc
492 2020-09-24T19:31:49  <luke-jr> right, I was just doing it to quickly audit what was affected
493 2020-09-24T19:31:58  <wumpus> sure, for that it's a great way
494 2020-09-24T19:32:16  <luke-jr> sipa: btw, I think it's using __builtin_memcmp for std::equal or == in PSBT stuff?
495 2020-09-24T19:33:13  <wumpus> nothing to discuss about high priority for review PRs?
496 2020-09-24T19:33:20  <sipa> i guess not...
497 2020-09-24T19:33:23  <luke-jr> pls review rwconf :P
498 2020-09-24T19:33:32  <jonatack> high-priority: #19845 might be close
499 2020-09-24T19:33:35  <gribble> https://github.com/bitcoin/bitcoin/issues/19845 | net: CNetAddr: add support to (un)serialize as ADDRv2 by vasild · Pull Request #19845 · bitcoin/bitcoin · GitHub
500 2020-09-24T19:33:53  <jonatack> was good to see signet get in this week
501 2020-09-24T19:34:08  <sipa> indeed
502 2020-09-24T19:34:47  <luke-jr> wumpus: oh, we could build with -O1 ?
503 2020-09-24T19:35:05  <wumpus> yes
504 2020-09-24T19:35:14  * luke-jr wonders how -O1 works but -fno-builtin-memcmp doesn't
505 2020-09-24T19:35:34  <MarcoFalke> Doesn't that make IBD take twice as long?
506 2020-09-24T19:35:40  <wumpus> probably
507 2020-09-24T19:35:47  <wumpus> still better than broken builtins though
508 2020-09-24T19:35:50  <MarcoFalke> Might be better to refuse to start with the sanity check
509 2020-09-24T19:35:50  <luke-jr> maybe there's some more granular thing we can disable
510 2020-09-24T19:35:59  <luke-jr> MarcoFalke: both ☺
511 2020-09-24T19:36:06  <sipa> luke-jr: could you build with -fno-builtin-memcmp without the gcc patch, and then (for the affected symbols from your previous list) check if which ones become equal to the fixed gcc output?
512 2020-09-24T19:37:12  <luke-jr> sipa: I don't have the unpatched compiler anymore :x
513 2020-09-24T19:37:29  <luke-jr> on an x86 server, however, -fno-builtin-memcmp did not fix the bug
514 2020-09-24T19:37:36  <luke-jr> for    int x= __builtin_memcmp (a, "\0\0\0\0", 4);
515 2020-09-24T19:38:00  <sipa> sure, but we never call __builtin_memcmp directly from our code
516 2020-09-24T19:38:49  <wumpus> speaking of that, what about other dependency libraries that can be assumed to have been built with the broken compiler
517 2020-09-24T19:39:03  <wumpus> boost, libupnp, libevent ...
518 2020-09-24T19:39:24  <luke-jr> we can't fix everything
519 2020-09-24T19:39:35  <elichai2> wumpus: is it even remotely possible to check what compiler compiled an already compiled library?
520 2020-09-24T19:39:35  <wumpus> no, we can't
521 2020-09-24T19:39:47  <sipa> doesn't mean we can't work around it
522 2020-09-24T19:39:49  <luke-jr> I suppose that's an argument for just the sanity check, and not trying to workaround it
523 2020-09-24T19:39:50  <wumpus> elichai2: not in gneral
524 2020-09-24T19:40:35  <sipa> like just not permitting building with known-to-be-affected compilers, which at least in some cases will avoid the situation where dependencies are built with the same thing
525 2020-09-24T19:40:51  <wumpus> sipa: right
526 2020-09-24T19:40:59  <sipa> but... if your system itself has bugs introduced by this, i think there is very little we can do about it
527 2020-09-24T19:41:15  <wumpus> for many distributions at least, the dependencies will have been built with the same gcc/g++ that is available
528 2020-09-24T19:42:20  <sipa> i believe my python3 binary is built with GCC 9.3
529 2020-09-24T19:42:30  <sipa> $ strings python3.8 | fgrep GCC
530 2020-09-24T19:42:30  <sipa> [GCC 9.3.0]
531 2020-09-24T19:45:18  <jonatack> luke-jr: did the tests in the final patch fail on your unpatched gcc?
532 2020-09-24T19:45:42  <luke-jr> didn't try
533 2020-09-24T19:46:49  <wumpus> I'm going to close the meeting, can continue this discussion afterwards and we're out of topics
534 2020-09-24T19:46:51  <wumpus> #endmeeting
535 2020-09-24T19:46:51  <lightningbot> Meeting ended Thu Sep 24 19:46:51 2020 UTC.  Information about MeetBot at http://wiki.debian.org/MeetBot . (v 0.1.4)
536 2020-09-24T19:46:51  <lightningbot> Minutes:        http://www.erisian.com.au/meetbot/bitcoin-core-dev/2020/bitcoin-core-dev.2020-09-24-19.02.html
537 2020-09-24T19:46:51  <lightningbot> Minutes (text): http://www.erisian.com.au/meetbot/bitcoin-core-dev/2020/bitcoin-core-dev.2020-09-24-19.02.txt
538 2020-09-24T19:46:51  <lightningbot> Log:            http://www.erisian.com.au/meetbot/bitcoin-core-dev/2020/bitcoin-core-dev.2020-09-24-19.02.log.html
539 2020-09-24T19:46:56  <sipa> sg
540 2020-09-24T19:47:22  <luke-jr> I can't find a flag that makes -O1 fail :/
541 2020-09-24T19:47:35  <elichai2> unless both of the sides are constants I can't manage to get `std::lexicographical_compare` to *not* produce a `memcmp` call.
542 2020-09-24T19:48:11  *** belcher has quit IRC
543 2020-09-24T19:48:37  <sipa> elichai2: what if one side is a constant that starts with a 0 byte?
544 2020-09-24T19:48:49  <sipa> or the length is restricted to at most 3 bytes
545 2020-09-24T19:49:03  <elichai2> sipa: here: https://godbolt.org/z/65WWPf
546 2020-09-24T19:49:17  <elichai2> even 2 bytes, where in compile time it can see it's 2 bytes, it still produces a memcmp
547 2020-09-24T19:50:55  <elichai2> only when the array is 1 byte it doesn't call to memcmp, and instead it generates a `cmp     BYTE PTR [rdi], 0` instruction (compare with zero(because my other array is zero))
548 2020-09-24T19:51:12  *** Chris_Stewart_5 has quit IRC
549 2020-09-24T19:51:35  <sipa> and if you take the same code but with memcmp instead of std::lexicographical_compare, it does avoid the memcmp call
550 2020-09-24T19:51:52  <roconnor> luke-jr: my understanding is that it isn't quite that builtin_memcmp is broken but an optimization surrounding it that is invoked at level -O2 is broken.
551 2020-09-24T19:52:47  <sipa> i changed the 0.20.1 source code to replace IsIPv4() with "return ip[0] == 0;" (which is what I understand the bug would turn it into now)... the tests fail
552 2020-09-24T19:53:01  <sipa> so whatever it's doing, it's not doing that, or we'd have caught it
553 2020-09-24T19:53:23  *** mrostecki has quit IRC
554 2020-09-24T19:54:10  <elichai2> sipa: yes. if I just replace with `memcmp` it produces bad code
555 2020-09-24T19:54:19  <elichai2> https://godbolt.org/z/a9Wf11
556 2020-09-24T19:57:10  <elichai2> I think it ***might*** be because `lexicographical_compare` gets both start and end iterators of both sides, then it sees they're the same size, so it replaces with memcmp but it might be the same round where they replace memcmp so it doesn't do this deduction again, ***maybe***
557 2020-09-24T19:57:37  <meshcollider> Tomorrow is the wallet meeting but I won't be able to make it. So either someone else might want to host, or since it has been quiet the last few meetings we might just cancel it tomorrow
558 2020-09-24T19:58:15  *** Chris_Stewart_5 has joined #bitcoin-core-dev
559 2020-09-24T19:59:31  <luke-jr> https://dpaste.com/GT7VUNFKV <-- _ZNK8CNetAddr6IsIPv4Ev diff
560 2020-09-24T20:00:17  <elichai2> luke-jr: is this MIPS?
561 2020-09-24T20:00:25  <luke-jr> elichai2: PPC
562 2020-09-24T20:00:56  <luke-jr> sorry, I guess it's not quite familiar to most
563 2020-09-24T20:02:35  <luke-jr> https://dpaste.com/9E7Z9NNZ7 <-- full assembly dump of it
564 2020-09-24T20:03:21  <sipa> if i change IsIPv4() to memcmp(...) > 0 (rather than == 0), gcc 9.3 emits broken code
565 2020-09-24T20:03:57  <sipa> i'm beginning to suspect that (in)equality checks use a different optimization path that isn't affected
566 2020-09-24T20:05:19  <sipa> which if true would be good news, as it means automatically generated operator== code isn't affected either (and there exists no automatically generated < <= >= >)
567 2020-09-24T20:06:37  <sipa> != also doesn't seem affected
568 2020-09-24T20:06:38  <gribble> Error: "=" is not a valid command.
569 2020-09-24T20:06:49  <sipa> stupid bot
570 2020-09-24T20:10:16  <elichai2> sipa: I also can't manage to trigger this in `std::equal`
571 2020-09-24T20:11:32  <jonatack> meshcollider: thanks for the heads up. i guess we'll see who is around.
572 2020-09-24T20:11:58  <elichai2> (although unlike lexicographical_compare std::equal does optimize nicely)
573 2020-09-24T20:14:18  <elichai2> damn it
574 2020-09-24T20:14:26  <elichai2> it also happens with lexicographical_compare
575 2020-09-24T20:15:13  <elichai2> if you replace the reference with a copy it happens, you can play with the optimization level and see the output changes: https://godbolt.org/z/vxEo8d
576 2020-09-24T20:22:13  *** andreacab has joined #bitcoin-core-dev
577 2020-09-24T20:24:47  *** owowo has quit IRC
578 2020-09-24T20:25:46  *** filchef has quit IRC
579 2020-09-24T20:29:26  *** owowo has joined #bitcoin-core-dev
580 2020-09-24T20:33:12  <elichai2> lol `base_uint` in arith_uint256.h seems to have dodged the bullet by pure luck https://github.com/bitcoin/bitcoin/blob/master/src/arith_uint256.h#L217-L222
581 2020-09-24T20:33:24  <elichai2> (actually, it's really NOT funny)
582 2020-09-24T20:36:10  <roconnor> uint256.h doesn't compare with a static array, so it should be fine right?
583 2020-09-24T20:36:28  <sipa> roconnor: it could be a compile-time known value in some cases
584 2020-09-24T20:36:33  <elichai2> isn't max PoW static?
585 2020-09-24T20:36:58  <roconnor> fair.
586 2020-09-24T20:37:29  <sipa> i don't know if being a compile-time known constant it enough to trigger it; maybe it actually has to be a comparison with a constant
587 2020-09-24T20:37:40  <sipa> *compile-time-known value
588 2020-09-24T20:37:57  <elichai2> I hate this
589 2020-09-24T20:39:12  <sipa> elichai2: great find
590 2020-09-24T20:39:18  <roconnor> It has to be a value that GCC's c_getstr is able to figure out object byte representation for from the source code, however c_getstr works.
591 2020-09-24T20:40:26  <sipa> elichai2: so, we learn that -fno-builtin-memcmp is not enough
592 2020-09-24T20:40:35  <elichai2> yes :/
593 2020-09-24T20:41:06  <sipa> it should be possible to find the subset of functions in STL that are affected by this
594 2020-09-24T20:41:33  <roconnor> rather than -fno-buildin-memcmp, we need to find a flag that disables this suite of optimizations :/
595 2020-09-24T20:42:01  <elichai2> we could decide to remove *all* usages of functions comparing stuff, but even `>` gets misoptimized on some containers :(
596 2020-09-24T20:43:49  <sipa> roconnor: that's a possibility too
597 2020-09-24T20:44:45  <roconnor> is -O2 stand in for a series of -f flags?
598 2020-09-24T20:44:58  <sipa> yes
599 2020-09-24T20:45:04  <roconnor> do we know which ones?
600 2020-09-24T20:46:34  <elichai2> roconnor: yes, I'm testing them now
601 2020-09-24T20:46:42  <roconnor> 3>
602 2020-09-24T20:46:43  <elichai2> https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
603 2020-09-24T20:46:45  <roconnor> oops
604 2020-09-24T20:46:49  <roconnor> <3
605 2020-09-24T20:47:58  <elichai2> what, when I manually turn the flags on I don't get the bug OoO
606 2020-09-24T20:47:59  <sipa> i'm cloning the gcc mirror repo; it's probably not too hard to find which exact flags controls this optimization
607 2020-09-24T20:48:06  *** Chris_Stewart_5 has quit IRC
608 2020-09-24T20:48:25  <roconnor> elichai2: I can believe that :(
609 2020-09-24T20:48:59  <roconnor> elichai2: did you turn on both the -O and -O2 flags?
610 2020-09-24T20:49:39  <roconnor> or do an -O  + all the -O2 flags?
611 2020-09-24T20:49:56  <elichai2> I did `-O1` + all the `-O2` flags
612 2020-09-24T20:50:00  <sipa> gcc -c -Q -O3 --help=optimizers
613 2020-09-24T20:50:05  <sipa> prints all the enabled flags
614 2020-09-24T20:52:10  <elichai2> sipa: +1
615 2020-09-24T20:52:29  *** Chris_Stewart_5 has joined #bitcoin-core-dev
616 2020-09-24T20:53:12  <roconnor> gcc -c -Q -O2 --help=optimizers | grep -v disabled   ?
617 2020-09-24T21:00:02  *** m4v1 has quit IRC
618 2020-09-24T21:05:48  *** Guyver2 has quit IRC
619 2020-09-24T21:07:32  <elichai2> first `-fno-inline` seems to solve this, but that makes sense and has hugee perf penalty
620 2020-09-24T21:11:13  *** Chris_Stewart_5 has quit IRC
621 2020-09-24T21:14:34  *** S3RK has joined #bitcoin-core-dev
622 2020-09-24T21:15:47  *** ossifrage_ is now known as ossifrage
623 2020-09-24T21:19:02  *** S3RK has quit IRC
624 2020-09-24T21:21:14  <elichai2> `-O2 -fno-tree-dce -fno-tree-dominator-opts -fno-tree-fre -fno-tree-pre -fno-code-hoisting`
625 2020-09-24T21:21:31  <sipa> all of those are needed? :S
626 2020-09-24T21:21:36  <elichai2> looks like it
627 2020-09-24T21:22:19  *** patryk has joined #bitcoin-core-dev
628 2020-09-24T21:22:25  <elichai2> although some flags might imply others so it might be possible to get more granular but this sounds like an NP problem lol
629 2020-09-24T21:24:09  <elichai2> ignore what I just said. with `-O2` and all the O2 flags actually disabled, if any of these 5 flags aren't disabled I get the wrong result, they all need to be disabled to get the right results
630 2020-09-24T21:28:02  *** promag has joined #bitcoin-core-dev
631 2020-09-24T21:29:36  <promag> who has admin role in travis?
632 2020-09-24T21:29:37  <roconnor> `-O2 -fno-tree-dce -fno-tree-dominator-opts -fno-tree-fre -fno-code-hoisting` seems to do something different.
633 2020-09-24T21:30:27  <elichai2> roconnor: I still get the wrong result there, through a different path it seems but still the wrong one hehe
634 2020-09-24T21:30:44  <roconnor> right.  sorry, yes it still appears wrong, but with different wrong asm.
635 2020-09-24T21:30:54  *** S3RK has joined #bitcoin-core-dev
636 2020-09-24T21:34:49  <elichai2>  it scares me that my current default compiler in my machine is so much broken right now.
637 2020-09-24T21:35:18  *** S3RK has quit IRC
638 2020-09-24T21:39:11  *** kexkey has quit IRC
639 2020-09-24T21:41:15  *** kexkey has joined #bitcoin-core-dev
640 2020-09-24T21:42:40  *** proofofkeags has quit IRC
641 2020-09-24T21:43:52  *** proofofkeags has joined #bitcoin-core-dev
642 2020-09-24T21:46:54  *** S3RK has joined #bitcoin-core-dev
643 2020-09-24T21:49:35  <roconnor> ... I've been scrambling to recompile my entire system with gcc 8...
644 2020-09-24T21:49:47  <roconnor> I don't know if I'm being too paranoid...
645 2020-09-24T21:49:59  <real_or_random> idk, this bug seems scary at first glance but maybe if the scope is indeed limited, it's just one of hundreds of bugs in GCC.
646 2020-09-24T21:51:13  <roconnor> real_or_random: If I figure out that you are right that GCC's miscompiling its own string_length function, I am definitely going to recompile my system.
647 2020-09-24T21:51:16  *** S3RK has quit IRC
648 2020-09-24T21:51:29  *** kristapsk has joined #bitcoin-core-dev
649 2020-09-24T21:51:49  <roconnor> I am not waiting for the outcome of such a mess.
650 2020-09-24T21:53:02  *** S3RK has joined #bitcoin-core-dev
651 2020-09-24T21:53:16  <elichai2> roconnor: I'm thinking of recompiling with clang
652 2020-09-24T21:57:49  *** S3RK has quit IRC
653 2020-09-24T22:08:51  *** kexkey has quit IRC
654 2020-09-24T22:09:06  *** S3RK has joined #bitcoin-core-dev
655 2020-09-24T22:10:23  *** vasild has quit IRC
656 2020-09-24T22:10:29  *** promag has quit IRC
657 2020-09-24T22:11:23  *** promag has joined #bitcoin-core-dev
658 2020-09-24T22:11:56  *** vasild has joined #bitcoin-core-dev
659 2020-09-24T22:12:19  *** marcoagner has quit IRC
660 2020-09-24T22:13:10  *** kexkey has joined #bitcoin-core-dev
661 2020-09-24T22:14:02  *** S3RK has quit IRC
662 2020-09-24T22:23:26  *** shesek has joined #bitcoin-core-dev
663 2020-09-24T22:23:26  *** shesek has joined #bitcoin-core-dev
664 2020-09-24T22:25:10  *** S3RK has joined #bitcoin-core-dev
665 2020-09-24T22:29:55  *** S3RK has quit IRC
666 2020-09-24T22:39:43  *** kexkey has quit IRC
667 2020-09-24T22:39:53  *** andreacab has quit IRC
668 2020-09-24T22:49:10  *** kexkey has joined #bitcoin-core-dev
669 2020-09-24T22:55:17  *** justanotheruser has quit IRC
670 2020-09-24T22:55:43  *** justanotheruser has joined #bitcoin-core-dev
671 2020-09-24T22:59:23  *** davterra has quit IRC
672 2020-09-24T22:59:54  *** kexkey has quit IRC
673 2020-09-24T23:00:53  *** kexkey has joined #bitcoin-core-dev
674 2020-09-24T23:05:30  *** kexkey has quit IRC
675 2020-09-24T23:05:58  *** go11111111111 has quit IRC
676 2020-09-24T23:06:51  *** troygiorshev has quit IRC
677 2020-09-24T23:30:06  *** kexkey has joined #bitcoin-core-dev
678 2020-09-24T23:49:51  <luke-jr> roconnor: I've been rebuilding my system as well, but with GCC 9 patched to never use the builtin memcmp
679 2020-09-24T23:50:27  <luke-jr> real_or_random: it's a bug that's higher-than-average risk to create security vulnerabilities
680 2020-09-24T23:51:01  <luke-jr> roconnor: real_or_random: what's this about string_length func?
681 2020-09-24T23:55:47  *** kexkey has quit IRC