Skip to content

[wasm] nodejs on windows doesn't flush stdout/stderr streams on exit - with the consolewasm template #70675

Closed

Description

@radical

This happens in Debug, And Release, though now always in both. It is being hit on PRs, and rolling builds. Log:

 Wasm.Build.Tests.WasmTemplateTests.ConsolePublishAndRun(config: "Debug", aot: True) [FAIL]
      Assert.Contains() Failure
      Not found: args[0] = x
      In value:  [Debug_0ptsa3o0.ug5] WasmAppHost --runtime-config C:\helix\work\workitem\e\Debug_0ptsa3o0.ug5\bin\Debug\net7.0\browser-wasm\AppBundle\/Debug_0ptsa3o0.ug5.runtimeconfig.json --setenv=MONO_LOG_MASK=aot --setenv=MONO_LOG_LEVEL=debug x y z
                 [Debug_0ptsa3o0.ug5] [21:10:13] info: host[0] Running: C:\helix\work\correlation\build\emsdk-node/14.18.2_64bit/bin\node.exe main.cjs --setenv=MONO_LOG_MASK=aot --setenv=MONO_LOG_LEVEL=debug x y z
                 [Debug_0ptsa3o0.ug5] [21:10:13] dbug: host[0] Using working directory: C:\helix\work\workitem\e\Debug_0ptsa3o0.ug5\bin\Debug\net7.0\browser-wasm\AppBundle
                 [Debug_0ptsa3o0.ug5] [21:10:13] info: host[0] Incoming arguments: --setenv=MONO_LOG_MASK=aot --setenv=MONO_LOG_LEVEL=debug x y z
                 [Debug_0ptsa3o0.ug5] [21:10:13] info: host[0] Application arguments: x y z
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] Found statically linked AOT module 'System.Private.CoreLib'.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Private.CoreLib wants to load image 0: System.Private.CoreLib
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: image 'System.Private.CoreLib' found.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper managed-to-native) object:__icall_wrapper_mono_threads_state_poll () [0x2a62 - 0x2a63 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper managed-to-native) object:__icall_wrapper_mini_llvmonly_init_vtable_slot (intptr,int) [0x6d - 0x6e 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper managed-to-native) object:__icall_wrapper_mono_helper_ldstr_mscorlib (int) [0x246 - 0x247 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper managed-to-native) object:__icall_wrapper_mono_fill_method_rgctx (intptr,int) [0x2a11 - 0x2a12 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper managed-to-native) object:__icall_wrapper_mono_fill_class_rgctx (intptr,int) [0x1d6 - 0x1d7 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.OutOfMemoryException:.ctor (string) [0xb68 - 0xb69 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.NullReferenceException:.ctor (string) [0xa8b - 0xa8c 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.StackOverflowException:.ctor (string) [0xe4e - 0xe4f 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.AppContext:Setup (char**,char**,int) [0x63b - 0x63c 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper other) object:gsharedvt_out_sig (object&,object&,int&,intptr) [0x2b34 - 0x2b35 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Collections.Generic.EqualityComparer`1:CreateComparer () [0x20d8 - 0x20d9 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Collections.HashHelpers:.cctor () [0x2066 - 0x2067 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper other) object:gsharedvt_out_sig (intptr) [0x2b36 - 0x2b37 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Collections.Generic.NonRandomizedStringEqualityComparer:.cctor () [0x2182 - 0x2183 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.OrdinalIgnoreCaseComparer:.cctor () [0xe65 - 0xe66 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.OrdinalCaseSensitiveComparer:.cctor () [0xe5f - 0xe60 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Type:.cctor () [0x607 - 0x608 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Type/<>c:.cctor () [0x608 - 0x609 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Reflection.Missing:.cctor () [0x1bca - 0x1bcb 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Array/EmptyArray`1:.cctor () [0x326 - 0x327 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Type:FilterAttributeImpl (System.Reflection.MemberInfo,object) [0x605 - 0x606 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper delegate-invoke) <Module>:invoke_bool_MemberInfo_object (System.Reflection.MemberInfo,object) [0x2a8b - 0x2a8c 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Type/<>c:<.cctor>b__287_0 (System.Reflection.MemberInfo,object) [0x60a - 0x60b 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Type/<>c:<.cctor>b__287_1 (System.Reflection.MemberInfo,object) [0x60b - 0x60c 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.RuntimeType:IsAssignableFrom (System.Type) [0x4d7 - 0x4d8 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.RuntimeType:.cctor () [0x4db - 0x4dc 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.RuntimeType:get_UnderlyingSystemType () [0x4be - 0x4bf 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper stelemref) object:virt_stelemref_class_small_idepth (intptr,object) [0x29d5 - 0x29d6 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Reflection.ConstructorInfo:.cctor () [0x1b7f - 0x1b80 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper stelemref) object:virt_stelemref_sealed_class (intptr,object) [0x29d3 - 0x29d4 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Reflection.MethodBase:GetParametersNoCopy () [0x1a40 - 0x1a41 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Reflection.RuntimeConstructorInfo:GetParametersInternal () [0x1afc - 0x1afd 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Array:Resize<T> (T[]&,int) [0x314 - 0x315 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Reflection.RuntimeConstructorInfo:get_Attributes () [0x1b00 - 0x1b01 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Collections.Generic.GenericEqualityComparer`1:.ctor () [0x212d - 0x212e 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Collections.Generic.Dictionary`2:Add (TKey,TValue) [0x20f9 - 0x20fa 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.ThrowHelper:ThrowAddingDuplicateWithKeyArgumentException<T> (T) [0xe81 - 0xe82 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Collections.Generic.NonRandomizedStringEqualityComparer/OrdinalComparer:GetHashCode (string) [0x2185 - 0x2186 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] Found statically linked AOT module 'System.Private.Runtime.InteropServices.JavaScript'.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Private.Runtime.InteropServices.JavaScript wants to load image 0: System.Private.Runtime.InteropServices.JavaScript
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Private.Runtime.InteropServices.JavaScript wants to load image 1: System.Private.CoreLib
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Private.Runtime.InteropServices.JavaScript wants to load image 2: System.Private.Uri
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] Found statically linked AOT module 'System.Private.Uri'.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Private.Uri wants to load image 0: System.Private.Uri
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Private.Uri wants to load image 1: System.Private.CoreLib
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: image 'System.Private.Uri' found.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: image 'System.Private.Runtime.InteropServices.JavaScript' found.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] Could not find symbols file dotnet.js.symbols. Ignoring.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] Initializing.....
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] Found statically linked AOT module 'Debug_0ptsa3o0.ug5'.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module Debug_0ptsa3o0.ug5 wants to load image 1: Debug_0ptsa3o0.ug5
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module Debug_0ptsa3o0.ug5 wants to load image 0: System.Private.CoreLib
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module Debug_0ptsa3o0.ug5 wants to load image 2: System.Console
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] Found statically linked AOT module 'System.Console'.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Console wants to load image 0: System.Console
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Console wants to load image 1: System.Private.CoreLib
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: image 'System.Console' found.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: image 'Debug_0ptsa3o0.ug5' found.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] Found statically linked AOT module 'System.Runtime'.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Runtime wants to load image 1: System.Runtime
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: module System.Runtime wants to load image 0: System.Private.CoreLib
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: image 'System.Runtime' found.
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method Program:<Main>$ (string[]) [0x5 - 0x6 0x1348]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method (wrapper other) object:gsharedvt_out_sig (object&,intptr) [0x2b0a - 0x2b0b 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Console:WriteLine (string) [0x85 - 0x86 0x41e0]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Runtime.CompilerServices.DefaultInterpolatedStringHandler:ToStringAndClear () [0x1e0 - 0x1e1 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Runtime.CompilerServices.DefaultInterpolatedStringHandler:AppendFormatted (string) [0x1df - 0x1e0 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Runtime.CompilerServices.DefaultInterpolatedStringHandler:AppendLiteral (string) [0x1de - 0x1df 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Runtime.CompilerServices.DefaultInterpolatedStringHandler:AppendFormatted<T_INT> (T_INT) [0x21c4 - 0x21c5 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Runtime.CompilerServices.DefaultInterpolatedStringHandler:.ctor (int,int) [0x1dd - 0x1de 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Buffers.ArrayPool`1<T_CHAR>:.cctor () [0x2391 - 0x2392 0x54188]
                 [Debug_0ptsa3o0.ug5] [21:10:22] info: host[0] [MONO] AOT: FOUND method System.Buffers.TlsOverPerCoreLockedStacksArrayPool`1<T_CHAR>:.ctor () [0x2398 - 0x2399 0x54188]

Activity

  1. self-assigned this
    on Jun 13, 2022
  2. ghost added
    untriaged
    on Jun 13, 2022
  3. added
    blocking-clean-ci
    and removed
    untriaged
    on Jun 13, 2022
  4. radical commented on Jun 16, 2022

    @radical
    MemberAuthor

    The issue here is as described in #70704 . nodejs is exiting before stdout/stderr have been completely flushed out.

    • The fix there didn't work on CI, though it works locally on windows.
    • But we maybe want to do the flush part in a different place, like before we call exit(..). And/or maybe rework/fix how exiting is handled.

    cc @lewing

  5. assigned and unassigned on Jun 16, 2022
  6. changed the title [-][wasm] `Wasm.Build.Tests.WasmTemplateTests.ConsolePublishAndRun` fails on CI, for AOT/Windows[/-] [+][wasm] nodejs on windows doesn't flush `stdout/stderr` streams on exit - with the `consolewasm` template[/+] on Jun 16, 2022
  7. added a commit that references this issue on Jun 23, 2022
  8. ghost added
    in-pr
    on Jun 29, 2022
  9. ghost removed
    in-pr
    on Jun 30, 2022
  10. ghost locked as resolved and limited conversation to collaborators on Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-VM-meta-monoblocking-clean-citest-failure

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions