New issue
Advanced search Search tips

Issue 645544 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 82385



Sign in to add a comment

Regression: SafeBrowsingModuleVerifierWinTest.VerifyModuleRelocOverlap broken on 32-bit win after clang roll

Project Member Reported by thakis@chromium.org, Sep 9 2016

Issue description

Started failing here: https://build.chromium.org/p/chromium.fyi/builders/CrWinClang%28shared%29%20tester/builds/7043

SafeBrowsingModuleVerifierWinTest.VerifyModuleRelocOverlap (run #1):
[ RUN      ] SafeBrowsingModuleVerifierWinTest.VerifyModuleRelocOverlap
../../chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc(307): error: Value of: VerifyModule(kTestDllNames[0], &state, &num_bytes_different)
  Actual: false
Expected: true

I only see the clang roll as related change :-(
 

Comment 1 by r...@chromium.org, Sep 9 2016

Probably related to  http://crbug.com/480546 
Cc: grt@chromium.org
cc'ing grt from that other bug...

Comment 3 by r...@chromium.org, Sep 9 2016

I reproduced it locally, but I still don't understand it.

Comment 4 by r...@chromium.org, Sep 9 2016

OK, so it's another instance of the same kind of issue. DummyExport is < 256 bytes, and the test modifies 256 bytes of code, which runs into DllMain, and that causes the test to crash.

I don't know why the clang roll regresses things, but if I generate > 256 bytes of code in DummyExport, it's OK.

Comment 5 by r...@chromium.org, Sep 9 2016

My first local fix was to have 27 volatile stores, each of which is 5 bytes, so it made 260 bytes of code.

This failed flakily 25% of the time with the message:

[ RUN      ] SafeBrowsingModuleVerifierWinTest.VerifyModuleRelocOverlap
../../chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc(312): error: Value of: num_bytes_different
  Actual: 206
Expected: kModificationSize
Which is: 256
[  FAILED  ] SafeBrowsingModuleVerifierWinTest.VerifyModuleRelocOverlap (10 ms)

I replaced my run of stores with 256 calls to __nop, and the problem went away. This apparently has to do with the distance between relocations, which the test is sensitive to. I don't know why it's non-deterministic, but I've found a determinstic solution, so I'm sending that out.

Comment 6 by r...@chromium.org, Sep 9 2016

I still don't know what's different about our binaries that is causing DllMain to run in the test DLL. Maybe MSVC's code for DllMain increments to something "safe", like RET, coincidentally.
Could the nondeterminism be due to link.exe /INCREMENTAL?

Comment 8 by r...@chromium.org, Sep 9 2016

I'm not rebuilding between re-running, though, I'm just using --`gtest_repeat=200 | grep FAILURE.*stuff | wc -l`
Project Member

Comment 9 by bugdroid1@chromium.org, Sep 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/38eb7adb1ff6ab5d5151fd47bf251e12da7db0e2

commit 38eb7adb1ff6ab5d5151fd47bf251e12da7db0e2
Author: rnk <rnk@chromium.org>
Date: Mon Sep 12 15:27:57 2016

Fix module verifier test by padding out DummyExport with 256 bytes of nops

The test increments 256 bytes of code starting from the beginning
of the DLL, and if we don't pad out DummyExport, it will modify DllMain,
which can run when a thread starts.

R=grt@chromium.org,thakis@chromium.org
BUG= 645544 

Review-Url: https://codereview.chromium.org/2327193002
Cr-Commit-Position: refs/heads/master@{#417944}

[modify] https://crrev.com/38eb7adb1ff6ab5d5151fd47bf251e12da7db0e2/chrome/browser/safe_browsing/incident_reporting/verifier_test/verifier_test_dll.cc

Sign in to add a comment