Bug 232000 - Apple-Win-10-Release-Build failing due to vc142.pdb write lock
Summary: Apple-Win-10-Release-Build failing due to vc142.pdb write lock
Status: CLOSED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-19 20:45 PDT by Jed Spraul
Modified: 2021-10-20 04:55 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.32 KB, patch)
2021-10-19 21:00 PDT, Jed Spraul
Hironori.Fujii: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jed Spraul 2021-10-19 20:45:48 PDT
Apple-Win-10-Release-Build failing due to vc142.pdb write lock
Comment 1 Jed Spraul 2021-10-19 21:00:10 PDT
Created attachment 441845 [details]
Patch
Comment 2 Jed Spraul 2021-10-19 21:57:40 PDT
Apple-Win-10-Release-Build has failed for 8+ days with an error similar to the following (seeming on random .cpp files, this from the first failed build of ~350 so far - build 6109):

fatal error C1041: cannot open program database 'C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Tools\TestWebKitAPI\TestWebCoreLib.dir\Release\vc142.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS [C:\cygwin\worker\win10-release\build\WebKitBuild\Release\Tools\TestWebKitAPI\TestWebCoreLib.vcxproj]

The output doesn't appear to be categorized by the buildbot as an error.

As far as a patch, I added the /FS option to the same line turning on the PDB generation. Even the documentation states this might not solve the problem, but it could be the simplest fix. In any case, it may be hard to recreate what's happening on buildbot on a developer's machine.

I only spot-checked a handful of the failed builds, but it seemed like this was primarily an issue in the TestWebCoreLib project, so a fix may only be necessary for that one project rather than across all projects. In addition, the Apple-Win-10-Debug-Build build hasn't been affected, so a Release-only tweak may be enough.

It wasn't clear why the error began occurring either, perhaps some configuration change on the buildbot.

Research:

 https://stackoverflow.com/questions/20643370/visual-studio-2013-fatal-error-c1041-fs

  - the proper solution is per-project intermediate file output directories
  - file locks may be caused by other software, such as antivirus/backup
  - fix had to be applied to all projects for several
  - 1 claim that /FS must also be passed to the linker, doesn't make sense
  - could disable parallel build (slow) or enable in-obj symbols (large)
  - the MSPDBSRV.EXE sync process used by /FS can get wedged
  - some file(s) may become corrupted (especially PDB?), requiring deleting build files, not an issue on a clean build

 https://docs.microsoft.com/en-us/cpp/build/reference/fs-force-synchronous-pdb-writes

  - /FS syncs PDB writes through MSPDBSRV.EXE, longer builds + doesn't prevent all errors
  - recommend separate intermediate and output locations for all projects
  - /MP (not-Ninja per OptionsMSVC.cmake) enables /FS
Comment 3 Fujii Hironori 2021-10-19 23:01:09 PDT
We had a discussion in WebKit Slack today.
https://webkit.slack.com/archives/CU64U6FDW/p1634674617427300
Because AppleWin EWS doesn't have this issue, we should try clean build at first.
Comment 4 Fujii Hironori 2021-10-19 23:43:56 PDT
The AppleWin bot (bot548) got back to normal.
https://build.webkit.org/#/builders/67/builds/6460

Ryan Haddad said:
> Looks like my manual intervention worked.
Comment 5 Fujii Hironori 2021-10-20 00:06:55 PDT
Comment on attachment 441845 [details]
Patch

I think we no longer need this patch.
Comment 6 Jed Spraul 2021-10-20 04:55:13 PDT
👍