[PATCH] D102713: [PDB] Improve error handling when writes fail
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 18 16:05:01 PDT 2021
rnk added a comment.
In D102713#2767094 <https://reviews.llvm.org/D102713#2767094>, @aganea wrote:
> We had similar OOM issues on the bots, as mentionned in the two bug reports. Regarding https://bugs.chromium.org/p/chromium/issues/detail?id=1179085, if you're using `/DEBUG:GHASH` the following patch might fix it? (but still generates > 4 GB .PDBs, which is probably a merging bug)
>
> diff --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
> index fedcb054540f..8bd8723f4bf2 100644
> --- a/lld/COFF/DebugTypes.cpp
> +++ b/lld/COFF/DebugTypes.cpp
> @@ -1064,7 +1064,8 @@ void TypeMerger::mergeTypesWithGHash() {
>
> // Cap the table size so that we can use 32-bit cell indices. Type indices are
> // also 32-bit, so this is an inherent PDB file format limit anyway.
> - tableSize = std::min(size_t(INT32_MAX), tableSize);
> + tableSize =
> + std::min(size_t(INT32_MAX) - TypeIndex::FirstNonSimpleIndex, tableSize);
> ghashState.table.init(static_cast<uint32_t>(tableSize));
>
> // Insert ghashes in parallel. During concurrent insertion, we cannot observe
>
> The issue was that `source->indexMapStorage[i] = TypeIndex::fromArrayIndex(cellIdx);` would store invalid offsets since the high bit (`DecoratedItemIdMask`) is dismissed when doing `TypeIndex::toArrayIndex()`.
I see, I guess we do need that patch.
I thought I was using ghashing, but it turned out I wasn't. I switched to ghash, and things got faster, even without ghashes in object files. This has given me motivation to make ghashing the default type merging strategy. I'll have to follow up on that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102713/new/
https://reviews.llvm.org/D102713
More information about the llvm-commits
mailing list