|
|
Created:
3 years, 6 months ago by Guido Urdaneta Modified:
3 years, 6 months ago CC:
chromium-reviews, mlamouri+watch-content_chromium.org, imcheng+watch_chromium.org, feature-media-reviews_chromium.org, posciak+watch_chromium.org, chfremer+watch_chromium.org, jam, avayvod+watch_chromium.org, darin-cc_chromium.org, jasonroberts+watch_google.com, xjz+watch_chromium.org, isheriff+watch_chromium.org, miu+watch_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionUpdate MediaStreamConstraintsAudioUtil unit tests.
Use array elements instead of pointer values in comparisons involving
pointers to member functions.
One of these comparisons failed on Windows Debug and others are suspect
of failing on WinClang DLL builds.
BUG=736309
Review-Url: https://codereview.chromium.org/2958543002
Cr-Commit-Position: refs/heads/master@{#481932}
Committed: https://chromium.googlesource.com/chromium/src/+/964d2c65e8b24f15ddaeb18429b5ce1d3469d445
Patch Set 1 #
Messages
Total messages: 17 (10 generated)
The CQ bit was checked by guidou@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
guidou@chromium.org changed reviewers: + rnk@chromium.org
Hi, PTAL
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Update MediaStreamConstraintsAudioUtil unit tests. Use array elements instead of pointer values in comparisons involving pointers to member functions. One of these comparisons failed on Windows Debug and others are suspect of failing on WinClang DLL builds. BUG=736309 ========== to ========== Update MediaStreamConstraintsAudioUtil unit tests. Use array elements instead of pointer values in comparisons involving pointers to member functions. One of these comparisons failed on Windows Debug and others are suspect of failing on WinClang DLL builds. BUG=736309 ==========
rnk@chromium.org changed reviewers: + hans@chromium.org
In general, I think relying function pointer and member pointer equality is risky. I know of two things that can make it go wrong: DLLs and ICF. I haven't figured out exactly what's happening here yet. ICF (identical code/comdat folding) will merge identical inline functions, so pointers to similar functions will compare equal at runtime. Yes, this is non-conforming, but it's valuable enough that MSVC does it anyway. This is enabled in Chrome release builds, and is probably not at fault here. For DLLs, the Windows loader does not coalesce multiple symbols with the same name across multiple DLLs. That's just not something it does. So, if you take the address of the same inline function in two DLLs and pass them around, they will not compare equal. The only way to make function pointer equality work is if you pin the function to a particular DLL with dllexport/dllimport. That might be the issue here, but it doesn't seem like it because all your member pointers and comparisons seem to originate from the unit test file. It's entirely possible that clang is doing something wrong here and we're making the problem worse, but in general, we know function pointer equality doesn't work well. I would recommend steering away from member function pointer equality checks in the future.
lgtm, let's try this.
The CQ bit was checked by rnk@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 1, "attempt_start_ts": 1498236676404340, "parent_rev": "834eaab8e927945d5b0d9bb60282a1733d50256f", "commit_rev": "964d2c65e8b24f15ddaeb18429b5ce1d3469d445"}
Message was sent while issue was closed.
Description was changed from ========== Update MediaStreamConstraintsAudioUtil unit tests. Use array elements instead of pointer values in comparisons involving pointers to member functions. One of these comparisons failed on Windows Debug and others are suspect of failing on WinClang DLL builds. BUG=736309 ========== to ========== Update MediaStreamConstraintsAudioUtil unit tests. Use array elements instead of pointer values in comparisons involving pointers to member functions. One of these comparisons failed on Windows Debug and others are suspect of failing on WinClang DLL builds. BUG=736309 Review-Url: https://codereview.chromium.org/2958543002 Cr-Commit-Position: refs/heads/master@{#481932} Committed: https://chromium.googlesource.com/chromium/src/+/964d2c65e8b24f15ddaeb18429b5... ==========
Message was sent while issue was closed.
Committed patchset #1 (id:1) as https://chromium.googlesource.com/chromium/src/+/964d2c65e8b24f15ddaeb18429b5...
Message was sent while issue was closed.
I've debugged this a bit. It's definitely a clang bug. We've fixed one like it before. I'll file it and update this for the curious.
Message was sent while issue was closed.
On 2017/06/23 17:31:52, Reid Kleckner wrote: > I've debugged this a bit. It's definitely a clang bug. We've fixed one like it > before. I'll file it and update this for the curious. Filed as https://bugs.llvm.org/show_bug.cgi?id=33570 |