[wasm][aot] Link step failing for Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests - wasm-opt getting killed #51961
Copy link
Copy link
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-Codegen-AOT-monowasm-aot-testWebAssembly AOT TestWebAssembly AOT Test
Milestone
Description
Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests, log
emcc : error : '/datadisks/disk1/work/B7A309CE/p/build/emsdk/upstream/bin/wasm-opt --post-emscripten --no-exit-runtime -O2 --low-memory-unused --zero-filled-memory --strip-producers /datadisks/disk1/work/B7A309CE/w/B09909A9/e/wasm_build/obj/wasm/for-build/dotnet.wasm -o /datadisks/disk1/work/B7A309CE/w/B09909A9/e/wasm_build/obj/wasm/for-build/dotnet.wasm -g --mvp-features --enable-mutable-globals'
failed (received SIGKILL (-9)) [/datadisks/disk1/work/B7A309CE/w/B09909A9/e/publish/ProxyProjectForAOTOnHelix.proj]
[ 2582.708542] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/helix.service,task=wasm-opt,pid=19587,uid=1000
[ 2582.708558] Out of memory: Killed process 19587 (wasm-opt) total-vm:7377176kB, anon-rss:7254096kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:14340kB oom_score_adj:0
[ 2582.925546] oom_reaper: reaped process 19587 (wasm-opt), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
The binlog should have details of why this failed. The binlog is included in the helix data.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-Codegen-AOT-monowasm-aot-testWebAssembly AOT TestWebAssembly AOT Test
Activity
vargaz commentedon May 6, 2021
This probably happens because the code is just too big.
radical commentedon Jun 10, 2021
The current failure:
[-][wasm][aot] `wasm-opt` fails for `System.Text.Json.Tests`[/-][+][wasm][aot] `wasm-ld` fails for `System.Text.Json.Tests`[/+]lewing commentedon Jun 28, 2021
This should be fixed by #53603 and the flto changes
27 remaining items
directhex commentedon Jan 20, 2022
Okay. Findings:
wasm-opt, requires more memory than Clang - 8.5 gig.vargaz commentedon Jan 20, 2022
The problem is AOTing roslyn, a linked Microsoft.CodeAnalysis.CSharp.dll still contains 30k methods, AOT creates 80k methods out of this because roslyn contains a lot of valuetypes causing a lot of generic instances to be added, running the aot compiler on this assembly alone takes 40 seconds, the .bc -> .o step takes 10 minutes (!).
vargaz commentedon Jan 20, 2022
We might want to add some functionality to the build system to exclude certain assemblies like roslyn from AOTing.
radical commentedon Jan 20, 2022
We do have that, as a hack (https://github.com/dotnet/runtime/blob/main/src/tasks/AotCompilerTask/MonoAOTCompiler.cs#L488-L489).
directhex commentedon Jan 20, 2022
So what's the play, try to shoehorn the test as-is onto Helix, or try to wire up the AOT skip?
vargaz commentedon Jan 20, 2022
I'd suggest skipping AOTing for these assemblies, they take forever to AOT which also impacts CI performance even if it works.
directhex commentedon Jan 21, 2022
I skipped AOT, and I have no idea how to parse this failure https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-63958-merge-c3e46af019234e5a83/normal-Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests/1/console.0b1eb581.log?sv=2019-07-07&se=2022-02-10T15%3A15%3A41Z&sr=c&sp=rl&sig=uuwgEA0aSi%2BkNV%2BWkslo%2FBLzkvgx4guydgtVeRkyidQ%3D
directhex commentedon Jan 21, 2022
Failure is at
runtime/src/mono/mono/mini/aot-runtime.c
Lines 2300 to 2303 in 9c8b804
vargaz commentedon Jan 24, 2022
Is there a PR which skips the AOT step for these assemblies ?
vargaz commentedon Jan 24, 2022
An alternative would be compiling with O1, i.e.:
Running with this reduced the total runtime from 16 minutes to 11 minutes on my machine, it might solve the OOM problem as well.
directhex commentedon Jan 24, 2022
vargaz commentedon Jan 25, 2022
#64294
elinor-fung commentedon Feb 17, 2022
@directhex @radical - the latest rolling build (which has #63958) still hit this.
Still looks to be an OOM, but I don't know how to get more information about the exact cause.