[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-07-08 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 closed https://github.com/llvm/llvm-project/pull/96356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-07-03 Thread Volodymyr Sapsai via cfe-commits
https://github.com/vsapsai approved this pull request. https://github.com/llvm/llvm-project/pull/96356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-07-03 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Looked at this more and haven't found anything sketchy. `ASTWriter::WriteHeaderSearch` writes the same content both with and without `-fno-modules-prune-non-affecting-module-map-files`. `Preprocessor::alreadyIncluded` is called in reasonable places (as for me, ASTWriter is the

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-07-02 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: Ping @vsapsai. https://github.com/llvm/llvm-project/pull/96356 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-06-28 Thread Jan Svoboda via cfe-commits
jansvoboda11 wrote: > My main concern with this approach is I'm not sure that after fixing the > memory issue we don't have a remaining logic bug. Because we are still > modifying `ModuleMap::Headers` during `ASTWriter::WriteHeaderSearch` > iteration and that looks suspicious. Need to think ho

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-06-27 Thread Volodymyr Sapsai via cfe-commits
vsapsai wrote: Non-representative check for changes in the memory consumption doesn't show anything interesting for the added test case. Maximum resident set size and peak memory footprint with the change and without it are pretty close to each other, no statistic, just eyeballing. My main co

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-06-21 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Jan Svoboda (jansvoboda11) Changes With the pruning of unused module map files disabled (`-fno-modules-prune-non-affecting-module-map-files`), `HeaderFileInfo` no longer gets deserialized before `ASTWriter::WriteHeaderSearch()`. T

[clang] [clang][modules] Fix use-after-free in header serialization (PR #96356)

2024-06-21 Thread Jan Svoboda via cfe-commits
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/96356 With the pruning of unused module map files disabled (`-fno-modules-prune-non-affecting-module-map-files`), `HeaderFileInfo` no longer gets deserialized before `ASTWriter::WriteHeaderSearch()`. This functio