electron: SCCache race condition hampers *.debug file correctness

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • Tested on v10.0.0-nightly.20200408
  • Operating System:
    • Linux any
  • Last Known Working Electron version:
    • None

Expected Behavior

Compile object output should be correct. Screen Shot 2020-04-19 at 22 51 23

Actual Behavior

While testing for Linux reproducibility I ran into an issue where build-id and debug link production section of Linux x64 binaries where randomic at each build. Screen Shot 2020-04-15 at 15 53 38

Checking at the relative debug file I noted that .strtab and .debug_str sections where of different size. Checking inside it was clear some symbol was messed up, expecially the mojom ones. Screen Shot 2020-04-16 at 13 49 41

Since it was not clear why this was happening I run diffoscope on the out directory. This revealed that some .cc object output where going in wrong .o. Screen Shot 2020-04-18 at 12 27 52 . For example some A.cc was finishing in B.cc output B.o. So B.o was present twice, while A.o was never present in the final binary.

Since I did not know what was causing these files output to be messed up I runned multiple tests on filesystem/linker/sccache. I finally triaged the problem and it seems to be related to a newly discovered race condition in sccache on Linux platform.

This can be verified running a multiple builds with sccache disabled. In these case the output is not only deterministic, but it also have correct objects in correct locations. Screen Shot 2020-04-19 at 22 51 23

Cc: @nornagon @ikkisoft @jkleinsc

To Reproduce

Some files will have wrong .o output.

Additional Information

This is the last issue we have on Linux platform to obtain reproducibility on all major platforms on electron (macOS, Windows, Linux). While this issue is affecting the reproducibility, incorrect sccache behaviour may affect strongly electron stability and hamper the ability use the crash reports the users are sending.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (23 by maintainers)

Commits related to this issue

Most upvoted comments

I’m testing using a newer version of sccache in #23202 to see if that resolves the issue.