New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 908474 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug

Blocked on:
issue 904337

Blocking:
issue 899438



Sign in to add a comment

Several executables depend on build directory path on Deterministic Linux (dbg) bot

Project Member Reported by thakis@chromium.org, Nov 26

Issue description

I made the Deterministic Linux (dbg) bot use two distinct build dirs (issue 899438). After that, several executables are different in the two build dirs:

app_shell_unittests                                                                                                                                              : DIFFERENT (unexpected): different size: 197669328 != 197669336


Full list:

    'app_shell_unittests',
    'browser_tests',
    'chrome',
    'chrome_app_unittests',
    'components_browsertests',
    'components_unittests',
    'content_browsertests',
    'content_shell',
    'crashpad_tests',
    'extensions_browsertests',
    'extensions_unittests',
    'headless_browsertests',
    'headless_unittests',
    'interactive_ui_tests',
    'libboringssl.so',
    'libcrashpad_snapshot_test_module.so',
    'libcrashpad_snapshot_test_module_large.so',
    'libcrashpad_snapshot_test_module_small.so',
    'libheadless.so',
    'performance_browser_tests',
    'sync_integration_tests',
    'unit_tests',


It's much less than "everything" (no base_unittests, no wtf_unittests, ...). Need to figure out what the common thing is and fix.

 
Looks like it might be targets with assembly code?
sadface.png
488 KB View Download
libboringssl.so
sadface.png
532 KB View Download
thakis@thakis:~/src/chrome/src$ cat test.S
.global _start
.text
_start:
  movq $60, %rax
  movq $0, %rdi
  syscall
thakis@thakis:~/src/chrome/src$ third_party/llvm-build/Release+Asserts/bin/clang -c test.S -g
thakis@thakis:~/src/chrome/src$ readelf --debug-dump test.o | grep comp_dir
    <27>   DW_AT_comp_dir    : /usr/local/google/home/thakis/src/chrome/src
    DW_AT_comp_dir     DW_FORM_string


thakis@thakis:~/src/chrome/src$ third_party/llvm-build/Release+Asserts/bin/clang -c test.S -g -Xclang -fdebug-compilation-dir -Xclang .
thakis@thakis:~/src/chrome/src$ readelf --debug-dump test.o | grep comp_dir
    <27>   DW_AT_comp_dir    : /usr/local/google/home/thakis/src/chrome/src
    DW_AT_comp_dir     DW_FORM_string

In regular clang: http://llvm-cs.pcc.me.uk/tools/clang/lib/CodeGen/CGDebugInfo.cpp#435 (click through to getCurrentDirName(); that's controlled by -fdebug-compilation-dir).

cc1as does attempt to do something here: http://llvm-cs.pcc.me.uk/tools/clang/tools/driver/cc1as_main.cpp#234

But apparently it has no effect or something.
With this:

thakis@thakis:~/src/llvm-rw/tools/clang$ svn diff
Index: lib/Driver/ToolChains/Clang.cpp
===================================================================
--- lib/Driver/ToolChains/Clang.cpp	(revision 348502)
+++ lib/Driver/ToolChains/Clang.cpp	(working copy)
@@ -2152,6 +2152,9 @@
           }
           CmdArgs.push_back(Value.data());
           TakeNextArg = true;
+      } else if (Value == "-fdebug-compilation-dir") {
+        CmdArgs.push_back("-fdebug-compilation-dir");
+        TakeNextArg = true;
       } else {
         D.Diag(diag::err_drv_unsupported_option_argument)
             << A->getOption().getName() << Value;




thakis@thakis:~/src/chrome/src$ ~/src/llvm-build/bin/clang -c test.S -g -Wa,-fdebug-compilation-dir,. 
thakis@thakis:~/src/chrome/src$ readelf --debug-dump test.o | grep comp_dir
    <27>   DW_AT_comp_dir    : .
    DW_AT_comp_dir     DW_FORM_string


This works too:

thakis@thakis:~/src/chrome/src$ ~/src/llvm-build/bin/clang -c test.S -g -Xassembler -fdebug-compilation-dir -Xassembler . 

Blockedon: 904337
Project Member

Comment 9 by bugdroid1@chromium.org, Dec 21

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

commit 6034a79972f03feb497d26666c2fc745aa996949
Author: Nico Weber <thakis@chromium.org>
Date: Fri Dec 21 15:59:16 2018

Pass -fdebug-compilation-dir to assembler invocations too.

Now that we rolled in a clang that understands this flag in cc1as mode,
use it.

Also roll openmax_dl by one revision to bring in
https://webrtc.googlesource.com/deps/third_party/openmax/+/3b18bf8338abb

TBR=dpranke

Bug:  908474 
Change-Id: Ifdcf84f4be6d9a9d9adf374e284b8b2840241b58
Reviewed-on: https://chromium-review.googlesource.com/c/1388544
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618541}
[modify] https://crrev.com/6034a79972f03feb497d26666c2fc745aa996949/DEPS
[modify] https://crrev.com/6034a79972f03feb497d26666c2fc745aa996949/build/config/BUILDCONFIG.gn
[modify] https://crrev.com/6034a79972f03feb497d26666c2fc745aa996949/build/config/compiler/BUILD.gn

Cc: mamir@chromium.org szager@chromium.org yhirano@chromium.org ramyan@chromium.org uwyiming@chromium.org
 Issue 913204  has been merged into this issue.
Cc: ellyjo...@chromium.org robert...@chromium.org
 Issue 914776  has been merged into this issue.
Project Member

Comment 12 by bugdroid1@chromium.org, Dec 21

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

commit b9617d54466f4cfcf3fccb810b47361a17911c5c
Author: Nico Weber <thakis@chromium.org>
Date: Fri Dec 21 19:13:44 2018

Linux Deterministic (dbg): Update whitelist after cc1as fix.

Removes binaries from the whitelist that are now build-directory-independent.

Bug:  908474 
Change-Id: Ifd133be66ae4d693fd355cf26bb3be8ca5e44474
Reviewed-on: https://chromium-review.googlesource.com/c/1388553
Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#618567}
[modify] https://crrev.com/b9617d54466f4cfcf3fccb810b47361a17911c5c/tools/determinism/deterministic_build_whitelist.pyl

Status: Fixed (was: Assigned)

Sign in to add a comment