Skip to content

[wasm] improve startup - #72275

Merged
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup
Jul 26, 2022
Merged

[wasm] improve startup#72275
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Jul 15, 2022

Copy link
Copy Markdown
Member

streaming wasm instantiation, more parallel download of DLLs

and other goodnes seen in Blazor

  • new hook downloadResource?: (request: ResourceRequest) => LoadingResource allows Blazor to delegate the details to runtime while keeping the caching responsibility.
  • existing config.assets could now have resolvedUrl and pending response. That's blazor could tell us what to load and also provide pending cache promise.
  • made emsripten events async, our callbacks are called in correct order and block on previous one before the next is started.
  • improved log messages
  • load assets into memory as they arrive from network, avoiding memory allocation spike
  • run mono_wasm_pre_init_esential also in Blazor loader. This will fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. This will enable new [JSImport] for blazor.
  • locateFile is now used for all assets including mono-config.json. I also fixed scriptDirectory detection on all but v8+CJS. Therefore apps could be executed from different folder than is dotnet.js location. Credits to @yamachu
  • run init_crypto also on blazor startup sequence

Contributes to #70892
Contributes to #72810

@pavelsavarapavelsavara added this to the 7.0.0 milestone Jul 15, 2022
@pavelsavara
pavelsavara requested review from kg and marafJuly 15, 2022 16:09
@pavelsavarapavelsavara self-assigned this Jul 15, 2022
@pavelsavara
pavelsavara requested a review from lewing as a code ownerJuly 15, 2022 16:09
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • load assemblies into memory synchronously during onRuntimeInitialized because async user postRun run in parallel to each other and therefore can't use loaded assemblies yet. We will do the same in Blazor.
  • run mono_wasm_pre_init_esential also in Blazor loader. This will also fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. We will eliminate it from Blazor code.
Author:pavelsavara
Assignees:pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone:7.0.0

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

I tested with current and also future! Blazor

@lewing
lewing requested a review from lambdageekJuly 15, 2022 16:54
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara

This comment was marked as outdated.

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 8a1057f to d319c22CompareJuly 15, 2022 18:15
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jul 16, 2022

Copy link
Copy Markdown
MemberAuthor

This is the startup sequence for non-blazor

user code in createDotnetRuntime callback MONO_WASM: determined url of dotnet main script to be http://localhost:8000/
MONO_WASM: instantiateWasm MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.wasm' for dotnet.wasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit user code Module.preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_wasm_load_config MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: mono_download_assets MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Console.dll' for System.Console.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.CoreLib.dll' for System.Private.CoreLib.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.Uri.dll' for System.Private.Uri.dll MONO_WASM: instantiateWasm done MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.dll' for System.Runtime.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll' for System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll' for Wasm.Browser.ES6.Sample.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/supportFiles/0_runtimeconfig.bin' for supportFiles/0_runtimeconfig.bin MONO_WASM: Attempting to fetch 'http://localhost:8000/icudt.dat' for icudt.dat MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.timezones.blat' for dotnet.timezones.blat user code Module.preRun MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:System.Console.dll as assembly size 25088 from http://localhost:8000/managed/System.Console.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 1684992 from http://localhost:8000/managed/System.Private.CoreLib.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 80384 from http://localhost:8000/managed/System.Private.Uri.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 6144 from http://localhost:8000/managed/System.Runtime.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 31232 from http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:Wasm.Browser.ES6.Sample.dll as assembly size 17408 from http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll MONO_WASM: Loaded:supportFiles/0_runtimeconfig.bin as vfs size 950 from http://localhost:8000/supportFiles/0_runtimeconfig.bin MONO_WASM: Creating file 'runtimeconfig.bin' in directory '/' MONO_WASM: Loaded:icudt.dat as icu size 1503760 from http://localhost:8000/icudt.dat MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from http://localhost:8000/dotnet.timezones.blat MONO_WASM: Creating directory '/usr/share/zoneinfo' MONO_WASM: Creating file '' in directory '/usr/share/zoneinfo' MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file user code Module.onRuntimeInitialized MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime user code Module.postRun user code after createDotnetRuntime() MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:TestMeaning MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:IsPrime MONO_WASM: Binding [JSImport] Sample.Test.sub from null MONO_WASM: Binding [JSImport] Sample.Test.add from null meaning: 42 ret: 42 Hello, World! WASM EXIT 0 

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 657f65b to d2884fbCompareJuly 17, 2022 08:58
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from d2884fb to 2050175CompareJuly 17, 2022 20:52
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is startup sequence with updated blazor

MONO_WASM: instantiateWasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_download_assets MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: instantiateWasm done MONO_WASM: preRunAsync MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:Microsoft.Extensions.Configuration.dll as assembly size 29696 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Abstractions.dll as assembly size 17920 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Binder.dll as assembly size 29184 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Binder.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Json.dll as assembly size 16384 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Json.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.FileExtensions.dll as assembly size 16896 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.FileExtensions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.Abstractions.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.dll as assembly size 72192 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.dll as assembly size 36352 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Physical.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Physical.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Abstractions.dll as assembly size 12288 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.Abstractions.dll as assembly size 53248 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Primitives.dll as assembly size 31232 from https://localhost:5001/_framework/Microsoft.Extensions.Primitives.dll MONO_WASM: Loaded:Microsoft.Extensions.Options.dll as assembly size 50176 from https://localhost:5001/_framework/Microsoft.Extensions.Options.dll MONO_WASM: Loaded:Microsoft.Extensions.FileSystemGlobbing.dll as assembly size 35840 from https://localhost:5001/_framework/Microsoft.Extensions.FileSystemGlobbing.dll MONO_WASM: Loaded:Microsoft.VisualBasic.dll as assembly size 7680 from https://localhost:5001/_framework/Microsoft.VisualBasic.dll MONO_WASM: Loaded:System.IO.Pipelines.dll as assembly size 70144 from https://localhost:5001/_framework/System.IO.Pipelines.dll MONO_WASM: Loaded:Microsoft.Win32.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/Microsoft.Win32.Primitives.dll MONO_WASM: Loaded:System.AppContext.dll as assembly size 5120 from https://localhost:5001/_framework/System.AppContext.dll MONO_WASM: Loaded:System.Buffers.dll as assembly size 5120 from https://localhost:5001/_framework/System.Buffers.dll MONO_WASM: Loaded:Microsoft.Win32.Registry.dll as assembly size 30208 from https://localhost:5001/_framework/Microsoft.Win32.Registry.dll MONO_WASM: Loaded:System.Collections.Concurrent.dll as assembly size 92672 from https://localhost:5001/_framework/System.Collections.Concurrent.dll MONO_WASM: Loaded:System.Collections.Specialized.dll as assembly size 44032 from https://localhost:5001/_framework/System.Collections.Specialized.dll MONO_WASM: Loaded:System.Collections.dll as assembly size 111104 from https://localhost:5001/_framework/System.Collections.dll MONO_WASM: Loaded:System.ComponentModel.Annotations.dll as assembly size 88576 from https://localhost:5001/_framework/System.ComponentModel.Annotations.dll MONO_WASM: Loaded:System.ComponentModel.DataAnnotations.dll as assembly size 7168 from https://localhost:5001/_framework/System.ComponentModel.DataAnnotations.dll MONO_WASM: Loaded:System.ComponentModel.EventBasedAsync.dll as assembly size 18432 from https://localhost:5001/_framework/System.ComponentModel.EventBasedAsync.dll MONO_WASM: Loaded:System.ComponentModel.dll as assembly size 6656 from https://localhost:5001/_framework/System.ComponentModel.dll MONO_WASM: Loaded:System.ComponentModel.Primitives.dll as assembly size 32256 from https://localhost:5001/_framework/System.ComponentModel.Primitives.dll MONO_WASM: Loaded:System.Configuration.dll as assembly size 9728 from https://localhost:5001/_framework/System.Configuration.dll MONO_WASM: Loaded:System.Collections.NonGeneric.dll as assembly size 43520 from https://localhost:5001/_framework/System.Collections.NonGeneric.dll MONO_WASM: Loaded:System.Console.dll as assembly size 49664 from https://localhost:5001/_framework/System.Console.dll MONO_WASM: Loaded:System.Core.dll as assembly size 13312 from https://localhost:5001/_framework/System.Core.dll MONO_WASM: Loaded:System.ComponentModel.TypeConverter.dll as assembly size 333312 from https://localhost:5001/_framework/System.ComponentModel.TypeConverter.dll MONO_WASM: Loaded:System.Collections.Immutable.dll as assembly size 212480 from https://localhost:5001/_framework/System.Collections.Immutable.dll MONO_WASM: Loaded:System.Data.dll as assembly size 13824 from https://localhost:5001/_framework/System.Data.dll MONO_WASM: Loaded:System.Data.DataSetExtensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Data.DataSetExtensions.dll MONO_WASM: Loaded:System.Diagnostics.FileVersionInfo.dll as assembly size 11776 from https://localhost:5001/_framework/System.Diagnostics.FileVersionInfo.dll MONO_WASM: Loaded:System.Diagnostics.Debug.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Debug.dll MONO_WASM: Loaded:Microsoft.CSharp.dll as assembly size 365568 from https://localhost:5001/_framework/Microsoft.CSharp.dll MONO_WASM: Loaded:System.Diagnostics.Process.dll as assembly size 55808 from https://localhost:5001/_framework/System.Diagnostics.Process.dll MONO_WASM: Loaded:System.Diagnostics.DiagnosticSource.dll as assembly size 151040 from https://localhost:5001/_framework/System.Diagnostics.DiagnosticSource.dll MONO_WASM: Loaded:Microsoft.VisualBasic.Core.dll as assembly size 516096 from https://localhost:5001/_framework/Microsoft.VisualBasic.Core.dll MONO_WASM: Loaded:System.Diagnostics.Contracts.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Contracts.dll MONO_WASM: Loaded:System.Diagnostics.StackTrace.dll as assembly size 16896 from https://localhost:5001/_framework/System.Diagnostics.StackTrace.dll MONO_WASM: Loaded:System.Diagnostics.Tools.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Tools.dll MONO_WASM: Loaded:System.Diagnostics.TraceSource.dll as assembly size 50176 from https://localhost:5001/_framework/System.Diagnostics.TraceSource.dll MONO_WASM: Loaded:System.Diagnostics.TextWriterTraceListener.dll as assembly size 23040 from https://localhost:5001/_framework/System.Diagnostics.TextWriterTraceListener.dll MONO_WASM: Loaded:System.Formats.Tar.dll as assembly size 32768 from https://localhost:5001/_framework/System.Formats.Tar.dll MONO_WASM: Loaded:System.Diagnostics.Tracing.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Tracing.dll MONO_WASM: Loaded:System.Globalization.Calendars.dll as assembly size 6144 from https://localhost:5001/_framework/System.Globalization.Calendars.dll MONO_WASM: Loaded:System.IO.Compression.Brotli.dll as assembly size 19456 from https://localhost:5001/_framework/System.IO.Compression.Brotli.dll MONO_WASM: Loaded:System.Globalization.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Globalization.Extensions.dll MONO_WASM: Loaded:System.Globalization.dll as assembly size 5632 from https://localhost:5001/_framework/System.Globalization.dll MONO_WASM: Loaded:System.IO.Compression.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.Compression.FileSystem.dll MONO_WASM: Loaded:System.Dynamic.Runtime.dll as assembly size 6144 from https://localhost:5001/_framework/System.Dynamic.Runtime.dll MONO_WASM: Loaded:System.IO.Compression.ZipFile.dll as assembly size 26624 from https://localhost:5001/_framework/System.IO.Compression.ZipFile.dll MONO_WASM: Loaded:System.IO.FileSystem.AccessControl.dll as assembly size 24064 from https://localhost:5001/_framework/System.IO.FileSystem.AccessControl.dll MONO_WASM: Loaded:System.IO.FileSystem.DriveInfo.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.FileSystem.DriveInfo.dll MONO_WASM: Loaded:System.Drawing.dll as assembly size 10752 from https://localhost:5001/_framework/System.Drawing.dll MONO_WASM: Loaded:System.IO.IsolatedStorage.dll as assembly size 27136 from https://localhost:5001/_framework/System.IO.IsolatedStorage.dll MONO_WASM: Loaded:System.Formats.Asn1.dll as assembly size 87040 from https://localhost:5001/_framework/System.Formats.Asn1.dll MONO_WASM: Loaded:System.IO.Compression.dll as assembly size 119808 from https://localhost:5001/_framework/System.IO.Compression.dll MONO_WASM: Loaded:System.IO.FileSystem.Watcher.dll as assembly size 25600 from https://localhost:5001/_framework/System.IO.FileSystem.Watcher.dll MONO_WASM: Loaded:System.IO.FileSystem.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.FileSystem.Primitives.dll MONO_WASM: Loaded:System.IO.MemoryMappedFiles.dll as assembly size 45056 from https://localhost:5001/_framework/System.IO.MemoryMappedFiles.dll MONO_WASM: Loaded:System.IO.UnmanagedMemoryStream.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.UnmanagedMemoryStream.dll MONO_WASM: Loaded:System.IO.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.FileSystem.dll MONO_WASM: Loaded:System.IO.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.dll MONO_WASM: Loaded:System.Drawing.Primitives.dll as assembly size 54784 from https://localhost:5001/_framework/System.Drawing.Primitives.dll MONO_WASM: Loaded:System.Linq.Queryable.dll as assembly size 86528 from https://localhost:5001/_framework/System.Linq.Queryable.dll MONO_WASM: Loaded:System.IO.Pipes.AccessControl.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.Pipes.AccessControl.dll MONO_WASM: Loaded:System.Net.Http.Json.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.Http.Json.dll MONO_WASM: Loaded:System.Memory.dll as assembly size 50688 from https://localhost:5001/_framework/System.Memory.dll MONO_WASM: Loaded:System.IO.Pipes.dll as assembly size 38400 from https://localhost:5001/_framework/System.IO.Pipes.dll MONO_WASM: Loaded:System.Net.NameResolution.dll as assembly size 14848 from https://localhost:5001/_framework/System.Net.NameResolution.dll MONO_WASM: Loaded:System.Net.HttpListener.dll as assembly size 60928 from https://localhost:5001/_framework/System.Net.HttpListener.dll MONO_WASM: Loaded:System.Net.ServicePoint.dll as assembly size 17408 from https://localhost:5001/_framework/System.Net.ServicePoint.dll MONO_WASM: Loaded:System.Net.Primitives.dll as assembly size 99840 from https://localhost:5001/_framework/System.Net.Primitives.dll MONO_WASM: Loaded:System.Net.Ping.dll as assembly size 18432 from https://localhost:5001/_framework/System.Net.Ping.dll MONO_WASM: Loaded:System.Linq.Parallel.dll as assembly size 259584 from https://localhost:5001/_framework/System.Linq.Parallel.dll MONO_WASM: Loaded:System.Linq.dll as assembly size 131584 from https://localhost:5001/_framework/System.Linq.dll MONO_WASM: Loaded:System.Net.Sockets.dll as assembly size 75264 from https://localhost:5001/_framework/System.Net.Sockets.dll MONO_WASM: Loaded:System.Net.Quic.dll as assembly size 33280 from https://localhost:5001/_framework/System.Net.Quic.dll MONO_WASM: Loaded:System.Net.Http.dll as assembly size 297472 from https://localhost:5001/_framework/System.Net.Http.dll MONO_WASM: Loaded:System.Net.Security.dll as assembly size 90624 from https://localhost:5001/_framework/System.Net.Security.dll MONO_WASM: Loaded:System.Net.WebSockets.Client.dll as assembly size 40448 from https://localhost:5001/_framework/System.Net.WebSockets.Client.dll MONO_WASM: Loaded:System.Net.Requests.dll as assembly size 59392 from https://localhost:5001/_framework/System.Net.Requests.dll MONO_WASM: Loaded:System.ObjectModel.dll as assembly size 32768 from https://localhost:5001/_framework/System.ObjectModel.dll MONO_WASM: Loaded:System.Numerics.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.dll MONO_WASM: Loaded:System.Net.WebHeaderCollection.dll as assembly size 26112 from https://localhost:5001/_framework/System.Net.WebHeaderCollection.dll MONO_WASM: Loaded:System.Net.WebClient.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.WebClient.dll MONO_WASM: Loaded:System.Net.WebProxy.dll as assembly size 11264 from https://localhost:5001/_framework/System.Net.WebProxy.dll MONO_WASM: Loaded:System.Reflection.DispatchProxy.dll as assembly size 28160 from https://localhost:5001/_framework/System.Reflection.DispatchProxy.dll MONO_WASM: Loaded:System.Net.NetworkInformation.dll as assembly size 32768 from https://localhost:5001/_framework/System.Net.NetworkInformation.dll MONO_WASM: Loaded:System.Reflection.Emit.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.dll MONO_WASM: Loaded:System.Net.WebSockets.dll as assembly size 86528 from https://localhost:5001/_framework/System.Net.WebSockets.dll MONO_WASM: Loaded:System.Net.Mail.dll as assembly size 109568 from https://localhost:5001/_framework/System.Net.Mail.dll MONO_WASM: Loaded:System.Reflection.Emit.ILGeneration.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.ILGeneration.dll MONO_WASM: Loaded:System.Reflection.TypeExtensions.dll as assembly size 15360 from https://localhost:5001/_framework/System.Reflection.TypeExtensions.dll MONO_WASM: Loaded:System.Net.dll as assembly size 7168 from https://localhost:5001/_framework/System.Net.dll MONO_WASM: Loaded:System.Reflection.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Reflection.Extensions.dll MONO_WASM: Loaded:System.Resources.Reader.dll as assembly size 5120 from https://localhost:5001/_framework/System.Resources.Reader.dll MONO_WASM: Loaded:System.Numerics.Vectors.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.Vectors.dll MONO_WASM: Loaded:System.Reflection.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Primitives.dll MONO_WASM: Loaded:System.Reflection.Emit.Lightweight.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.Lightweight.dll MONO_WASM: Loaded:System.Runtime.Extensions.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.Extensions.dll MONO_WASM: Loaded:System.Runtime.Handles.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.Handles.dll MONO_WASM: Loaded:System.Resources.ResourceManager.dll as assembly size 5632 from https://localhost:5001/_framework/System.Resources.ResourceManager.dll MONO_WASM: Loaded:System.Private.Xml.Linq.dll as assembly size 170496 from https://localhost:5001/_framework/System.Private.Xml.Linq.dll MONO_WASM: Loaded:System.Linq.Expressions.dll as assembly size 656896 from https://localhost:5001/_framework/System.Linq.Expressions.dll MONO_WASM: Loaded:System.Runtime.InteropServices.RuntimeInformation.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.InteropServices.RuntimeInformation.dll MONO_WASM: Loaded:System.Runtime.Intrinsics.dll as assembly size 6656 from https://localhost:5001/_framework/System.Runtime.Intrinsics.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.VisualC.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.CompilerServices.VisualC.dll MONO_WASM: Loaded:System.Resources.Writer.dll as assembly size 19456 from https://localhost:5001/_framework/System.Resources.Writer.dll MONO_WASM: Loaded:System.Runtime.Loader.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Loader.dll MONO_WASM: Loaded:System.Reflection.Metadata.dll as assembly size 512000 from https://localhost:5001/_framework/System.Reflection.Metadata.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.Unsafe.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.CompilerServices.Unsafe.dll MONO_WASM: Loaded:System.Runtime.Serialization.Formatters.dll as assembly size 68096 from https://localhost:5001/_framework/System.Runtime.Serialization.Formatters.dll MONO_WASM: Loaded:System.Reflection.dll as assembly size 6144 from https://localhost:5001/_framework/System.Reflection.dll MONO_WASM: Loaded:System.Security.Claims.dll as assembly size 46080 from https://localhost:5001/_framework/System.Security.Claims.dll MONO_WASM: Loaded:System.Runtime.InteropServices.dll as assembly size 31232 from https://localhost:5001/_framework/System.Runtime.InteropServices.dll MONO_WASM: Loaded:System.Security.Cryptography.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Encoding.dll MONO_WASM: Loaded:System.Security.Cryptography.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Primitives.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 80896 from https://localhost:5001/_framework/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:System.Security.Cryptography.OpenSsl.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.OpenSsl.dll MONO_WASM: Loaded:System.Runtime.Serialization.dll as assembly size 7168 from https://localhost:5001/_framework/System.Runtime.Serialization.dll MONO_WASM: Loaded:System.Runtime.Serialization.Xml.dll as assembly size 6144 from https://localhost:5001/_framework/System.Runtime.Serialization.Xml.dll MONO_WASM: Loaded:System.Security.Cryptography.X509Certificates.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.X509Certificates.dll MONO_WASM: Loaded:System.Runtime.Serialization.Primitives.dll as assembly size 12800 from https://localhost:5001/_framework/System.Runtime.Serialization.Primitives.dll MONO_WASM: Loaded:System.Runtime.Numerics.dll as assembly size 141824 from https://localhost:5001/_framework/System.Runtime.Numerics.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 111616 from https://localhost:5001/_framework/System.Private.Uri.dll MONO_WASM: Loaded:System.ServiceProcess.dll as assembly size 6144 from https://localhost:5001/_framework/System.ServiceProcess.dll MONO_WASM: Loaded:System.Security.dll as assembly size 8192 from https://localhost:5001/_framework/System.Security.dll MONO_WASM: Loaded:System.Text.Encoding.Extensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.Extensions.dll MONO_WASM: Loaded:System.Text.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 33792 from https://localhost:5001/_framework/System.Runtime.dll MONO_WASM: Loaded:System.Security.AccessControl.dll as assembly size 53248 from https://localhost:5001/_framework/System.Security.AccessControl.dll MONO_WASM: Loaded:System.Runtime.Serialization.Json.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Serialization.Json.dll MONO_WASM: Loaded:System.Security.SecureString.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.SecureString.dll MONO_WASM: Loaded:System.Security.Cryptography.Cng.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Cng.dll MONO_WASM: Loaded:System.Threading.Channels.dll as assembly size 51200 from https://localhost:5001/_framework/System.Threading.Channels.dll MONO_WASM: Loaded:System.Security.Cryptography.Csp.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Csp.dll MONO_WASM: Loaded:System.Security.Cryptography.Algorithms.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.Algorithms.dll MONO_WASM: Loaded:System.Threading.Tasks.Parallel.dll as assembly size 57344 from https://localhost:5001/_framework/System.Threading.Tasks.Parallel.dll MONO_WASM: Loaded:System.Threading.Tasks.dll as assembly size 6656 from https://localhost:5001/_framework/System.Threading.Tasks.dll MONO_WASM: Loaded:System.Threading.Timer.dll as assembly size 5120 from https://localhost:5001/_framework/System.Threading.Timer.dll MONO_WASM: Loaded:System.Security.Cryptography.dll as assembly size 511488 from https://localhost:5001/_framework/System.Security.Cryptography.dll MONO_WASM: Loaded:System.Threading.Thread.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Thread.dll MONO_WASM: Loaded:System.Security.Principal.Windows.dll as assembly size 29184 from https://localhost:5001/_framework/System.Security.Principal.Windows.dll MONO_WASM: Loaded:System.Windows.dll as assembly size 6144 from https://localhost:5001/_framework/System.Windows.dll MONO_WASM: Loaded:System.Threading.Overlapped.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Overlapped.dll MONO_WASM: Loaded:System.Xml.Linq.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.Linq.dll MONO_WASM: Loaded:System.ServiceModel.Web.dll as assembly size 7168 from https://localhost:5001/_framework/System.ServiceModel.Web.dll MONO_WASM: Loaded:System.Threading.Tasks.Extensions.dll as assembly size 6144 from https://localhost:5001/_framework/System.Threading.Tasks.Extensions.dll MONO_WASM: Loaded:System.Threading.dll as assembly size 44032 from https://localhost:5001/_framework/System.Threading.dll MONO_WASM: Loaded:System.Xml.XPath.XDocument.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.XPath.XDocument.dll MONO_WASM: Loaded:System.Xml.ReaderWriter.dll as assembly size 11776 from https://localhost:5001/_framework/System.Xml.ReaderWriter.dll MONO_WASM: Loaded:WindowsBase.dll as assembly size 6144 from https://localhost:5001/_framework/WindowsBase.dll MONO_WASM: Loaded:System.Transactions.dll as assembly size 6656 from https://localhost:5001/_framework/System.Transactions.dll MONO_WASM: Loaded:System.Text.Json.dll as assembly size 643584 from https://localhost:5001/_framework/System.Text.Json.dll MONO_WASM: Loaded:System.Threading.Tasks.Dataflow.dll as assembly size 237568 from https://localhost:5001/_framework/System.Threading.Tasks.Dataflow.dll MONO_WASM: Loaded:System.Security.Principal.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Principal.dll MONO_WASM: Loaded:mscorlib.dll as assembly size 47104 from https://localhost:5001/_framework/mscorlib.dll MONO_WASM: Loaded:System.ValueTuple.dll as assembly size 5632 from https://localhost:5001/_framework/System.ValueTuple.dll MONO_WASM: Loaded:System.Text.Encodings.Web.dll as assembly size 67584 from https://localhost:5001/_framework/System.Text.Encodings.Web.dll MONO_WASM: Loaded:System.Web.HttpUtility.dll as assembly size 19456 from https://localhost:5001/_framework/System.Web.HttpUtility.dll MONO_WASM: Loaded:System.Xml.XPath.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XPath.dll MONO_WASM: Loaded:System.Threading.ThreadPool.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.ThreadPool.dll MONO_WASM: Loaded:System.Xml.XmlSerializer.dll as assembly size 7680 from https://localhost:5001/_framework/System.Xml.XmlSerializer.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.dll as assembly size 6656 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.dll MONO_WASM: Loaded:System.Xml.XDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XDocument.dll MONO_WASM: Loaded:System.dll as assembly size 39936 from https://localhost:5001/_framework/System.dll MONO_WASM: Loaded:System.Xml.dll as assembly size 13824 from https://localhost:5001/_framework/System.Xml.dll MONO_WASM: Loaded:System.Xml.Serialization.dll as assembly size 6656 from https://localhost:5001/_framework/System.Xml.Serialization.dll MONO_WASM: Loaded:netstandard.dll as assembly size 90112 from https://localhost:5001/_framework/netstandard.dll MONO_WASM: Loaded:System.Text.RegularExpressions.dll as assembly size 433152 from https://localhost:5001/_framework/System.Text.RegularExpressions.dll MONO_WASM: Loaded:System.Xml.XmlDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XmlDocument.dll MONO_WASM: Loaded:System.Web.dll as assembly size 5120 from https://localhost:5001/_framework/System.Web.dll MONO_WASM: Loaded:System.Transactions.Local.dll as assembly size 171520 from https://localhost:5001/_framework/System.Transactions.Local.dll MONO_WASM: Loaded:System.Text.Encoding.CodePages.dll as assembly size 775680 from https://localhost:5001/_framework/System.Text.Encoding.CodePages.dll MONO_WASM: Loaded:System.Private.DataContractSerialization.dll as assembly size 956928 from https://localhost:5001/_framework/System.Private.DataContractSerialization.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.dll as assembly size 130560 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.dll as assembly size 84992 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.dll as assembly size 240640 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.dll as assembly size 25088 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.dll MONO_WASM: Loaded:System.Data.Common.dll as assembly size 1294336 from https://localhost:5001/_framework/System.Data.Common.dll MONO_WASM: Loaded:Microsoft.JSInterop.dll as assembly size 58880 from https://localhost:5001/_framework/Microsoft.JSInterop.dll MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.dll as assembly size 12800 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.dll MONO_WASM: Loaded:Microsoft.JSInterop.pdb as pdb size 34308 from https://localhost:5001/_framework/Microsoft.JSInterop.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.pdb as pdb size 44080 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.dll as assembly size 20992 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.pdb as pdb size 15416 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.pdb as pdb size 123316 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.pdb as pdb size 59568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.pdb MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.pdb as pdb size 18148 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.pdb as pdb size 27948 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.pdb as pdb size 21568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.pdb MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from https://localhost:5001/_framework/dotnet.timezones.blat MONO_WASM: Creating file 'dotnet.timezones.blat' in directory '/' MONO_WASM: Loaded:icudt_EFIGS.dat as icu size 550320 from https://localhost:5001/_framework/icudt_EFIGS.dat MONO_WASM: Loaded:System.Private.Xml.dll as assembly size 3859968 from https://localhost:5001/_framework/System.Private.Xml.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 4327936 from https://localhost:5001/_framework/System.Private.CoreLib.dll MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file dotnet.js.symbols. Ignoring. MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime MONO_WASM: postRunAsync 

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

# Conflicts:
#	src/mono/wasm/runtime/diagnostics.ts
#	src/mono/wasm/runtime/dotnet.d.ts
#	src/mono/wasm/runtime/pthreads/worker/index.ts
#	src/mono/wasm/runtime/startup.ts
#	src/mono/wasm/runtime/types.ts
@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Threaded sample isn't happy after the merge. I'm investigating

repro steps:

./build.sh --os browser -c Debug /p:WasmEnablePerfTracing=true
cd src/mono/sample/wasm/browser-eventpipe
make CONFIG=Debug clean publish run V=1 MSBUILD_ARGS=/p:MonoDiagnosticsMock=true

Screen Shot 2022-07-25 at 14 17 04

@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Update: the fix helps, but there is still a problem.

Screenshot from 2022-07-25 19-15-25

I think what's happening is that dotnet.worker.js initializes a Module global and passes it to createDotnetRuntime but this Module = instance assignment (https://github.com/emscripten-core/emscripten/blob/940ae7fe759a81c64e0bde0a41eb33655ad496e1/src/worker.js#L156) is never executed

Which might be because createDotnetRuntimedoesn't return a Promise for some reason. That''s the avenue I'm going to explore tonight. returns a promise that is never settled for some reason.

@lambdageek

Copy link
Copy Markdown
Member

Here's what our dotnet.js and dotnet.worker.js look like from this PR, with threading enabled https://gist.github.com/lambdageek/e54206e2e5365e3f3440a4942a303721#file-dotnet-worker-js

@lambdageek

lambdageek commented Jul 26, 2022

Copy link
Copy Markdown
Member

Ok, so the issue is in this run function in Emscripten. Note that if it's in a pthread, then it doesn't call doRun (or preRun or any of the rest), it calls a different function that's specific to pthreads. In that function it calls readyResolvePromise(Module) but it never calls postRun.

functionrun(args){args=args||arguments_;if(runDependencies>0){return;}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({"cmd": "loaded"});return;}preRun();if(runDependencies>0){return;}functiondoRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}}

So when we do

module.ready=module.ready.then(async()=>{// wait for previous stageawaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

Because nothing resolved afterPostRun, module.ready never resolves, and dotnet.worker.js just returns from self.onmessage ("load") without assigning Module = instance and the worker is left in a bad state.

Update it's less misleading to just return from configure_emscripten_startup without doing anything if we're in a pthread worker. The solution, I think is to change module.ready like this:

module.ready=module.ready.then(async()=>{// wait for previous stage// on pthread workers, postRun is never called, so there is nothing to wait forif(!ENVIRONMENT_IS_PTHREAD)awaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

@pavelsavara

With the above change, the diagnostics sample works for me.

Maybe we should just return from configure_emscripten_startup without changing preRun, onRuntimeInitialized, postRun and ready if we're in a worker since it's just misleading and i'm not sure if running any of the other config-based callbacks makes a ton of sense

@lambdageek

Copy link
Copy Markdown
Member

@pavelsavarapavelsavara#3

As follow-up to this PR we should figure out what kind of JS initialization we want to do in pthread workers. the normal callbacks don't fire. i'm not sure if that's ok or if it's leaving some part of our JS state incorrect.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek there is alredy condition in initializeImportsAndExports and I used it to exit startup sequence for workers.
That makes it work up to

WASM ERROR Error: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Threading.Thread.ThrowIfNoThreadStart(Boolean )
at System.Threading.Thread.Start(Boolean , Boolean )
at System.Threading.Thread.Start()
at Sample.Test.TestMeaning() in C:\Dev\runtime\src\mono\sample\wasm\browser-mt-eventpipe\Program.cs:line 27

Which is I guess some different issue. If the build is green, I will merge as is and we will continue in follow-up PRs.

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Screenshot from 2022-07-25 19-15-25

I noticed on the screenshot that the init_crypto is running multiple times. I think the latest in this PR should not do that anymore.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek when I rebuild with /p:WasmEnableThreads=true and not only /p:WasmEnablePerfTracing=true I could start threads :-D

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is release version
image

@lambdageek

Copy link
Copy Markdown
Member

This is release version
image

That's an asssert that we resumed a thread more times than we suspended it. Probably not due to this PR.

Comment on lines -356 to +316
configure_emscripten_startup(module, exportedAPI);

if (ENVIRONMENT_IS_WORKER) {
// HACK: Emscripten's dotnet.worker.js expects the exports of dotnet.js module to be Module object
// until we have our own fix for dotnet.worker.js file
// we also skip all emscripten startup event and configuration of worker's JS state
// note that emscripten events are not firing either
return <any>exportedAPI.Module;
}

configure_emscripten_startup(module, exportedAPI);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavelsavara

pavelsavara commented Jul 26, 2022

Copy link
Copy Markdown
MemberAuthor

There is well known Not found: args[0] = xLog

There is also timeout on V8+windows

 [wasm test] [09:40:06] info: console.debug: [MONO] AOT: FOUND method System.Runtime.Loader.AssemblyLoadContext:OnProcessExit () [0x181a - 0x181b 0x55dd8]
[wasm test] [09:55:06] info: Process 2844 didn't exit within 00:15:00 and will be killed

LogAnother log

edit: maybe this PR surfaced the #72880

@pavelsavara
pavelsavara merged commit 73374e8 into dotnet:mainJul 26, 2022
radical pushed a commit that referenced this pull request Jul 28, 2022
…tory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
@pavelsavara
pavelsavara deleted the wasm_improve_startup branch July 29, 2022 09:16
@ghostghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@lambdageek@kg@maraf@ilonatommy
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
[wasm] improve startup by pavelsavara · Pull Request #72275 · dotnet/runtime · GitHub
Skip to content

[wasm] improve startup - #72275

Merged
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup
Jul 26, 2022
Merged

[wasm] improve startup#72275
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Jul 15, 2022

Copy link
Copy Markdown
Member

streaming wasm instantiation, more parallel download of DLLs

and other goodnes seen in Blazor

  • new hook downloadResource?: (request: ResourceRequest) => LoadingResource allows Blazor to delegate the details to runtime while keeping the caching responsibility.
  • existing config.assets could now have resolvedUrl and pending response. That's blazor could tell us what to load and also provide pending cache promise.
  • made emsripten events async, our callbacks are called in correct order and block on previous one before the next is started.
  • improved log messages
  • load assets into memory as they arrive from network, avoiding memory allocation spike
  • run mono_wasm_pre_init_esential also in Blazor loader. This will fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. This will enable new [JSImport] for blazor.
  • locateFile is now used for all assets including mono-config.json. I also fixed scriptDirectory detection on all but v8+CJS. Therefore apps could be executed from different folder than is dotnet.js location. Credits to @yamachu
  • run init_crypto also on blazor startup sequence

Contributes to #70892
Contributes to #72810

@pavelsavarapavelsavara added this to the 7.0.0 milestone Jul 15, 2022
@pavelsavara
pavelsavara requested review from kg and marafJuly 15, 2022 16:09
@pavelsavarapavelsavara self-assigned this Jul 15, 2022
@pavelsavara
pavelsavara requested a review from lewing as a code ownerJuly 15, 2022 16:09
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • load assemblies into memory synchronously during onRuntimeInitialized because async user postRun run in parallel to each other and therefore can't use loaded assemblies yet. We will do the same in Blazor.
  • run mono_wasm_pre_init_esential also in Blazor loader. This will also fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. We will eliminate it from Blazor code.
Author:pavelsavara
Assignees:pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone:7.0.0

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

I tested with current and also future! Blazor

@lewing
lewing requested a review from lambdageekJuly 15, 2022 16:54
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara

This comment was marked as outdated.

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 8a1057f to d319c22CompareJuly 15, 2022 18:15
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jul 16, 2022

Copy link
Copy Markdown
MemberAuthor

This is the startup sequence for non-blazor

user code in createDotnetRuntime callback MONO_WASM: determined url of dotnet main script to be http://localhost:8000/
MONO_WASM: instantiateWasm MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.wasm' for dotnet.wasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit user code Module.preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_wasm_load_config MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: mono_download_assets MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Console.dll' for System.Console.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.CoreLib.dll' for System.Private.CoreLib.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.Uri.dll' for System.Private.Uri.dll MONO_WASM: instantiateWasm done MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.dll' for System.Runtime.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll' for System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll' for Wasm.Browser.ES6.Sample.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/supportFiles/0_runtimeconfig.bin' for supportFiles/0_runtimeconfig.bin MONO_WASM: Attempting to fetch 'http://localhost:8000/icudt.dat' for icudt.dat MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.timezones.blat' for dotnet.timezones.blat user code Module.preRun MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:System.Console.dll as assembly size 25088 from http://localhost:8000/managed/System.Console.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 1684992 from http://localhost:8000/managed/System.Private.CoreLib.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 80384 from http://localhost:8000/managed/System.Private.Uri.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 6144 from http://localhost:8000/managed/System.Runtime.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 31232 from http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:Wasm.Browser.ES6.Sample.dll as assembly size 17408 from http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll MONO_WASM: Loaded:supportFiles/0_runtimeconfig.bin as vfs size 950 from http://localhost:8000/supportFiles/0_runtimeconfig.bin MONO_WASM: Creating file 'runtimeconfig.bin' in directory '/' MONO_WASM: Loaded:icudt.dat as icu size 1503760 from http://localhost:8000/icudt.dat MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from http://localhost:8000/dotnet.timezones.blat MONO_WASM: Creating directory '/usr/share/zoneinfo' MONO_WASM: Creating file '' in directory '/usr/share/zoneinfo' MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file user code Module.onRuntimeInitialized MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime user code Module.postRun user code after createDotnetRuntime() MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:TestMeaning MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:IsPrime MONO_WASM: Binding [JSImport] Sample.Test.sub from null MONO_WASM: Binding [JSImport] Sample.Test.add from null meaning: 42 ret: 42 Hello, World! WASM EXIT 0 

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 657f65b to d2884fbCompareJuly 17, 2022 08:58
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from d2884fb to 2050175CompareJuly 17, 2022 20:52
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is startup sequence with updated blazor

MONO_WASM: instantiateWasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_download_assets MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: instantiateWasm done MONO_WASM: preRunAsync MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:Microsoft.Extensions.Configuration.dll as assembly size 29696 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Abstractions.dll as assembly size 17920 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Binder.dll as assembly size 29184 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Binder.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Json.dll as assembly size 16384 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Json.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.FileExtensions.dll as assembly size 16896 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.FileExtensions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.Abstractions.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.dll as assembly size 72192 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.dll as assembly size 36352 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Physical.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Physical.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Abstractions.dll as assembly size 12288 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.Abstractions.dll as assembly size 53248 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Primitives.dll as assembly size 31232 from https://localhost:5001/_framework/Microsoft.Extensions.Primitives.dll MONO_WASM: Loaded:Microsoft.Extensions.Options.dll as assembly size 50176 from https://localhost:5001/_framework/Microsoft.Extensions.Options.dll MONO_WASM: Loaded:Microsoft.Extensions.FileSystemGlobbing.dll as assembly size 35840 from https://localhost:5001/_framework/Microsoft.Extensions.FileSystemGlobbing.dll MONO_WASM: Loaded:Microsoft.VisualBasic.dll as assembly size 7680 from https://localhost:5001/_framework/Microsoft.VisualBasic.dll MONO_WASM: Loaded:System.IO.Pipelines.dll as assembly size 70144 from https://localhost:5001/_framework/System.IO.Pipelines.dll MONO_WASM: Loaded:Microsoft.Win32.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/Microsoft.Win32.Primitives.dll MONO_WASM: Loaded:System.AppContext.dll as assembly size 5120 from https://localhost:5001/_framework/System.AppContext.dll MONO_WASM: Loaded:System.Buffers.dll as assembly size 5120 from https://localhost:5001/_framework/System.Buffers.dll MONO_WASM: Loaded:Microsoft.Win32.Registry.dll as assembly size 30208 from https://localhost:5001/_framework/Microsoft.Win32.Registry.dll MONO_WASM: Loaded:System.Collections.Concurrent.dll as assembly size 92672 from https://localhost:5001/_framework/System.Collections.Concurrent.dll MONO_WASM: Loaded:System.Collections.Specialized.dll as assembly size 44032 from https://localhost:5001/_framework/System.Collections.Specialized.dll MONO_WASM: Loaded:System.Collections.dll as assembly size 111104 from https://localhost:5001/_framework/System.Collections.dll MONO_WASM: Loaded:System.ComponentModel.Annotations.dll as assembly size 88576 from https://localhost:5001/_framework/System.ComponentModel.Annotations.dll MONO_WASM: Loaded:System.ComponentModel.DataAnnotations.dll as assembly size 7168 from https://localhost:5001/_framework/System.ComponentModel.DataAnnotations.dll MONO_WASM: Loaded:System.ComponentModel.EventBasedAsync.dll as assembly size 18432 from https://localhost:5001/_framework/System.ComponentModel.EventBasedAsync.dll MONO_WASM: Loaded:System.ComponentModel.dll as assembly size 6656 from https://localhost:5001/_framework/System.ComponentModel.dll MONO_WASM: Loaded:System.ComponentModel.Primitives.dll as assembly size 32256 from https://localhost:5001/_framework/System.ComponentModel.Primitives.dll MONO_WASM: Loaded:System.Configuration.dll as assembly size 9728 from https://localhost:5001/_framework/System.Configuration.dll MONO_WASM: Loaded:System.Collections.NonGeneric.dll as assembly size 43520 from https://localhost:5001/_framework/System.Collections.NonGeneric.dll MONO_WASM: Loaded:System.Console.dll as assembly size 49664 from https://localhost:5001/_framework/System.Console.dll MONO_WASM: Loaded:System.Core.dll as assembly size 13312 from https://localhost:5001/_framework/System.Core.dll MONO_WASM: Loaded:System.ComponentModel.TypeConverter.dll as assembly size 333312 from https://localhost:5001/_framework/System.ComponentModel.TypeConverter.dll MONO_WASM: Loaded:System.Collections.Immutable.dll as assembly size 212480 from https://localhost:5001/_framework/System.Collections.Immutable.dll MONO_WASM: Loaded:System.Data.dll as assembly size 13824 from https://localhost:5001/_framework/System.Data.dll MONO_WASM: Loaded:System.Data.DataSetExtensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Data.DataSetExtensions.dll MONO_WASM: Loaded:System.Diagnostics.FileVersionInfo.dll as assembly size 11776 from https://localhost:5001/_framework/System.Diagnostics.FileVersionInfo.dll MONO_WASM: Loaded:System.Diagnostics.Debug.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Debug.dll MONO_WASM: Loaded:Microsoft.CSharp.dll as assembly size 365568 from https://localhost:5001/_framework/Microsoft.CSharp.dll MONO_WASM: Loaded:System.Diagnostics.Process.dll as assembly size 55808 from https://localhost:5001/_framework/System.Diagnostics.Process.dll MONO_WASM: Loaded:System.Diagnostics.DiagnosticSource.dll as assembly size 151040 from https://localhost:5001/_framework/System.Diagnostics.DiagnosticSource.dll MONO_WASM: Loaded:Microsoft.VisualBasic.Core.dll as assembly size 516096 from https://localhost:5001/_framework/Microsoft.VisualBasic.Core.dll MONO_WASM: Loaded:System.Diagnostics.Contracts.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Contracts.dll MONO_WASM: Loaded:System.Diagnostics.StackTrace.dll as assembly size 16896 from https://localhost:5001/_framework/System.Diagnostics.StackTrace.dll MONO_WASM: Loaded:System.Diagnostics.Tools.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Tools.dll MONO_WASM: Loaded:System.Diagnostics.TraceSource.dll as assembly size 50176 from https://localhost:5001/_framework/System.Diagnostics.TraceSource.dll MONO_WASM: Loaded:System.Diagnostics.TextWriterTraceListener.dll as assembly size 23040 from https://localhost:5001/_framework/System.Diagnostics.TextWriterTraceListener.dll MONO_WASM: Loaded:System.Formats.Tar.dll as assembly size 32768 from https://localhost:5001/_framework/System.Formats.Tar.dll MONO_WASM: Loaded:System.Diagnostics.Tracing.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Tracing.dll MONO_WASM: Loaded:System.Globalization.Calendars.dll as assembly size 6144 from https://localhost:5001/_framework/System.Globalization.Calendars.dll MONO_WASM: Loaded:System.IO.Compression.Brotli.dll as assembly size 19456 from https://localhost:5001/_framework/System.IO.Compression.Brotli.dll MONO_WASM: Loaded:System.Globalization.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Globalization.Extensions.dll MONO_WASM: Loaded:System.Globalization.dll as assembly size 5632 from https://localhost:5001/_framework/System.Globalization.dll MONO_WASM: Loaded:System.IO.Compression.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.Compression.FileSystem.dll MONO_WASM: Loaded:System.Dynamic.Runtime.dll as assembly size 6144 from https://localhost:5001/_framework/System.Dynamic.Runtime.dll MONO_WASM: Loaded:System.IO.Compression.ZipFile.dll as assembly size 26624 from https://localhost:5001/_framework/System.IO.Compression.ZipFile.dll MONO_WASM: Loaded:System.IO.FileSystem.AccessControl.dll as assembly size 24064 from https://localhost:5001/_framework/System.IO.FileSystem.AccessControl.dll MONO_WASM: Loaded:System.IO.FileSystem.DriveInfo.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.FileSystem.DriveInfo.dll MONO_WASM: Loaded:System.Drawing.dll as assembly size 10752 from https://localhost:5001/_framework/System.Drawing.dll MONO_WASM: Loaded:System.IO.IsolatedStorage.dll as assembly size 27136 from https://localhost:5001/_framework/System.IO.IsolatedStorage.dll MONO_WASM: Loaded:System.Formats.Asn1.dll as assembly size 87040 from https://localhost:5001/_framework/System.Formats.Asn1.dll MONO_WASM: Loaded:System.IO.Compression.dll as assembly size 119808 from https://localhost:5001/_framework/System.IO.Compression.dll MONO_WASM: Loaded:System.IO.FileSystem.Watcher.dll as assembly size 25600 from https://localhost:5001/_framework/System.IO.FileSystem.Watcher.dll MONO_WASM: Loaded:System.IO.FileSystem.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.FileSystem.Primitives.dll MONO_WASM: Loaded:System.IO.MemoryMappedFiles.dll as assembly size 45056 from https://localhost:5001/_framework/System.IO.MemoryMappedFiles.dll MONO_WASM: Loaded:System.IO.UnmanagedMemoryStream.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.UnmanagedMemoryStream.dll MONO_WASM: Loaded:System.IO.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.FileSystem.dll MONO_WASM: Loaded:System.IO.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.dll MONO_WASM: Loaded:System.Drawing.Primitives.dll as assembly size 54784 from https://localhost:5001/_framework/System.Drawing.Primitives.dll MONO_WASM: Loaded:System.Linq.Queryable.dll as assembly size 86528 from https://localhost:5001/_framework/System.Linq.Queryable.dll MONO_WASM: Loaded:System.IO.Pipes.AccessControl.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.Pipes.AccessControl.dll MONO_WASM: Loaded:System.Net.Http.Json.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.Http.Json.dll MONO_WASM: Loaded:System.Memory.dll as assembly size 50688 from https://localhost:5001/_framework/System.Memory.dll MONO_WASM: Loaded:System.IO.Pipes.dll as assembly size 38400 from https://localhost:5001/_framework/System.IO.Pipes.dll MONO_WASM: Loaded:System.Net.NameResolution.dll as assembly size 14848 from https://localhost:5001/_framework/System.Net.NameResolution.dll MONO_WASM: Loaded:System.Net.HttpListener.dll as assembly size 60928 from https://localhost:5001/_framework/System.Net.HttpListener.dll MONO_WASM: Loaded:System.Net.ServicePoint.dll as assembly size 17408 from https://localhost:5001/_framework/System.Net.ServicePoint.dll MONO_WASM: Loaded:System.Net.Primitives.dll as assembly size 99840 from https://localhost:5001/_framework/System.Net.Primitives.dll MONO_WASM: Loaded:System.Net.Ping.dll as assembly size 18432 from https://localhost:5001/_framework/System.Net.Ping.dll MONO_WASM: Loaded:System.Linq.Parallel.dll as assembly size 259584 from https://localhost:5001/_framework/System.Linq.Parallel.dll MONO_WASM: Loaded:System.Linq.dll as assembly size 131584 from https://localhost:5001/_framework/System.Linq.dll MONO_WASM: Loaded:System.Net.Sockets.dll as assembly size 75264 from https://localhost:5001/_framework/System.Net.Sockets.dll MONO_WASM: Loaded:System.Net.Quic.dll as assembly size 33280 from https://localhost:5001/_framework/System.Net.Quic.dll MONO_WASM: Loaded:System.Net.Http.dll as assembly size 297472 from https://localhost:5001/_framework/System.Net.Http.dll MONO_WASM: Loaded:System.Net.Security.dll as assembly size 90624 from https://localhost:5001/_framework/System.Net.Security.dll MONO_WASM: Loaded:System.Net.WebSockets.Client.dll as assembly size 40448 from https://localhost:5001/_framework/System.Net.WebSockets.Client.dll MONO_WASM: Loaded:System.Net.Requests.dll as assembly size 59392 from https://localhost:5001/_framework/System.Net.Requests.dll MONO_WASM: Loaded:System.ObjectModel.dll as assembly size 32768 from https://localhost:5001/_framework/System.ObjectModel.dll MONO_WASM: Loaded:System.Numerics.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.dll MONO_WASM: Loaded:System.Net.WebHeaderCollection.dll as assembly size 26112 from https://localhost:5001/_framework/System.Net.WebHeaderCollection.dll MONO_WASM: Loaded:System.Net.WebClient.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.WebClient.dll MONO_WASM: Loaded:System.Net.WebProxy.dll as assembly size 11264 from https://localhost:5001/_framework/System.Net.WebProxy.dll MONO_WASM: Loaded:System.Reflection.DispatchProxy.dll as assembly size 28160 from https://localhost:5001/_framework/System.Reflection.DispatchProxy.dll MONO_WASM: Loaded:System.Net.NetworkInformation.dll as assembly size 32768 from https://localhost:5001/_framework/System.Net.NetworkInformation.dll MONO_WASM: Loaded:System.Reflection.Emit.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.dll MONO_WASM: Loaded:System.Net.WebSockets.dll as assembly size 86528 from https://localhost:5001/_framework/System.Net.WebSockets.dll MONO_WASM: Loaded:System.Net.Mail.dll as assembly size 109568 from https://localhost:5001/_framework/System.Net.Mail.dll MONO_WASM: Loaded:System.Reflection.Emit.ILGeneration.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.ILGeneration.dll MONO_WASM: Loaded:System.Reflection.TypeExtensions.dll as assembly size 15360 from https://localhost:5001/_framework/System.Reflection.TypeExtensions.dll MONO_WASM: Loaded:System.Net.dll as assembly size 7168 from https://localhost:5001/_framework/System.Net.dll MONO_WASM: Loaded:System.Reflection.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Reflection.Extensions.dll MONO_WASM: Loaded:System.Resources.Reader.dll as assembly size 5120 from https://localhost:5001/_framework/System.Resources.Reader.dll MONO_WASM: Loaded:System.Numerics.Vectors.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.Vectors.dll MONO_WASM: Loaded:System.Reflection.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Primitives.dll MONO_WASM: Loaded:System.Reflection.Emit.Lightweight.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.Lightweight.dll MONO_WASM: Loaded:System.Runtime.Extensions.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.Extensions.dll MONO_WASM: Loaded:System.Runtime.Handles.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.Handles.dll MONO_WASM: Loaded:System.Resources.ResourceManager.dll as assembly size 5632 from https://localhost:5001/_framework/System.Resources.ResourceManager.dll MONO_WASM: Loaded:System.Private.Xml.Linq.dll as assembly size 170496 from https://localhost:5001/_framework/System.Private.Xml.Linq.dll MONO_WASM: Loaded:System.Linq.Expressions.dll as assembly size 656896 from https://localhost:5001/_framework/System.Linq.Expressions.dll MONO_WASM: Loaded:System.Runtime.InteropServices.RuntimeInformation.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.InteropServices.RuntimeInformation.dll MONO_WASM: Loaded:System.Runtime.Intrinsics.dll as assembly size 6656 from https://localhost:5001/_framework/System.Runtime.Intrinsics.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.VisualC.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.CompilerServices.VisualC.dll MONO_WASM: Loaded:System.Resources.Writer.dll as assembly size 19456 from https://localhost:5001/_framework/System.Resources.Writer.dll MONO_WASM: Loaded:System.Runtime.Loader.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Loader.dll MONO_WASM: Loaded:System.Reflection.Metadata.dll as assembly size 512000 from https://localhost:5001/_framework/System.Reflection.Metadata.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.Unsafe.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.CompilerServices.Unsafe.dll MONO_WASM: Loaded:System.Runtime.Serialization.Formatters.dll as assembly size 68096 from https://localhost:5001/_framework/System.Runtime.Serialization.Formatters.dll MONO_WASM: Loaded:System.Reflection.dll as assembly size 6144 from https://localhost:5001/_framework/System.Reflection.dll MONO_WASM: Loaded:System.Security.Claims.dll as assembly size 46080 from https://localhost:5001/_framework/System.Security.Claims.dll MONO_WASM: Loaded:System.Runtime.InteropServices.dll as assembly size 31232 from https://localhost:5001/_framework/System.Runtime.InteropServices.dll MONO_WASM: Loaded:System.Security.Cryptography.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Encoding.dll MONO_WASM: Loaded:System.Security.Cryptography.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Primitives.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 80896 from https://localhost:5001/_framework/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:System.Security.Cryptography.OpenSsl.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.OpenSsl.dll MONO_WASM: Loaded:System.Runtime.Serialization.dll as assembly size 7168 from https://localhost:5001/_framework/System.Runtime.Serialization.dll MONO_WASM: Loaded:System.Runtime.Serialization.Xml.dll as assembly size 6144 from https://localhost:5001/_framework/System.Runtime.Serialization.Xml.dll MONO_WASM: Loaded:System.Security.Cryptography.X509Certificates.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.X509Certificates.dll MONO_WASM: Loaded:System.Runtime.Serialization.Primitives.dll as assembly size 12800 from https://localhost:5001/_framework/System.Runtime.Serialization.Primitives.dll MONO_WASM: Loaded:System.Runtime.Numerics.dll as assembly size 141824 from https://localhost:5001/_framework/System.Runtime.Numerics.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 111616 from https://localhost:5001/_framework/System.Private.Uri.dll MONO_WASM: Loaded:System.ServiceProcess.dll as assembly size 6144 from https://localhost:5001/_framework/System.ServiceProcess.dll MONO_WASM: Loaded:System.Security.dll as assembly size 8192 from https://localhost:5001/_framework/System.Security.dll MONO_WASM: Loaded:System.Text.Encoding.Extensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.Extensions.dll MONO_WASM: Loaded:System.Text.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 33792 from https://localhost:5001/_framework/System.Runtime.dll MONO_WASM: Loaded:System.Security.AccessControl.dll as assembly size 53248 from https://localhost:5001/_framework/System.Security.AccessControl.dll MONO_WASM: Loaded:System.Runtime.Serialization.Json.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Serialization.Json.dll MONO_WASM: Loaded:System.Security.SecureString.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.SecureString.dll MONO_WASM: Loaded:System.Security.Cryptography.Cng.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Cng.dll MONO_WASM: Loaded:System.Threading.Channels.dll as assembly size 51200 from https://localhost:5001/_framework/System.Threading.Channels.dll MONO_WASM: Loaded:System.Security.Cryptography.Csp.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Csp.dll MONO_WASM: Loaded:System.Security.Cryptography.Algorithms.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.Algorithms.dll MONO_WASM: Loaded:System.Threading.Tasks.Parallel.dll as assembly size 57344 from https://localhost:5001/_framework/System.Threading.Tasks.Parallel.dll MONO_WASM: Loaded:System.Threading.Tasks.dll as assembly size 6656 from https://localhost:5001/_framework/System.Threading.Tasks.dll MONO_WASM: Loaded:System.Threading.Timer.dll as assembly size 5120 from https://localhost:5001/_framework/System.Threading.Timer.dll MONO_WASM: Loaded:System.Security.Cryptography.dll as assembly size 511488 from https://localhost:5001/_framework/System.Security.Cryptography.dll MONO_WASM: Loaded:System.Threading.Thread.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Thread.dll MONO_WASM: Loaded:System.Security.Principal.Windows.dll as assembly size 29184 from https://localhost:5001/_framework/System.Security.Principal.Windows.dll MONO_WASM: Loaded:System.Windows.dll as assembly size 6144 from https://localhost:5001/_framework/System.Windows.dll MONO_WASM: Loaded:System.Threading.Overlapped.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Overlapped.dll MONO_WASM: Loaded:System.Xml.Linq.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.Linq.dll MONO_WASM: Loaded:System.ServiceModel.Web.dll as assembly size 7168 from https://localhost:5001/_framework/System.ServiceModel.Web.dll MONO_WASM: Loaded:System.Threading.Tasks.Extensions.dll as assembly size 6144 from https://localhost:5001/_framework/System.Threading.Tasks.Extensions.dll MONO_WASM: Loaded:System.Threading.dll as assembly size 44032 from https://localhost:5001/_framework/System.Threading.dll MONO_WASM: Loaded:System.Xml.XPath.XDocument.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.XPath.XDocument.dll MONO_WASM: Loaded:System.Xml.ReaderWriter.dll as assembly size 11776 from https://localhost:5001/_framework/System.Xml.ReaderWriter.dll MONO_WASM: Loaded:WindowsBase.dll as assembly size 6144 from https://localhost:5001/_framework/WindowsBase.dll MONO_WASM: Loaded:System.Transactions.dll as assembly size 6656 from https://localhost:5001/_framework/System.Transactions.dll MONO_WASM: Loaded:System.Text.Json.dll as assembly size 643584 from https://localhost:5001/_framework/System.Text.Json.dll MONO_WASM: Loaded:System.Threading.Tasks.Dataflow.dll as assembly size 237568 from https://localhost:5001/_framework/System.Threading.Tasks.Dataflow.dll MONO_WASM: Loaded:System.Security.Principal.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Principal.dll MONO_WASM: Loaded:mscorlib.dll as assembly size 47104 from https://localhost:5001/_framework/mscorlib.dll MONO_WASM: Loaded:System.ValueTuple.dll as assembly size 5632 from https://localhost:5001/_framework/System.ValueTuple.dll MONO_WASM: Loaded:System.Text.Encodings.Web.dll as assembly size 67584 from https://localhost:5001/_framework/System.Text.Encodings.Web.dll MONO_WASM: Loaded:System.Web.HttpUtility.dll as assembly size 19456 from https://localhost:5001/_framework/System.Web.HttpUtility.dll MONO_WASM: Loaded:System.Xml.XPath.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XPath.dll MONO_WASM: Loaded:System.Threading.ThreadPool.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.ThreadPool.dll MONO_WASM: Loaded:System.Xml.XmlSerializer.dll as assembly size 7680 from https://localhost:5001/_framework/System.Xml.XmlSerializer.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.dll as assembly size 6656 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.dll MONO_WASM: Loaded:System.Xml.XDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XDocument.dll MONO_WASM: Loaded:System.dll as assembly size 39936 from https://localhost:5001/_framework/System.dll MONO_WASM: Loaded:System.Xml.dll as assembly size 13824 from https://localhost:5001/_framework/System.Xml.dll MONO_WASM: Loaded:System.Xml.Serialization.dll as assembly size 6656 from https://localhost:5001/_framework/System.Xml.Serialization.dll MONO_WASM: Loaded:netstandard.dll as assembly size 90112 from https://localhost:5001/_framework/netstandard.dll MONO_WASM: Loaded:System.Text.RegularExpressions.dll as assembly size 433152 from https://localhost:5001/_framework/System.Text.RegularExpressions.dll MONO_WASM: Loaded:System.Xml.XmlDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XmlDocument.dll MONO_WASM: Loaded:System.Web.dll as assembly size 5120 from https://localhost:5001/_framework/System.Web.dll MONO_WASM: Loaded:System.Transactions.Local.dll as assembly size 171520 from https://localhost:5001/_framework/System.Transactions.Local.dll MONO_WASM: Loaded:System.Text.Encoding.CodePages.dll as assembly size 775680 from https://localhost:5001/_framework/System.Text.Encoding.CodePages.dll MONO_WASM: Loaded:System.Private.DataContractSerialization.dll as assembly size 956928 from https://localhost:5001/_framework/System.Private.DataContractSerialization.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.dll as assembly size 130560 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.dll as assembly size 84992 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.dll as assembly size 240640 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.dll as assembly size 25088 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.dll MONO_WASM: Loaded:System.Data.Common.dll as assembly size 1294336 from https://localhost:5001/_framework/System.Data.Common.dll MONO_WASM: Loaded:Microsoft.JSInterop.dll as assembly size 58880 from https://localhost:5001/_framework/Microsoft.JSInterop.dll MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.dll as assembly size 12800 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.dll MONO_WASM: Loaded:Microsoft.JSInterop.pdb as pdb size 34308 from https://localhost:5001/_framework/Microsoft.JSInterop.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.pdb as pdb size 44080 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.dll as assembly size 20992 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.pdb as pdb size 15416 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.pdb as pdb size 123316 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.pdb as pdb size 59568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.pdb MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.pdb as pdb size 18148 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.pdb as pdb size 27948 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.pdb as pdb size 21568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.pdb MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from https://localhost:5001/_framework/dotnet.timezones.blat MONO_WASM: Creating file 'dotnet.timezones.blat' in directory '/' MONO_WASM: Loaded:icudt_EFIGS.dat as icu size 550320 from https://localhost:5001/_framework/icudt_EFIGS.dat MONO_WASM: Loaded:System.Private.Xml.dll as assembly size 3859968 from https://localhost:5001/_framework/System.Private.Xml.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 4327936 from https://localhost:5001/_framework/System.Private.CoreLib.dll MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file dotnet.js.symbols. Ignoring. MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime MONO_WASM: postRunAsync 

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

# Conflicts:
#	src/mono/wasm/runtime/diagnostics.ts
#	src/mono/wasm/runtime/dotnet.d.ts
#	src/mono/wasm/runtime/pthreads/worker/index.ts
#	src/mono/wasm/runtime/startup.ts
#	src/mono/wasm/runtime/types.ts
@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Threaded sample isn't happy after the merge. I'm investigating

repro steps:

./build.sh --os browser -c Debug /p:WasmEnablePerfTracing=true
cd src/mono/sample/wasm/browser-eventpipe
make CONFIG=Debug clean publish run V=1 MSBUILD_ARGS=/p:MonoDiagnosticsMock=true

Screen Shot 2022-07-25 at 14 17 04

@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Update: the fix helps, but there is still a problem.

Screenshot from 2022-07-25 19-15-25

I think what's happening is that dotnet.worker.js initializes a Module global and passes it to createDotnetRuntime but this Module = instance assignment (https://github.com/emscripten-core/emscripten/blob/940ae7fe759a81c64e0bde0a41eb33655ad496e1/src/worker.js#L156) is never executed

Which might be because createDotnetRuntimedoesn't return a Promise for some reason. That''s the avenue I'm going to explore tonight. returns a promise that is never settled for some reason.

@lambdageek

Copy link
Copy Markdown
Member

Here's what our dotnet.js and dotnet.worker.js look like from this PR, with threading enabled https://gist.github.com/lambdageek/e54206e2e5365e3f3440a4942a303721#file-dotnet-worker-js

@lambdageek

lambdageek commented Jul 26, 2022

Copy link
Copy Markdown
Member

Ok, so the issue is in this run function in Emscripten. Note that if it's in a pthread, then it doesn't call doRun (or preRun or any of the rest), it calls a different function that's specific to pthreads. In that function it calls readyResolvePromise(Module) but it never calls postRun.

functionrun(args){args=args||arguments_;if(runDependencies>0){return;}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({"cmd": "loaded"});return;}preRun();if(runDependencies>0){return;}functiondoRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}}

So when we do

module.ready=module.ready.then(async()=>{// wait for previous stageawaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

Because nothing resolved afterPostRun, module.ready never resolves, and dotnet.worker.js just returns from self.onmessage ("load") without assigning Module = instance and the worker is left in a bad state.

Update it's less misleading to just return from configure_emscripten_startup without doing anything if we're in a pthread worker. The solution, I think is to change module.ready like this:

module.ready=module.ready.then(async()=>{// wait for previous stage// on pthread workers, postRun is never called, so there is nothing to wait forif(!ENVIRONMENT_IS_PTHREAD)awaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

@pavelsavara

With the above change, the diagnostics sample works for me.

Maybe we should just return from configure_emscripten_startup without changing preRun, onRuntimeInitialized, postRun and ready if we're in a worker since it's just misleading and i'm not sure if running any of the other config-based callbacks makes a ton of sense

@lambdageek

Copy link
Copy Markdown
Member

@pavelsavarapavelsavara#3

As follow-up to this PR we should figure out what kind of JS initialization we want to do in pthread workers. the normal callbacks don't fire. i'm not sure if that's ok or if it's leaving some part of our JS state incorrect.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek there is alredy condition in initializeImportsAndExports and I used it to exit startup sequence for workers.
That makes it work up to

WASM ERROR Error: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Threading.Thread.ThrowIfNoThreadStart(Boolean )
at System.Threading.Thread.Start(Boolean , Boolean )
at System.Threading.Thread.Start()
at Sample.Test.TestMeaning() in C:\Dev\runtime\src\mono\sample\wasm\browser-mt-eventpipe\Program.cs:line 27

Which is I guess some different issue. If the build is green, I will merge as is and we will continue in follow-up PRs.

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Screenshot from 2022-07-25 19-15-25

I noticed on the screenshot that the init_crypto is running multiple times. I think the latest in this PR should not do that anymore.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek when I rebuild with /p:WasmEnableThreads=true and not only /p:WasmEnablePerfTracing=true I could start threads :-D

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is release version
image

@lambdageek

Copy link
Copy Markdown
Member

This is release version
image

That's an asssert that we resumed a thread more times than we suspended it. Probably not due to this PR.

Comment on lines -356 to +316
configure_emscripten_startup(module, exportedAPI);

if (ENVIRONMENT_IS_WORKER) {
// HACK: Emscripten's dotnet.worker.js expects the exports of dotnet.js module to be Module object
// until we have our own fix for dotnet.worker.js file
// we also skip all emscripten startup event and configuration of worker's JS state
// note that emscripten events are not firing either
return <any>exportedAPI.Module;
}

configure_emscripten_startup(module, exportedAPI);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavelsavara

pavelsavara commented Jul 26, 2022

Copy link
Copy Markdown
MemberAuthor

There is well known Not found: args[0] = xLog

There is also timeout on V8+windows

 [wasm test] [09:40:06] info: console.debug: [MONO] AOT: FOUND method System.Runtime.Loader.AssemblyLoadContext:OnProcessExit () [0x181a - 0x181b 0x55dd8]
[wasm test] [09:55:06] info: Process 2844 didn't exit within 00:15:00 and will be killed

LogAnother log

edit: maybe this PR surfaced the #72880

@pavelsavara
pavelsavara merged commit 73374e8 into dotnet:mainJul 26, 2022
radical pushed a commit that referenced this pull request Jul 28, 2022
…tory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
@pavelsavara
pavelsavara deleted the wasm_improve_startup branch July 29, 2022 09:16
@ghostghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@lambdageek@kg@maraf@ilonatommy
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [wasm] improve startup by pavelsavara · Pull Request #72275 · dotnet/runtime · GitHub
Skip to content

[wasm] improve startup - #72275

Merged
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup
Jul 26, 2022
Merged

[wasm] improve startup#72275
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Jul 15, 2022

Copy link
Copy Markdown
Member

streaming wasm instantiation, more parallel download of DLLs

and other goodnes seen in Blazor

  • new hook downloadResource?: (request: ResourceRequest) => LoadingResource allows Blazor to delegate the details to runtime while keeping the caching responsibility.
  • existing config.assets could now have resolvedUrl and pending response. That's blazor could tell us what to load and also provide pending cache promise.
  • made emsripten events async, our callbacks are called in correct order and block on previous one before the next is started.
  • improved log messages
  • load assets into memory as they arrive from network, avoiding memory allocation spike
  • run mono_wasm_pre_init_esential also in Blazor loader. This will fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. This will enable new [JSImport] for blazor.
  • locateFile is now used for all assets including mono-config.json. I also fixed scriptDirectory detection on all but v8+CJS. Therefore apps could be executed from different folder than is dotnet.js location. Credits to @yamachu
  • run init_crypto also on blazor startup sequence

Contributes to #70892
Contributes to #72810

@pavelsavarapavelsavara added this to the 7.0.0 milestone Jul 15, 2022
@pavelsavara
pavelsavara requested review from kg and marafJuly 15, 2022 16:09
@pavelsavarapavelsavara self-assigned this Jul 15, 2022
@pavelsavara
pavelsavara requested a review from lewing as a code ownerJuly 15, 2022 16:09
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • load assemblies into memory synchronously during onRuntimeInitialized because async user postRun run in parallel to each other and therefore can't use loaded assemblies yet. We will do the same in Blazor.
  • run mono_wasm_pre_init_esential also in Blazor loader. This will also fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. We will eliminate it from Blazor code.
Author:pavelsavara
Assignees:pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone:7.0.0

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

I tested with current and also future! Blazor

@lewing
lewing requested a review from lambdageekJuly 15, 2022 16:54
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara

This comment was marked as outdated.

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 8a1057f to d319c22CompareJuly 15, 2022 18:15
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jul 16, 2022

Copy link
Copy Markdown
MemberAuthor

This is the startup sequence for non-blazor

user code in createDotnetRuntime callback MONO_WASM: determined url of dotnet main script to be http://localhost:8000/
MONO_WASM: instantiateWasm MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.wasm' for dotnet.wasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit user code Module.preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_wasm_load_config MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: mono_download_assets MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Console.dll' for System.Console.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.CoreLib.dll' for System.Private.CoreLib.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.Uri.dll' for System.Private.Uri.dll MONO_WASM: instantiateWasm done MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.dll' for System.Runtime.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll' for System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll' for Wasm.Browser.ES6.Sample.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/supportFiles/0_runtimeconfig.bin' for supportFiles/0_runtimeconfig.bin MONO_WASM: Attempting to fetch 'http://localhost:8000/icudt.dat' for icudt.dat MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.timezones.blat' for dotnet.timezones.blat user code Module.preRun MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:System.Console.dll as assembly size 25088 from http://localhost:8000/managed/System.Console.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 1684992 from http://localhost:8000/managed/System.Private.CoreLib.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 80384 from http://localhost:8000/managed/System.Private.Uri.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 6144 from http://localhost:8000/managed/System.Runtime.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 31232 from http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:Wasm.Browser.ES6.Sample.dll as assembly size 17408 from http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll MONO_WASM: Loaded:supportFiles/0_runtimeconfig.bin as vfs size 950 from http://localhost:8000/supportFiles/0_runtimeconfig.bin MONO_WASM: Creating file 'runtimeconfig.bin' in directory '/' MONO_WASM: Loaded:icudt.dat as icu size 1503760 from http://localhost:8000/icudt.dat MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from http://localhost:8000/dotnet.timezones.blat MONO_WASM: Creating directory '/usr/share/zoneinfo' MONO_WASM: Creating file '' in directory '/usr/share/zoneinfo' MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file user code Module.onRuntimeInitialized MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime user code Module.postRun user code after createDotnetRuntime() MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:TestMeaning MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:IsPrime MONO_WASM: Binding [JSImport] Sample.Test.sub from null MONO_WASM: Binding [JSImport] Sample.Test.add from null meaning: 42 ret: 42 Hello, World! WASM EXIT 0 

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 657f65b to d2884fbCompareJuly 17, 2022 08:58
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from d2884fb to 2050175CompareJuly 17, 2022 20:52
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is startup sequence with updated blazor

MONO_WASM: instantiateWasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_download_assets MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: instantiateWasm done MONO_WASM: preRunAsync MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:Microsoft.Extensions.Configuration.dll as assembly size 29696 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Abstractions.dll as assembly size 17920 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Binder.dll as assembly size 29184 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Binder.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Json.dll as assembly size 16384 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Json.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.FileExtensions.dll as assembly size 16896 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.FileExtensions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.Abstractions.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.dll as assembly size 72192 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.dll as assembly size 36352 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Physical.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Physical.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Abstractions.dll as assembly size 12288 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.Abstractions.dll as assembly size 53248 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Primitives.dll as assembly size 31232 from https://localhost:5001/_framework/Microsoft.Extensions.Primitives.dll MONO_WASM: Loaded:Microsoft.Extensions.Options.dll as assembly size 50176 from https://localhost:5001/_framework/Microsoft.Extensions.Options.dll MONO_WASM: Loaded:Microsoft.Extensions.FileSystemGlobbing.dll as assembly size 35840 from https://localhost:5001/_framework/Microsoft.Extensions.FileSystemGlobbing.dll MONO_WASM: Loaded:Microsoft.VisualBasic.dll as assembly size 7680 from https://localhost:5001/_framework/Microsoft.VisualBasic.dll MONO_WASM: Loaded:System.IO.Pipelines.dll as assembly size 70144 from https://localhost:5001/_framework/System.IO.Pipelines.dll MONO_WASM: Loaded:Microsoft.Win32.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/Microsoft.Win32.Primitives.dll MONO_WASM: Loaded:System.AppContext.dll as assembly size 5120 from https://localhost:5001/_framework/System.AppContext.dll MONO_WASM: Loaded:System.Buffers.dll as assembly size 5120 from https://localhost:5001/_framework/System.Buffers.dll MONO_WASM: Loaded:Microsoft.Win32.Registry.dll as assembly size 30208 from https://localhost:5001/_framework/Microsoft.Win32.Registry.dll MONO_WASM: Loaded:System.Collections.Concurrent.dll as assembly size 92672 from https://localhost:5001/_framework/System.Collections.Concurrent.dll MONO_WASM: Loaded:System.Collections.Specialized.dll as assembly size 44032 from https://localhost:5001/_framework/System.Collections.Specialized.dll MONO_WASM: Loaded:System.Collections.dll as assembly size 111104 from https://localhost:5001/_framework/System.Collections.dll MONO_WASM: Loaded:System.ComponentModel.Annotations.dll as assembly size 88576 from https://localhost:5001/_framework/System.ComponentModel.Annotations.dll MONO_WASM: Loaded:System.ComponentModel.DataAnnotations.dll as assembly size 7168 from https://localhost:5001/_framework/System.ComponentModel.DataAnnotations.dll MONO_WASM: Loaded:System.ComponentModel.EventBasedAsync.dll as assembly size 18432 from https://localhost:5001/_framework/System.ComponentModel.EventBasedAsync.dll MONO_WASM: Loaded:System.ComponentModel.dll as assembly size 6656 from https://localhost:5001/_framework/System.ComponentModel.dll MONO_WASM: Loaded:System.ComponentModel.Primitives.dll as assembly size 32256 from https://localhost:5001/_framework/System.ComponentModel.Primitives.dll MONO_WASM: Loaded:System.Configuration.dll as assembly size 9728 from https://localhost:5001/_framework/System.Configuration.dll MONO_WASM: Loaded:System.Collections.NonGeneric.dll as assembly size 43520 from https://localhost:5001/_framework/System.Collections.NonGeneric.dll MONO_WASM: Loaded:System.Console.dll as assembly size 49664 from https://localhost:5001/_framework/System.Console.dll MONO_WASM: Loaded:System.Core.dll as assembly size 13312 from https://localhost:5001/_framework/System.Core.dll MONO_WASM: Loaded:System.ComponentModel.TypeConverter.dll as assembly size 333312 from https://localhost:5001/_framework/System.ComponentModel.TypeConverter.dll MONO_WASM: Loaded:System.Collections.Immutable.dll as assembly size 212480 from https://localhost:5001/_framework/System.Collections.Immutable.dll MONO_WASM: Loaded:System.Data.dll as assembly size 13824 from https://localhost:5001/_framework/System.Data.dll MONO_WASM: Loaded:System.Data.DataSetExtensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Data.DataSetExtensions.dll MONO_WASM: Loaded:System.Diagnostics.FileVersionInfo.dll as assembly size 11776 from https://localhost:5001/_framework/System.Diagnostics.FileVersionInfo.dll MONO_WASM: Loaded:System.Diagnostics.Debug.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Debug.dll MONO_WASM: Loaded:Microsoft.CSharp.dll as assembly size 365568 from https://localhost:5001/_framework/Microsoft.CSharp.dll MONO_WASM: Loaded:System.Diagnostics.Process.dll as assembly size 55808 from https://localhost:5001/_framework/System.Diagnostics.Process.dll MONO_WASM: Loaded:System.Diagnostics.DiagnosticSource.dll as assembly size 151040 from https://localhost:5001/_framework/System.Diagnostics.DiagnosticSource.dll MONO_WASM: Loaded:Microsoft.VisualBasic.Core.dll as assembly size 516096 from https://localhost:5001/_framework/Microsoft.VisualBasic.Core.dll MONO_WASM: Loaded:System.Diagnostics.Contracts.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Contracts.dll MONO_WASM: Loaded:System.Diagnostics.StackTrace.dll as assembly size 16896 from https://localhost:5001/_framework/System.Diagnostics.StackTrace.dll MONO_WASM: Loaded:System.Diagnostics.Tools.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Tools.dll MONO_WASM: Loaded:System.Diagnostics.TraceSource.dll as assembly size 50176 from https://localhost:5001/_framework/System.Diagnostics.TraceSource.dll MONO_WASM: Loaded:System.Diagnostics.TextWriterTraceListener.dll as assembly size 23040 from https://localhost:5001/_framework/System.Diagnostics.TextWriterTraceListener.dll MONO_WASM: Loaded:System.Formats.Tar.dll as assembly size 32768 from https://localhost:5001/_framework/System.Formats.Tar.dll MONO_WASM: Loaded:System.Diagnostics.Tracing.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Tracing.dll MONO_WASM: Loaded:System.Globalization.Calendars.dll as assembly size 6144 from https://localhost:5001/_framework/System.Globalization.Calendars.dll MONO_WASM: Loaded:System.IO.Compression.Brotli.dll as assembly size 19456 from https://localhost:5001/_framework/System.IO.Compression.Brotli.dll MONO_WASM: Loaded:System.Globalization.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Globalization.Extensions.dll MONO_WASM: Loaded:System.Globalization.dll as assembly size 5632 from https://localhost:5001/_framework/System.Globalization.dll MONO_WASM: Loaded:System.IO.Compression.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.Compression.FileSystem.dll MONO_WASM: Loaded:System.Dynamic.Runtime.dll as assembly size 6144 from https://localhost:5001/_framework/System.Dynamic.Runtime.dll MONO_WASM: Loaded:System.IO.Compression.ZipFile.dll as assembly size 26624 from https://localhost:5001/_framework/System.IO.Compression.ZipFile.dll MONO_WASM: Loaded:System.IO.FileSystem.AccessControl.dll as assembly size 24064 from https://localhost:5001/_framework/System.IO.FileSystem.AccessControl.dll MONO_WASM: Loaded:System.IO.FileSystem.DriveInfo.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.FileSystem.DriveInfo.dll MONO_WASM: Loaded:System.Drawing.dll as assembly size 10752 from https://localhost:5001/_framework/System.Drawing.dll MONO_WASM: Loaded:System.IO.IsolatedStorage.dll as assembly size 27136 from https://localhost:5001/_framework/System.IO.IsolatedStorage.dll MONO_WASM: Loaded:System.Formats.Asn1.dll as assembly size 87040 from https://localhost:5001/_framework/System.Formats.Asn1.dll MONO_WASM: Loaded:System.IO.Compression.dll as assembly size 119808 from https://localhost:5001/_framework/System.IO.Compression.dll MONO_WASM: Loaded:System.IO.FileSystem.Watcher.dll as assembly size 25600 from https://localhost:5001/_framework/System.IO.FileSystem.Watcher.dll MONO_WASM: Loaded:System.IO.FileSystem.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.FileSystem.Primitives.dll MONO_WASM: Loaded:System.IO.MemoryMappedFiles.dll as assembly size 45056 from https://localhost:5001/_framework/System.IO.MemoryMappedFiles.dll MONO_WASM: Loaded:System.IO.UnmanagedMemoryStream.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.UnmanagedMemoryStream.dll MONO_WASM: Loaded:System.IO.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.FileSystem.dll MONO_WASM: Loaded:System.IO.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.dll MONO_WASM: Loaded:System.Drawing.Primitives.dll as assembly size 54784 from https://localhost:5001/_framework/System.Drawing.Primitives.dll MONO_WASM: Loaded:System.Linq.Queryable.dll as assembly size 86528 from https://localhost:5001/_framework/System.Linq.Queryable.dll MONO_WASM: Loaded:System.IO.Pipes.AccessControl.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.Pipes.AccessControl.dll MONO_WASM: Loaded:System.Net.Http.Json.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.Http.Json.dll MONO_WASM: Loaded:System.Memory.dll as assembly size 50688 from https://localhost:5001/_framework/System.Memory.dll MONO_WASM: Loaded:System.IO.Pipes.dll as assembly size 38400 from https://localhost:5001/_framework/System.IO.Pipes.dll MONO_WASM: Loaded:System.Net.NameResolution.dll as assembly size 14848 from https://localhost:5001/_framework/System.Net.NameResolution.dll MONO_WASM: Loaded:System.Net.HttpListener.dll as assembly size 60928 from https://localhost:5001/_framework/System.Net.HttpListener.dll MONO_WASM: Loaded:System.Net.ServicePoint.dll as assembly size 17408 from https://localhost:5001/_framework/System.Net.ServicePoint.dll MONO_WASM: Loaded:System.Net.Primitives.dll as assembly size 99840 from https://localhost:5001/_framework/System.Net.Primitives.dll MONO_WASM: Loaded:System.Net.Ping.dll as assembly size 18432 from https://localhost:5001/_framework/System.Net.Ping.dll MONO_WASM: Loaded:System.Linq.Parallel.dll as assembly size 259584 from https://localhost:5001/_framework/System.Linq.Parallel.dll MONO_WASM: Loaded:System.Linq.dll as assembly size 131584 from https://localhost:5001/_framework/System.Linq.dll MONO_WASM: Loaded:System.Net.Sockets.dll as assembly size 75264 from https://localhost:5001/_framework/System.Net.Sockets.dll MONO_WASM: Loaded:System.Net.Quic.dll as assembly size 33280 from https://localhost:5001/_framework/System.Net.Quic.dll MONO_WASM: Loaded:System.Net.Http.dll as assembly size 297472 from https://localhost:5001/_framework/System.Net.Http.dll MONO_WASM: Loaded:System.Net.Security.dll as assembly size 90624 from https://localhost:5001/_framework/System.Net.Security.dll MONO_WASM: Loaded:System.Net.WebSockets.Client.dll as assembly size 40448 from https://localhost:5001/_framework/System.Net.WebSockets.Client.dll MONO_WASM: Loaded:System.Net.Requests.dll as assembly size 59392 from https://localhost:5001/_framework/System.Net.Requests.dll MONO_WASM: Loaded:System.ObjectModel.dll as assembly size 32768 from https://localhost:5001/_framework/System.ObjectModel.dll MONO_WASM: Loaded:System.Numerics.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.dll MONO_WASM: Loaded:System.Net.WebHeaderCollection.dll as assembly size 26112 from https://localhost:5001/_framework/System.Net.WebHeaderCollection.dll MONO_WASM: Loaded:System.Net.WebClient.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.WebClient.dll MONO_WASM: Loaded:System.Net.WebProxy.dll as assembly size 11264 from https://localhost:5001/_framework/System.Net.WebProxy.dll MONO_WASM: Loaded:System.Reflection.DispatchProxy.dll as assembly size 28160 from https://localhost:5001/_framework/System.Reflection.DispatchProxy.dll MONO_WASM: Loaded:System.Net.NetworkInformation.dll as assembly size 32768 from https://localhost:5001/_framework/System.Net.NetworkInformation.dll MONO_WASM: Loaded:System.Reflection.Emit.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.dll MONO_WASM: Loaded:System.Net.WebSockets.dll as assembly size 86528 from https://localhost:5001/_framework/System.Net.WebSockets.dll MONO_WASM: Loaded:System.Net.Mail.dll as assembly size 109568 from https://localhost:5001/_framework/System.Net.Mail.dll MONO_WASM: Loaded:System.Reflection.Emit.ILGeneration.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.ILGeneration.dll MONO_WASM: Loaded:System.Reflection.TypeExtensions.dll as assembly size 15360 from https://localhost:5001/_framework/System.Reflection.TypeExtensions.dll MONO_WASM: Loaded:System.Net.dll as assembly size 7168 from https://localhost:5001/_framework/System.Net.dll MONO_WASM: Loaded:System.Reflection.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Reflection.Extensions.dll MONO_WASM: Loaded:System.Resources.Reader.dll as assembly size 5120 from https://localhost:5001/_framework/System.Resources.Reader.dll MONO_WASM: Loaded:System.Numerics.Vectors.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.Vectors.dll MONO_WASM: Loaded:System.Reflection.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Primitives.dll MONO_WASM: Loaded:System.Reflection.Emit.Lightweight.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.Lightweight.dll MONO_WASM: Loaded:System.Runtime.Extensions.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.Extensions.dll MONO_WASM: Loaded:System.Runtime.Handles.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.Handles.dll MONO_WASM: Loaded:System.Resources.ResourceManager.dll as assembly size 5632 from https://localhost:5001/_framework/System.Resources.ResourceManager.dll MONO_WASM: Loaded:System.Private.Xml.Linq.dll as assembly size 170496 from https://localhost:5001/_framework/System.Private.Xml.Linq.dll MONO_WASM: Loaded:System.Linq.Expressions.dll as assembly size 656896 from https://localhost:5001/_framework/System.Linq.Expressions.dll MONO_WASM: Loaded:System.Runtime.InteropServices.RuntimeInformation.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.InteropServices.RuntimeInformation.dll MONO_WASM: Loaded:System.Runtime.Intrinsics.dll as assembly size 6656 from https://localhost:5001/_framework/System.Runtime.Intrinsics.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.VisualC.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.CompilerServices.VisualC.dll MONO_WASM: Loaded:System.Resources.Writer.dll as assembly size 19456 from https://localhost:5001/_framework/System.Resources.Writer.dll MONO_WASM: Loaded:System.Runtime.Loader.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Loader.dll MONO_WASM: Loaded:System.Reflection.Metadata.dll as assembly size 512000 from https://localhost:5001/_framework/System.Reflection.Metadata.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.Unsafe.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.CompilerServices.Unsafe.dll MONO_WASM: Loaded:System.Runtime.Serialization.Formatters.dll as assembly size 68096 from https://localhost:5001/_framework/System.Runtime.Serialization.Formatters.dll MONO_WASM: Loaded:System.Reflection.dll as assembly size 6144 from https://localhost:5001/_framework/System.Reflection.dll MONO_WASM: Loaded:System.Security.Claims.dll as assembly size 46080 from https://localhost:5001/_framework/System.Security.Claims.dll MONO_WASM: Loaded:System.Runtime.InteropServices.dll as assembly size 31232 from https://localhost:5001/_framework/System.Runtime.InteropServices.dll MONO_WASM: Loaded:System.Security.Cryptography.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Encoding.dll MONO_WASM: Loaded:System.Security.Cryptography.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Primitives.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 80896 from https://localhost:5001/_framework/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:System.Security.Cryptography.OpenSsl.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.OpenSsl.dll MONO_WASM: Loaded:System.Runtime.Serialization.dll as assembly size 7168 from https://localhost:5001/_framework/System.Runtime.Serialization.dll MONO_WASM: Loaded:System.Runtime.Serialization.Xml.dll as assembly size 6144 from https://localhost:5001/_framework/System.Runtime.Serialization.Xml.dll MONO_WASM: Loaded:System.Security.Cryptography.X509Certificates.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.X509Certificates.dll MONO_WASM: Loaded:System.Runtime.Serialization.Primitives.dll as assembly size 12800 from https://localhost:5001/_framework/System.Runtime.Serialization.Primitives.dll MONO_WASM: Loaded:System.Runtime.Numerics.dll as assembly size 141824 from https://localhost:5001/_framework/System.Runtime.Numerics.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 111616 from https://localhost:5001/_framework/System.Private.Uri.dll MONO_WASM: Loaded:System.ServiceProcess.dll as assembly size 6144 from https://localhost:5001/_framework/System.ServiceProcess.dll MONO_WASM: Loaded:System.Security.dll as assembly size 8192 from https://localhost:5001/_framework/System.Security.dll MONO_WASM: Loaded:System.Text.Encoding.Extensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.Extensions.dll MONO_WASM: Loaded:System.Text.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 33792 from https://localhost:5001/_framework/System.Runtime.dll MONO_WASM: Loaded:System.Security.AccessControl.dll as assembly size 53248 from https://localhost:5001/_framework/System.Security.AccessControl.dll MONO_WASM: Loaded:System.Runtime.Serialization.Json.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Serialization.Json.dll MONO_WASM: Loaded:System.Security.SecureString.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.SecureString.dll MONO_WASM: Loaded:System.Security.Cryptography.Cng.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Cng.dll MONO_WASM: Loaded:System.Threading.Channels.dll as assembly size 51200 from https://localhost:5001/_framework/System.Threading.Channels.dll MONO_WASM: Loaded:System.Security.Cryptography.Csp.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Csp.dll MONO_WASM: Loaded:System.Security.Cryptography.Algorithms.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.Algorithms.dll MONO_WASM: Loaded:System.Threading.Tasks.Parallel.dll as assembly size 57344 from https://localhost:5001/_framework/System.Threading.Tasks.Parallel.dll MONO_WASM: Loaded:System.Threading.Tasks.dll as assembly size 6656 from https://localhost:5001/_framework/System.Threading.Tasks.dll MONO_WASM: Loaded:System.Threading.Timer.dll as assembly size 5120 from https://localhost:5001/_framework/System.Threading.Timer.dll MONO_WASM: Loaded:System.Security.Cryptography.dll as assembly size 511488 from https://localhost:5001/_framework/System.Security.Cryptography.dll MONO_WASM: Loaded:System.Threading.Thread.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Thread.dll MONO_WASM: Loaded:System.Security.Principal.Windows.dll as assembly size 29184 from https://localhost:5001/_framework/System.Security.Principal.Windows.dll MONO_WASM: Loaded:System.Windows.dll as assembly size 6144 from https://localhost:5001/_framework/System.Windows.dll MONO_WASM: Loaded:System.Threading.Overlapped.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Overlapped.dll MONO_WASM: Loaded:System.Xml.Linq.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.Linq.dll MONO_WASM: Loaded:System.ServiceModel.Web.dll as assembly size 7168 from https://localhost:5001/_framework/System.ServiceModel.Web.dll MONO_WASM: Loaded:System.Threading.Tasks.Extensions.dll as assembly size 6144 from https://localhost:5001/_framework/System.Threading.Tasks.Extensions.dll MONO_WASM: Loaded:System.Threading.dll as assembly size 44032 from https://localhost:5001/_framework/System.Threading.dll MONO_WASM: Loaded:System.Xml.XPath.XDocument.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.XPath.XDocument.dll MONO_WASM: Loaded:System.Xml.ReaderWriter.dll as assembly size 11776 from https://localhost:5001/_framework/System.Xml.ReaderWriter.dll MONO_WASM: Loaded:WindowsBase.dll as assembly size 6144 from https://localhost:5001/_framework/WindowsBase.dll MONO_WASM: Loaded:System.Transactions.dll as assembly size 6656 from https://localhost:5001/_framework/System.Transactions.dll MONO_WASM: Loaded:System.Text.Json.dll as assembly size 643584 from https://localhost:5001/_framework/System.Text.Json.dll MONO_WASM: Loaded:System.Threading.Tasks.Dataflow.dll as assembly size 237568 from https://localhost:5001/_framework/System.Threading.Tasks.Dataflow.dll MONO_WASM: Loaded:System.Security.Principal.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Principal.dll MONO_WASM: Loaded:mscorlib.dll as assembly size 47104 from https://localhost:5001/_framework/mscorlib.dll MONO_WASM: Loaded:System.ValueTuple.dll as assembly size 5632 from https://localhost:5001/_framework/System.ValueTuple.dll MONO_WASM: Loaded:System.Text.Encodings.Web.dll as assembly size 67584 from https://localhost:5001/_framework/System.Text.Encodings.Web.dll MONO_WASM: Loaded:System.Web.HttpUtility.dll as assembly size 19456 from https://localhost:5001/_framework/System.Web.HttpUtility.dll MONO_WASM: Loaded:System.Xml.XPath.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XPath.dll MONO_WASM: Loaded:System.Threading.ThreadPool.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.ThreadPool.dll MONO_WASM: Loaded:System.Xml.XmlSerializer.dll as assembly size 7680 from https://localhost:5001/_framework/System.Xml.XmlSerializer.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.dll as assembly size 6656 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.dll MONO_WASM: Loaded:System.Xml.XDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XDocument.dll MONO_WASM: Loaded:System.dll as assembly size 39936 from https://localhost:5001/_framework/System.dll MONO_WASM: Loaded:System.Xml.dll as assembly size 13824 from https://localhost:5001/_framework/System.Xml.dll MONO_WASM: Loaded:System.Xml.Serialization.dll as assembly size 6656 from https://localhost:5001/_framework/System.Xml.Serialization.dll MONO_WASM: Loaded:netstandard.dll as assembly size 90112 from https://localhost:5001/_framework/netstandard.dll MONO_WASM: Loaded:System.Text.RegularExpressions.dll as assembly size 433152 from https://localhost:5001/_framework/System.Text.RegularExpressions.dll MONO_WASM: Loaded:System.Xml.XmlDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XmlDocument.dll MONO_WASM: Loaded:System.Web.dll as assembly size 5120 from https://localhost:5001/_framework/System.Web.dll MONO_WASM: Loaded:System.Transactions.Local.dll as assembly size 171520 from https://localhost:5001/_framework/System.Transactions.Local.dll MONO_WASM: Loaded:System.Text.Encoding.CodePages.dll as assembly size 775680 from https://localhost:5001/_framework/System.Text.Encoding.CodePages.dll MONO_WASM: Loaded:System.Private.DataContractSerialization.dll as assembly size 956928 from https://localhost:5001/_framework/System.Private.DataContractSerialization.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.dll as assembly size 130560 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.dll as assembly size 84992 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.dll as assembly size 240640 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.dll as assembly size 25088 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.dll MONO_WASM: Loaded:System.Data.Common.dll as assembly size 1294336 from https://localhost:5001/_framework/System.Data.Common.dll MONO_WASM: Loaded:Microsoft.JSInterop.dll as assembly size 58880 from https://localhost:5001/_framework/Microsoft.JSInterop.dll MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.dll as assembly size 12800 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.dll MONO_WASM: Loaded:Microsoft.JSInterop.pdb as pdb size 34308 from https://localhost:5001/_framework/Microsoft.JSInterop.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.pdb as pdb size 44080 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.dll as assembly size 20992 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.pdb as pdb size 15416 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.pdb as pdb size 123316 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.pdb as pdb size 59568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.pdb MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.pdb as pdb size 18148 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.pdb as pdb size 27948 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.pdb as pdb size 21568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.pdb MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from https://localhost:5001/_framework/dotnet.timezones.blat MONO_WASM: Creating file 'dotnet.timezones.blat' in directory '/' MONO_WASM: Loaded:icudt_EFIGS.dat as icu size 550320 from https://localhost:5001/_framework/icudt_EFIGS.dat MONO_WASM: Loaded:System.Private.Xml.dll as assembly size 3859968 from https://localhost:5001/_framework/System.Private.Xml.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 4327936 from https://localhost:5001/_framework/System.Private.CoreLib.dll MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file dotnet.js.symbols. Ignoring. MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime MONO_WASM: postRunAsync 

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

# Conflicts:
#	src/mono/wasm/runtime/diagnostics.ts
#	src/mono/wasm/runtime/dotnet.d.ts
#	src/mono/wasm/runtime/pthreads/worker/index.ts
#	src/mono/wasm/runtime/startup.ts
#	src/mono/wasm/runtime/types.ts
@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Threaded sample isn't happy after the merge. I'm investigating

repro steps:

./build.sh --os browser -c Debug /p:WasmEnablePerfTracing=true
cd src/mono/sample/wasm/browser-eventpipe
make CONFIG=Debug clean publish run V=1 MSBUILD_ARGS=/p:MonoDiagnosticsMock=true

Screen Shot 2022-07-25 at 14 17 04

@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Update: the fix helps, but there is still a problem.

Screenshot from 2022-07-25 19-15-25

I think what's happening is that dotnet.worker.js initializes a Module global and passes it to createDotnetRuntime but this Module = instance assignment (https://github.com/emscripten-core/emscripten/blob/940ae7fe759a81c64e0bde0a41eb33655ad496e1/src/worker.js#L156) is never executed

Which might be because createDotnetRuntimedoesn't return a Promise for some reason. That''s the avenue I'm going to explore tonight. returns a promise that is never settled for some reason.

@lambdageek

Copy link
Copy Markdown
Member

Here's what our dotnet.js and dotnet.worker.js look like from this PR, with threading enabled https://gist.github.com/lambdageek/e54206e2e5365e3f3440a4942a303721#file-dotnet-worker-js

@lambdageek

lambdageek commented Jul 26, 2022

Copy link
Copy Markdown
Member

Ok, so the issue is in this run function in Emscripten. Note that if it's in a pthread, then it doesn't call doRun (or preRun or any of the rest), it calls a different function that's specific to pthreads. In that function it calls readyResolvePromise(Module) but it never calls postRun.

functionrun(args){args=args||arguments_;if(runDependencies>0){return;}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({"cmd": "loaded"});return;}preRun();if(runDependencies>0){return;}functiondoRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}}

So when we do

module.ready=module.ready.then(async()=>{// wait for previous stageawaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

Because nothing resolved afterPostRun, module.ready never resolves, and dotnet.worker.js just returns from self.onmessage ("load") without assigning Module = instance and the worker is left in a bad state.

Update it's less misleading to just return from configure_emscripten_startup without doing anything if we're in a pthread worker. The solution, I think is to change module.ready like this:

module.ready=module.ready.then(async()=>{// wait for previous stage// on pthread workers, postRun is never called, so there is nothing to wait forif(!ENVIRONMENT_IS_PTHREAD)awaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

@pavelsavara

With the above change, the diagnostics sample works for me.

Maybe we should just return from configure_emscripten_startup without changing preRun, onRuntimeInitialized, postRun and ready if we're in a worker since it's just misleading and i'm not sure if running any of the other config-based callbacks makes a ton of sense

@lambdageek

Copy link
Copy Markdown
Member

@pavelsavarapavelsavara#3

As follow-up to this PR we should figure out what kind of JS initialization we want to do in pthread workers. the normal callbacks don't fire. i'm not sure if that's ok or if it's leaving some part of our JS state incorrect.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek there is alredy condition in initializeImportsAndExports and I used it to exit startup sequence for workers.
That makes it work up to

WASM ERROR Error: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Threading.Thread.ThrowIfNoThreadStart(Boolean )
at System.Threading.Thread.Start(Boolean , Boolean )
at System.Threading.Thread.Start()
at Sample.Test.TestMeaning() in C:\Dev\runtime\src\mono\sample\wasm\browser-mt-eventpipe\Program.cs:line 27

Which is I guess some different issue. If the build is green, I will merge as is and we will continue in follow-up PRs.

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Screenshot from 2022-07-25 19-15-25

I noticed on the screenshot that the init_crypto is running multiple times. I think the latest in this PR should not do that anymore.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek when I rebuild with /p:WasmEnableThreads=true and not only /p:WasmEnablePerfTracing=true I could start threads :-D

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is release version
image

@lambdageek

Copy link
Copy Markdown
Member

This is release version
image

That's an asssert that we resumed a thread more times than we suspended it. Probably not due to this PR.

Comment on lines -356 to +316
configure_emscripten_startup(module, exportedAPI);

if (ENVIRONMENT_IS_WORKER) {
// HACK: Emscripten's dotnet.worker.js expects the exports of dotnet.js module to be Module object
// until we have our own fix for dotnet.worker.js file
// we also skip all emscripten startup event and configuration of worker's JS state
// note that emscripten events are not firing either
return <any>exportedAPI.Module;
}

configure_emscripten_startup(module, exportedAPI);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavelsavara

pavelsavara commented Jul 26, 2022

Copy link
Copy Markdown
MemberAuthor

There is well known Not found: args[0] = xLog

There is also timeout on V8+windows

 [wasm test] [09:40:06] info: console.debug: [MONO] AOT: FOUND method System.Runtime.Loader.AssemblyLoadContext:OnProcessExit () [0x181a - 0x181b 0x55dd8]
[wasm test] [09:55:06] info: Process 2844 didn't exit within 00:15:00 and will be killed

LogAnother log

edit: maybe this PR surfaced the #72880

@pavelsavara
pavelsavara merged commit 73374e8 into dotnet:mainJul 26, 2022
radical pushed a commit that referenced this pull request Jul 28, 2022
…tory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
@pavelsavara
pavelsavara deleted the wasm_improve_startup branch July 29, 2022 09:16
@ghostghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@lambdageek@kg@maraf@ilonatommy
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [wasm] improve startup by pavelsavara · Pull Request #72275 · dotnet/runtime · GitHub
Skip to content

[wasm] improve startup - #72275

Merged
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup
Jul 26, 2022
Merged

[wasm] improve startup#72275
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Jul 15, 2022

Copy link
Copy Markdown
Member

streaming wasm instantiation, more parallel download of DLLs

and other goodnes seen in Blazor

  • new hook downloadResource?: (request: ResourceRequest) => LoadingResource allows Blazor to delegate the details to runtime while keeping the caching responsibility.
  • existing config.assets could now have resolvedUrl and pending response. That's blazor could tell us what to load and also provide pending cache promise.
  • made emsripten events async, our callbacks are called in correct order and block on previous one before the next is started.
  • improved log messages
  • load assets into memory as they arrive from network, avoiding memory allocation spike
  • run mono_wasm_pre_init_esential also in Blazor loader. This will fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. This will enable new [JSImport] for blazor.
  • locateFile is now used for all assets including mono-config.json. I also fixed scriptDirectory detection on all but v8+CJS. Therefore apps could be executed from different folder than is dotnet.js location. Credits to @yamachu
  • run init_crypto also on blazor startup sequence

Contributes to #70892
Contributes to #72810

@pavelsavarapavelsavara added this to the 7.0.0 milestone Jul 15, 2022
@pavelsavara
pavelsavara requested review from kg and marafJuly 15, 2022 16:09
@pavelsavarapavelsavara self-assigned this Jul 15, 2022
@pavelsavara
pavelsavara requested a review from lewing as a code ownerJuly 15, 2022 16:09
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • load assemblies into memory synchronously during onRuntimeInitialized because async user postRun run in parallel to each other and therefore can't use loaded assemblies yet. We will do the same in Blazor.
  • run mono_wasm_pre_init_esential also in Blazor loader. This will also fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. We will eliminate it from Blazor code.
Author:pavelsavara
Assignees:pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone:7.0.0

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

I tested with current and also future! Blazor

@lewing
lewing requested a review from lambdageekJuly 15, 2022 16:54
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara

This comment was marked as outdated.

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 8a1057f to d319c22CompareJuly 15, 2022 18:15
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jul 16, 2022

Copy link
Copy Markdown
MemberAuthor

This is the startup sequence for non-blazor

user code in createDotnetRuntime callback MONO_WASM: determined url of dotnet main script to be http://localhost:8000/
MONO_WASM: instantiateWasm MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.wasm' for dotnet.wasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit user code Module.preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_wasm_load_config MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: mono_download_assets MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Console.dll' for System.Console.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.CoreLib.dll' for System.Private.CoreLib.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.Uri.dll' for System.Private.Uri.dll MONO_WASM: instantiateWasm done MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.dll' for System.Runtime.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll' for System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll' for Wasm.Browser.ES6.Sample.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/supportFiles/0_runtimeconfig.bin' for supportFiles/0_runtimeconfig.bin MONO_WASM: Attempting to fetch 'http://localhost:8000/icudt.dat' for icudt.dat MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.timezones.blat' for dotnet.timezones.blat user code Module.preRun MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:System.Console.dll as assembly size 25088 from http://localhost:8000/managed/System.Console.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 1684992 from http://localhost:8000/managed/System.Private.CoreLib.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 80384 from http://localhost:8000/managed/System.Private.Uri.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 6144 from http://localhost:8000/managed/System.Runtime.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 31232 from http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:Wasm.Browser.ES6.Sample.dll as assembly size 17408 from http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll MONO_WASM: Loaded:supportFiles/0_runtimeconfig.bin as vfs size 950 from http://localhost:8000/supportFiles/0_runtimeconfig.bin MONO_WASM: Creating file 'runtimeconfig.bin' in directory '/' MONO_WASM: Loaded:icudt.dat as icu size 1503760 from http://localhost:8000/icudt.dat MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from http://localhost:8000/dotnet.timezones.blat MONO_WASM: Creating directory '/usr/share/zoneinfo' MONO_WASM: Creating file '' in directory '/usr/share/zoneinfo' MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file user code Module.onRuntimeInitialized MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime user code Module.postRun user code after createDotnetRuntime() MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:TestMeaning MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:IsPrime MONO_WASM: Binding [JSImport] Sample.Test.sub from null MONO_WASM: Binding [JSImport] Sample.Test.add from null meaning: 42 ret: 42 Hello, World! WASM EXIT 0 

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 657f65b to d2884fbCompareJuly 17, 2022 08:58
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from d2884fb to 2050175CompareJuly 17, 2022 20:52
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is startup sequence with updated blazor

MONO_WASM: instantiateWasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_download_assets MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: instantiateWasm done MONO_WASM: preRunAsync MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:Microsoft.Extensions.Configuration.dll as assembly size 29696 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Abstractions.dll as assembly size 17920 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Binder.dll as assembly size 29184 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Binder.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Json.dll as assembly size 16384 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Json.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.FileExtensions.dll as assembly size 16896 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.FileExtensions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.Abstractions.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.dll as assembly size 72192 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.dll as assembly size 36352 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Physical.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Physical.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Abstractions.dll as assembly size 12288 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.Abstractions.dll as assembly size 53248 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Primitives.dll as assembly size 31232 from https://localhost:5001/_framework/Microsoft.Extensions.Primitives.dll MONO_WASM: Loaded:Microsoft.Extensions.Options.dll as assembly size 50176 from https://localhost:5001/_framework/Microsoft.Extensions.Options.dll MONO_WASM: Loaded:Microsoft.Extensions.FileSystemGlobbing.dll as assembly size 35840 from https://localhost:5001/_framework/Microsoft.Extensions.FileSystemGlobbing.dll MONO_WASM: Loaded:Microsoft.VisualBasic.dll as assembly size 7680 from https://localhost:5001/_framework/Microsoft.VisualBasic.dll MONO_WASM: Loaded:System.IO.Pipelines.dll as assembly size 70144 from https://localhost:5001/_framework/System.IO.Pipelines.dll MONO_WASM: Loaded:Microsoft.Win32.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/Microsoft.Win32.Primitives.dll MONO_WASM: Loaded:System.AppContext.dll as assembly size 5120 from https://localhost:5001/_framework/System.AppContext.dll MONO_WASM: Loaded:System.Buffers.dll as assembly size 5120 from https://localhost:5001/_framework/System.Buffers.dll MONO_WASM: Loaded:Microsoft.Win32.Registry.dll as assembly size 30208 from https://localhost:5001/_framework/Microsoft.Win32.Registry.dll MONO_WASM: Loaded:System.Collections.Concurrent.dll as assembly size 92672 from https://localhost:5001/_framework/System.Collections.Concurrent.dll MONO_WASM: Loaded:System.Collections.Specialized.dll as assembly size 44032 from https://localhost:5001/_framework/System.Collections.Specialized.dll MONO_WASM: Loaded:System.Collections.dll as assembly size 111104 from https://localhost:5001/_framework/System.Collections.dll MONO_WASM: Loaded:System.ComponentModel.Annotations.dll as assembly size 88576 from https://localhost:5001/_framework/System.ComponentModel.Annotations.dll MONO_WASM: Loaded:System.ComponentModel.DataAnnotations.dll as assembly size 7168 from https://localhost:5001/_framework/System.ComponentModel.DataAnnotations.dll MONO_WASM: Loaded:System.ComponentModel.EventBasedAsync.dll as assembly size 18432 from https://localhost:5001/_framework/System.ComponentModel.EventBasedAsync.dll MONO_WASM: Loaded:System.ComponentModel.dll as assembly size 6656 from https://localhost:5001/_framework/System.ComponentModel.dll MONO_WASM: Loaded:System.ComponentModel.Primitives.dll as assembly size 32256 from https://localhost:5001/_framework/System.ComponentModel.Primitives.dll MONO_WASM: Loaded:System.Configuration.dll as assembly size 9728 from https://localhost:5001/_framework/System.Configuration.dll MONO_WASM: Loaded:System.Collections.NonGeneric.dll as assembly size 43520 from https://localhost:5001/_framework/System.Collections.NonGeneric.dll MONO_WASM: Loaded:System.Console.dll as assembly size 49664 from https://localhost:5001/_framework/System.Console.dll MONO_WASM: Loaded:System.Core.dll as assembly size 13312 from https://localhost:5001/_framework/System.Core.dll MONO_WASM: Loaded:System.ComponentModel.TypeConverter.dll as assembly size 333312 from https://localhost:5001/_framework/System.ComponentModel.TypeConverter.dll MONO_WASM: Loaded:System.Collections.Immutable.dll as assembly size 212480 from https://localhost:5001/_framework/System.Collections.Immutable.dll MONO_WASM: Loaded:System.Data.dll as assembly size 13824 from https://localhost:5001/_framework/System.Data.dll MONO_WASM: Loaded:System.Data.DataSetExtensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Data.DataSetExtensions.dll MONO_WASM: Loaded:System.Diagnostics.FileVersionInfo.dll as assembly size 11776 from https://localhost:5001/_framework/System.Diagnostics.FileVersionInfo.dll MONO_WASM: Loaded:System.Diagnostics.Debug.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Debug.dll MONO_WASM: Loaded:Microsoft.CSharp.dll as assembly size 365568 from https://localhost:5001/_framework/Microsoft.CSharp.dll MONO_WASM: Loaded:System.Diagnostics.Process.dll as assembly size 55808 from https://localhost:5001/_framework/System.Diagnostics.Process.dll MONO_WASM: Loaded:System.Diagnostics.DiagnosticSource.dll as assembly size 151040 from https://localhost:5001/_framework/System.Diagnostics.DiagnosticSource.dll MONO_WASM: Loaded:Microsoft.VisualBasic.Core.dll as assembly size 516096 from https://localhost:5001/_framework/Microsoft.VisualBasic.Core.dll MONO_WASM: Loaded:System.Diagnostics.Contracts.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Contracts.dll MONO_WASM: Loaded:System.Diagnostics.StackTrace.dll as assembly size 16896 from https://localhost:5001/_framework/System.Diagnostics.StackTrace.dll MONO_WASM: Loaded:System.Diagnostics.Tools.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Tools.dll MONO_WASM: Loaded:System.Diagnostics.TraceSource.dll as assembly size 50176 from https://localhost:5001/_framework/System.Diagnostics.TraceSource.dll MONO_WASM: Loaded:System.Diagnostics.TextWriterTraceListener.dll as assembly size 23040 from https://localhost:5001/_framework/System.Diagnostics.TextWriterTraceListener.dll MONO_WASM: Loaded:System.Formats.Tar.dll as assembly size 32768 from https://localhost:5001/_framework/System.Formats.Tar.dll MONO_WASM: Loaded:System.Diagnostics.Tracing.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Tracing.dll MONO_WASM: Loaded:System.Globalization.Calendars.dll as assembly size 6144 from https://localhost:5001/_framework/System.Globalization.Calendars.dll MONO_WASM: Loaded:System.IO.Compression.Brotli.dll as assembly size 19456 from https://localhost:5001/_framework/System.IO.Compression.Brotli.dll MONO_WASM: Loaded:System.Globalization.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Globalization.Extensions.dll MONO_WASM: Loaded:System.Globalization.dll as assembly size 5632 from https://localhost:5001/_framework/System.Globalization.dll MONO_WASM: Loaded:System.IO.Compression.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.Compression.FileSystem.dll MONO_WASM: Loaded:System.Dynamic.Runtime.dll as assembly size 6144 from https://localhost:5001/_framework/System.Dynamic.Runtime.dll MONO_WASM: Loaded:System.IO.Compression.ZipFile.dll as assembly size 26624 from https://localhost:5001/_framework/System.IO.Compression.ZipFile.dll MONO_WASM: Loaded:System.IO.FileSystem.AccessControl.dll as assembly size 24064 from https://localhost:5001/_framework/System.IO.FileSystem.AccessControl.dll MONO_WASM: Loaded:System.IO.FileSystem.DriveInfo.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.FileSystem.DriveInfo.dll MONO_WASM: Loaded:System.Drawing.dll as assembly size 10752 from https://localhost:5001/_framework/System.Drawing.dll MONO_WASM: Loaded:System.IO.IsolatedStorage.dll as assembly size 27136 from https://localhost:5001/_framework/System.IO.IsolatedStorage.dll MONO_WASM: Loaded:System.Formats.Asn1.dll as assembly size 87040 from https://localhost:5001/_framework/System.Formats.Asn1.dll MONO_WASM: Loaded:System.IO.Compression.dll as assembly size 119808 from https://localhost:5001/_framework/System.IO.Compression.dll MONO_WASM: Loaded:System.IO.FileSystem.Watcher.dll as assembly size 25600 from https://localhost:5001/_framework/System.IO.FileSystem.Watcher.dll MONO_WASM: Loaded:System.IO.FileSystem.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.FileSystem.Primitives.dll MONO_WASM: Loaded:System.IO.MemoryMappedFiles.dll as assembly size 45056 from https://localhost:5001/_framework/System.IO.MemoryMappedFiles.dll MONO_WASM: Loaded:System.IO.UnmanagedMemoryStream.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.UnmanagedMemoryStream.dll MONO_WASM: Loaded:System.IO.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.FileSystem.dll MONO_WASM: Loaded:System.IO.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.dll MONO_WASM: Loaded:System.Drawing.Primitives.dll as assembly size 54784 from https://localhost:5001/_framework/System.Drawing.Primitives.dll MONO_WASM: Loaded:System.Linq.Queryable.dll as assembly size 86528 from https://localhost:5001/_framework/System.Linq.Queryable.dll MONO_WASM: Loaded:System.IO.Pipes.AccessControl.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.Pipes.AccessControl.dll MONO_WASM: Loaded:System.Net.Http.Json.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.Http.Json.dll MONO_WASM: Loaded:System.Memory.dll as assembly size 50688 from https://localhost:5001/_framework/System.Memory.dll MONO_WASM: Loaded:System.IO.Pipes.dll as assembly size 38400 from https://localhost:5001/_framework/System.IO.Pipes.dll MONO_WASM: Loaded:System.Net.NameResolution.dll as assembly size 14848 from https://localhost:5001/_framework/System.Net.NameResolution.dll MONO_WASM: Loaded:System.Net.HttpListener.dll as assembly size 60928 from https://localhost:5001/_framework/System.Net.HttpListener.dll MONO_WASM: Loaded:System.Net.ServicePoint.dll as assembly size 17408 from https://localhost:5001/_framework/System.Net.ServicePoint.dll MONO_WASM: Loaded:System.Net.Primitives.dll as assembly size 99840 from https://localhost:5001/_framework/System.Net.Primitives.dll MONO_WASM: Loaded:System.Net.Ping.dll as assembly size 18432 from https://localhost:5001/_framework/System.Net.Ping.dll MONO_WASM: Loaded:System.Linq.Parallel.dll as assembly size 259584 from https://localhost:5001/_framework/System.Linq.Parallel.dll MONO_WASM: Loaded:System.Linq.dll as assembly size 131584 from https://localhost:5001/_framework/System.Linq.dll MONO_WASM: Loaded:System.Net.Sockets.dll as assembly size 75264 from https://localhost:5001/_framework/System.Net.Sockets.dll MONO_WASM: Loaded:System.Net.Quic.dll as assembly size 33280 from https://localhost:5001/_framework/System.Net.Quic.dll MONO_WASM: Loaded:System.Net.Http.dll as assembly size 297472 from https://localhost:5001/_framework/System.Net.Http.dll MONO_WASM: Loaded:System.Net.Security.dll as assembly size 90624 from https://localhost:5001/_framework/System.Net.Security.dll MONO_WASM: Loaded:System.Net.WebSockets.Client.dll as assembly size 40448 from https://localhost:5001/_framework/System.Net.WebSockets.Client.dll MONO_WASM: Loaded:System.Net.Requests.dll as assembly size 59392 from https://localhost:5001/_framework/System.Net.Requests.dll MONO_WASM: Loaded:System.ObjectModel.dll as assembly size 32768 from https://localhost:5001/_framework/System.ObjectModel.dll MONO_WASM: Loaded:System.Numerics.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.dll MONO_WASM: Loaded:System.Net.WebHeaderCollection.dll as assembly size 26112 from https://localhost:5001/_framework/System.Net.WebHeaderCollection.dll MONO_WASM: Loaded:System.Net.WebClient.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.WebClient.dll MONO_WASM: Loaded:System.Net.WebProxy.dll as assembly size 11264 from https://localhost:5001/_framework/System.Net.WebProxy.dll MONO_WASM: Loaded:System.Reflection.DispatchProxy.dll as assembly size 28160 from https://localhost:5001/_framework/System.Reflection.DispatchProxy.dll MONO_WASM: Loaded:System.Net.NetworkInformation.dll as assembly size 32768 from https://localhost:5001/_framework/System.Net.NetworkInformation.dll MONO_WASM: Loaded:System.Reflection.Emit.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.dll MONO_WASM: Loaded:System.Net.WebSockets.dll as assembly size 86528 from https://localhost:5001/_framework/System.Net.WebSockets.dll MONO_WASM: Loaded:System.Net.Mail.dll as assembly size 109568 from https://localhost:5001/_framework/System.Net.Mail.dll MONO_WASM: Loaded:System.Reflection.Emit.ILGeneration.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.ILGeneration.dll MONO_WASM: Loaded:System.Reflection.TypeExtensions.dll as assembly size 15360 from https://localhost:5001/_framework/System.Reflection.TypeExtensions.dll MONO_WASM: Loaded:System.Net.dll as assembly size 7168 from https://localhost:5001/_framework/System.Net.dll MONO_WASM: Loaded:System.Reflection.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Reflection.Extensions.dll MONO_WASM: Loaded:System.Resources.Reader.dll as assembly size 5120 from https://localhost:5001/_framework/System.Resources.Reader.dll MONO_WASM: Loaded:System.Numerics.Vectors.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.Vectors.dll MONO_WASM: Loaded:System.Reflection.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Primitives.dll MONO_WASM: Loaded:System.Reflection.Emit.Lightweight.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.Lightweight.dll MONO_WASM: Loaded:System.Runtime.Extensions.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.Extensions.dll MONO_WASM: Loaded:System.Runtime.Handles.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.Handles.dll MONO_WASM: Loaded:System.Resources.ResourceManager.dll as assembly size 5632 from https://localhost:5001/_framework/System.Resources.ResourceManager.dll MONO_WASM: Loaded:System.Private.Xml.Linq.dll as assembly size 170496 from https://localhost:5001/_framework/System.Private.Xml.Linq.dll MONO_WASM: Loaded:System.Linq.Expressions.dll as assembly size 656896 from https://localhost:5001/_framework/System.Linq.Expressions.dll MONO_WASM: Loaded:System.Runtime.InteropServices.RuntimeInformation.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.InteropServices.RuntimeInformation.dll MONO_WASM: Loaded:System.Runtime.Intrinsics.dll as assembly size 6656 from https://localhost:5001/_framework/System.Runtime.Intrinsics.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.VisualC.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.CompilerServices.VisualC.dll MONO_WASM: Loaded:System.Resources.Writer.dll as assembly size 19456 from https://localhost:5001/_framework/System.Resources.Writer.dll MONO_WASM: Loaded:System.Runtime.Loader.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Loader.dll MONO_WASM: Loaded:System.Reflection.Metadata.dll as assembly size 512000 from https://localhost:5001/_framework/System.Reflection.Metadata.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.Unsafe.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.CompilerServices.Unsafe.dll MONO_WASM: Loaded:System.Runtime.Serialization.Formatters.dll as assembly size 68096 from https://localhost:5001/_framework/System.Runtime.Serialization.Formatters.dll MONO_WASM: Loaded:System.Reflection.dll as assembly size 6144 from https://localhost:5001/_framework/System.Reflection.dll MONO_WASM: Loaded:System.Security.Claims.dll as assembly size 46080 from https://localhost:5001/_framework/System.Security.Claims.dll MONO_WASM: Loaded:System.Runtime.InteropServices.dll as assembly size 31232 from https://localhost:5001/_framework/System.Runtime.InteropServices.dll MONO_WASM: Loaded:System.Security.Cryptography.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Encoding.dll MONO_WASM: Loaded:System.Security.Cryptography.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Primitives.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 80896 from https://localhost:5001/_framework/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:System.Security.Cryptography.OpenSsl.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.OpenSsl.dll MONO_WASM: Loaded:System.Runtime.Serialization.dll as assembly size 7168 from https://localhost:5001/_framework/System.Runtime.Serialization.dll MONO_WASM: Loaded:System.Runtime.Serialization.Xml.dll as assembly size 6144 from https://localhost:5001/_framework/System.Runtime.Serialization.Xml.dll MONO_WASM: Loaded:System.Security.Cryptography.X509Certificates.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.X509Certificates.dll MONO_WASM: Loaded:System.Runtime.Serialization.Primitives.dll as assembly size 12800 from https://localhost:5001/_framework/System.Runtime.Serialization.Primitives.dll MONO_WASM: Loaded:System.Runtime.Numerics.dll as assembly size 141824 from https://localhost:5001/_framework/System.Runtime.Numerics.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 111616 from https://localhost:5001/_framework/System.Private.Uri.dll MONO_WASM: Loaded:System.ServiceProcess.dll as assembly size 6144 from https://localhost:5001/_framework/System.ServiceProcess.dll MONO_WASM: Loaded:System.Security.dll as assembly size 8192 from https://localhost:5001/_framework/System.Security.dll MONO_WASM: Loaded:System.Text.Encoding.Extensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.Extensions.dll MONO_WASM: Loaded:System.Text.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 33792 from https://localhost:5001/_framework/System.Runtime.dll MONO_WASM: Loaded:System.Security.AccessControl.dll as assembly size 53248 from https://localhost:5001/_framework/System.Security.AccessControl.dll MONO_WASM: Loaded:System.Runtime.Serialization.Json.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Serialization.Json.dll MONO_WASM: Loaded:System.Security.SecureString.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.SecureString.dll MONO_WASM: Loaded:System.Security.Cryptography.Cng.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Cng.dll MONO_WASM: Loaded:System.Threading.Channels.dll as assembly size 51200 from https://localhost:5001/_framework/System.Threading.Channels.dll MONO_WASM: Loaded:System.Security.Cryptography.Csp.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Csp.dll MONO_WASM: Loaded:System.Security.Cryptography.Algorithms.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.Algorithms.dll MONO_WASM: Loaded:System.Threading.Tasks.Parallel.dll as assembly size 57344 from https://localhost:5001/_framework/System.Threading.Tasks.Parallel.dll MONO_WASM: Loaded:System.Threading.Tasks.dll as assembly size 6656 from https://localhost:5001/_framework/System.Threading.Tasks.dll MONO_WASM: Loaded:System.Threading.Timer.dll as assembly size 5120 from https://localhost:5001/_framework/System.Threading.Timer.dll MONO_WASM: Loaded:System.Security.Cryptography.dll as assembly size 511488 from https://localhost:5001/_framework/System.Security.Cryptography.dll MONO_WASM: Loaded:System.Threading.Thread.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Thread.dll MONO_WASM: Loaded:System.Security.Principal.Windows.dll as assembly size 29184 from https://localhost:5001/_framework/System.Security.Principal.Windows.dll MONO_WASM: Loaded:System.Windows.dll as assembly size 6144 from https://localhost:5001/_framework/System.Windows.dll MONO_WASM: Loaded:System.Threading.Overlapped.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Overlapped.dll MONO_WASM: Loaded:System.Xml.Linq.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.Linq.dll MONO_WASM: Loaded:System.ServiceModel.Web.dll as assembly size 7168 from https://localhost:5001/_framework/System.ServiceModel.Web.dll MONO_WASM: Loaded:System.Threading.Tasks.Extensions.dll as assembly size 6144 from https://localhost:5001/_framework/System.Threading.Tasks.Extensions.dll MONO_WASM: Loaded:System.Threading.dll as assembly size 44032 from https://localhost:5001/_framework/System.Threading.dll MONO_WASM: Loaded:System.Xml.XPath.XDocument.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.XPath.XDocument.dll MONO_WASM: Loaded:System.Xml.ReaderWriter.dll as assembly size 11776 from https://localhost:5001/_framework/System.Xml.ReaderWriter.dll MONO_WASM: Loaded:WindowsBase.dll as assembly size 6144 from https://localhost:5001/_framework/WindowsBase.dll MONO_WASM: Loaded:System.Transactions.dll as assembly size 6656 from https://localhost:5001/_framework/System.Transactions.dll MONO_WASM: Loaded:System.Text.Json.dll as assembly size 643584 from https://localhost:5001/_framework/System.Text.Json.dll MONO_WASM: Loaded:System.Threading.Tasks.Dataflow.dll as assembly size 237568 from https://localhost:5001/_framework/System.Threading.Tasks.Dataflow.dll MONO_WASM: Loaded:System.Security.Principal.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Principal.dll MONO_WASM: Loaded:mscorlib.dll as assembly size 47104 from https://localhost:5001/_framework/mscorlib.dll MONO_WASM: Loaded:System.ValueTuple.dll as assembly size 5632 from https://localhost:5001/_framework/System.ValueTuple.dll MONO_WASM: Loaded:System.Text.Encodings.Web.dll as assembly size 67584 from https://localhost:5001/_framework/System.Text.Encodings.Web.dll MONO_WASM: Loaded:System.Web.HttpUtility.dll as assembly size 19456 from https://localhost:5001/_framework/System.Web.HttpUtility.dll MONO_WASM: Loaded:System.Xml.XPath.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XPath.dll MONO_WASM: Loaded:System.Threading.ThreadPool.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.ThreadPool.dll MONO_WASM: Loaded:System.Xml.XmlSerializer.dll as assembly size 7680 from https://localhost:5001/_framework/System.Xml.XmlSerializer.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.dll as assembly size 6656 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.dll MONO_WASM: Loaded:System.Xml.XDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XDocument.dll MONO_WASM: Loaded:System.dll as assembly size 39936 from https://localhost:5001/_framework/System.dll MONO_WASM: Loaded:System.Xml.dll as assembly size 13824 from https://localhost:5001/_framework/System.Xml.dll MONO_WASM: Loaded:System.Xml.Serialization.dll as assembly size 6656 from https://localhost:5001/_framework/System.Xml.Serialization.dll MONO_WASM: Loaded:netstandard.dll as assembly size 90112 from https://localhost:5001/_framework/netstandard.dll MONO_WASM: Loaded:System.Text.RegularExpressions.dll as assembly size 433152 from https://localhost:5001/_framework/System.Text.RegularExpressions.dll MONO_WASM: Loaded:System.Xml.XmlDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XmlDocument.dll MONO_WASM: Loaded:System.Web.dll as assembly size 5120 from https://localhost:5001/_framework/System.Web.dll MONO_WASM: Loaded:System.Transactions.Local.dll as assembly size 171520 from https://localhost:5001/_framework/System.Transactions.Local.dll MONO_WASM: Loaded:System.Text.Encoding.CodePages.dll as assembly size 775680 from https://localhost:5001/_framework/System.Text.Encoding.CodePages.dll MONO_WASM: Loaded:System.Private.DataContractSerialization.dll as assembly size 956928 from https://localhost:5001/_framework/System.Private.DataContractSerialization.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.dll as assembly size 130560 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.dll as assembly size 84992 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.dll as assembly size 240640 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.dll as assembly size 25088 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.dll MONO_WASM: Loaded:System.Data.Common.dll as assembly size 1294336 from https://localhost:5001/_framework/System.Data.Common.dll MONO_WASM: Loaded:Microsoft.JSInterop.dll as assembly size 58880 from https://localhost:5001/_framework/Microsoft.JSInterop.dll MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.dll as assembly size 12800 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.dll MONO_WASM: Loaded:Microsoft.JSInterop.pdb as pdb size 34308 from https://localhost:5001/_framework/Microsoft.JSInterop.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.pdb as pdb size 44080 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.dll as assembly size 20992 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.pdb as pdb size 15416 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.pdb as pdb size 123316 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.pdb as pdb size 59568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.pdb MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.pdb as pdb size 18148 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.pdb as pdb size 27948 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.pdb as pdb size 21568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.pdb MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from https://localhost:5001/_framework/dotnet.timezones.blat MONO_WASM: Creating file 'dotnet.timezones.blat' in directory '/' MONO_WASM: Loaded:icudt_EFIGS.dat as icu size 550320 from https://localhost:5001/_framework/icudt_EFIGS.dat MONO_WASM: Loaded:System.Private.Xml.dll as assembly size 3859968 from https://localhost:5001/_framework/System.Private.Xml.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 4327936 from https://localhost:5001/_framework/System.Private.CoreLib.dll MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file dotnet.js.symbols. Ignoring. MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime MONO_WASM: postRunAsync 

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

# Conflicts:
#	src/mono/wasm/runtime/diagnostics.ts
#	src/mono/wasm/runtime/dotnet.d.ts
#	src/mono/wasm/runtime/pthreads/worker/index.ts
#	src/mono/wasm/runtime/startup.ts
#	src/mono/wasm/runtime/types.ts
@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Threaded sample isn't happy after the merge. I'm investigating

repro steps:

./build.sh --os browser -c Debug /p:WasmEnablePerfTracing=true
cd src/mono/sample/wasm/browser-eventpipe
make CONFIG=Debug clean publish run V=1 MSBUILD_ARGS=/p:MonoDiagnosticsMock=true

Screen Shot 2022-07-25 at 14 17 04

@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Update: the fix helps, but there is still a problem.

Screenshot from 2022-07-25 19-15-25

I think what's happening is that dotnet.worker.js initializes a Module global and passes it to createDotnetRuntime but this Module = instance assignment (https://github.com/emscripten-core/emscripten/blob/940ae7fe759a81c64e0bde0a41eb33655ad496e1/src/worker.js#L156) is never executed

Which might be because createDotnetRuntimedoesn't return a Promise for some reason. That''s the avenue I'm going to explore tonight. returns a promise that is never settled for some reason.

@lambdageek

Copy link
Copy Markdown
Member

Here's what our dotnet.js and dotnet.worker.js look like from this PR, with threading enabled https://gist.github.com/lambdageek/e54206e2e5365e3f3440a4942a303721#file-dotnet-worker-js

@lambdageek

lambdageek commented Jul 26, 2022

Copy link
Copy Markdown
Member

Ok, so the issue is in this run function in Emscripten. Note that if it's in a pthread, then it doesn't call doRun (or preRun or any of the rest), it calls a different function that's specific to pthreads. In that function it calls readyResolvePromise(Module) but it never calls postRun.

functionrun(args){args=args||arguments_;if(runDependencies>0){return;}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({"cmd": "loaded"});return;}preRun();if(runDependencies>0){return;}functiondoRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}}

So when we do

module.ready=module.ready.then(async()=>{// wait for previous stageawaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

Because nothing resolved afterPostRun, module.ready never resolves, and dotnet.worker.js just returns from self.onmessage ("load") without assigning Module = instance and the worker is left in a bad state.

Update it's less misleading to just return from configure_emscripten_startup without doing anything if we're in a pthread worker. The solution, I think is to change module.ready like this:

module.ready=module.ready.then(async()=>{// wait for previous stage// on pthread workers, postRun is never called, so there is nothing to wait forif(!ENVIRONMENT_IS_PTHREAD)awaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

@pavelsavara

With the above change, the diagnostics sample works for me.

Maybe we should just return from configure_emscripten_startup without changing preRun, onRuntimeInitialized, postRun and ready if we're in a worker since it's just misleading and i'm not sure if running any of the other config-based callbacks makes a ton of sense

@lambdageek

Copy link
Copy Markdown
Member

@pavelsavarapavelsavara#3

As follow-up to this PR we should figure out what kind of JS initialization we want to do in pthread workers. the normal callbacks don't fire. i'm not sure if that's ok or if it's leaving some part of our JS state incorrect.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek there is alredy condition in initializeImportsAndExports and I used it to exit startup sequence for workers.
That makes it work up to

WASM ERROR Error: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Threading.Thread.ThrowIfNoThreadStart(Boolean )
at System.Threading.Thread.Start(Boolean , Boolean )
at System.Threading.Thread.Start()
at Sample.Test.TestMeaning() in C:\Dev\runtime\src\mono\sample\wasm\browser-mt-eventpipe\Program.cs:line 27

Which is I guess some different issue. If the build is green, I will merge as is and we will continue in follow-up PRs.

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Screenshot from 2022-07-25 19-15-25

I noticed on the screenshot that the init_crypto is running multiple times. I think the latest in this PR should not do that anymore.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek when I rebuild with /p:WasmEnableThreads=true and not only /p:WasmEnablePerfTracing=true I could start threads :-D

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is release version
image

@lambdageek

Copy link
Copy Markdown
Member

This is release version
image

That's an asssert that we resumed a thread more times than we suspended it. Probably not due to this PR.

Comment on lines -356 to +316
configure_emscripten_startup(module, exportedAPI);

if (ENVIRONMENT_IS_WORKER) {
// HACK: Emscripten's dotnet.worker.js expects the exports of dotnet.js module to be Module object
// until we have our own fix for dotnet.worker.js file
// we also skip all emscripten startup event and configuration of worker's JS state
// note that emscripten events are not firing either
return <any>exportedAPI.Module;
}

configure_emscripten_startup(module, exportedAPI);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavelsavara

pavelsavara commented Jul 26, 2022

Copy link
Copy Markdown
MemberAuthor

There is well known Not found: args[0] = xLog

There is also timeout on V8+windows

 [wasm test] [09:40:06] info: console.debug: [MONO] AOT: FOUND method System.Runtime.Loader.AssemblyLoadContext:OnProcessExit () [0x181a - 0x181b 0x55dd8]
[wasm test] [09:55:06] info: Process 2844 didn't exit within 00:15:00 and will be killed

LogAnother log

edit: maybe this PR surfaced the #72880

@pavelsavara
pavelsavara merged commit 73374e8 into dotnet:mainJul 26, 2022
radical pushed a commit that referenced this pull request Jul 28, 2022
…tory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
@pavelsavara
pavelsavara deleted the wasm_improve_startup branch July 29, 2022 09:16
@ghostghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@lambdageek@kg@maraf@ilonatommy
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' [wasm] improve startup by pavelsavara · Pull Request #72275 · dotnet/runtime · GitHub
Skip to content

[wasm] improve startup - #72275

Merged
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup
Jul 26, 2022
Merged

[wasm] improve startup#72275
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Jul 15, 2022

Copy link
Copy Markdown
Member

streaming wasm instantiation, more parallel download of DLLs

and other goodnes seen in Blazor

  • new hook downloadResource?: (request: ResourceRequest) => LoadingResource allows Blazor to delegate the details to runtime while keeping the caching responsibility.
  • existing config.assets could now have resolvedUrl and pending response. That's blazor could tell us what to load and also provide pending cache promise.
  • made emsripten events async, our callbacks are called in correct order and block on previous one before the next is started.
  • improved log messages
  • load assets into memory as they arrive from network, avoiding memory allocation spike
  • run mono_wasm_pre_init_esential also in Blazor loader. This will fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. This will enable new [JSImport] for blazor.
  • locateFile is now used for all assets including mono-config.json. I also fixed scriptDirectory detection on all but v8+CJS. Therefore apps could be executed from different folder than is dotnet.js location. Credits to @yamachu
  • run init_crypto also on blazor startup sequence

Contributes to #70892
Contributes to #72810

@pavelsavarapavelsavara added this to the 7.0.0 milestone Jul 15, 2022
@pavelsavara
pavelsavara requested review from kg and marafJuly 15, 2022 16:09
@pavelsavarapavelsavara self-assigned this Jul 15, 2022
@pavelsavara
pavelsavara requested a review from lewing as a code ownerJuly 15, 2022 16:09
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • load assemblies into memory synchronously during onRuntimeInitialized because async user postRun run in parallel to each other and therefore can't use loaded assemblies yet. We will do the same in Blazor.
  • run mono_wasm_pre_init_esential also in Blazor loader. This will also fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. We will eliminate it from Blazor code.
Author:pavelsavara
Assignees:pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone:7.0.0

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

I tested with current and also future! Blazor

@lewing
lewing requested a review from lambdageekJuly 15, 2022 16:54
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara

This comment was marked as outdated.

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 8a1057f to d319c22CompareJuly 15, 2022 18:15
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jul 16, 2022

Copy link
Copy Markdown
MemberAuthor

This is the startup sequence for non-blazor

user code in createDotnetRuntime callback MONO_WASM: determined url of dotnet main script to be http://localhost:8000/
MONO_WASM: instantiateWasm MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.wasm' for dotnet.wasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit user code Module.preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_wasm_load_config MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: mono_download_assets MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Console.dll' for System.Console.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.CoreLib.dll' for System.Private.CoreLib.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.Uri.dll' for System.Private.Uri.dll MONO_WASM: instantiateWasm done MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.dll' for System.Runtime.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll' for System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll' for Wasm.Browser.ES6.Sample.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/supportFiles/0_runtimeconfig.bin' for supportFiles/0_runtimeconfig.bin MONO_WASM: Attempting to fetch 'http://localhost:8000/icudt.dat' for icudt.dat MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.timezones.blat' for dotnet.timezones.blat user code Module.preRun MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:System.Console.dll as assembly size 25088 from http://localhost:8000/managed/System.Console.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 1684992 from http://localhost:8000/managed/System.Private.CoreLib.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 80384 from http://localhost:8000/managed/System.Private.Uri.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 6144 from http://localhost:8000/managed/System.Runtime.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 31232 from http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:Wasm.Browser.ES6.Sample.dll as assembly size 17408 from http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll MONO_WASM: Loaded:supportFiles/0_runtimeconfig.bin as vfs size 950 from http://localhost:8000/supportFiles/0_runtimeconfig.bin MONO_WASM: Creating file 'runtimeconfig.bin' in directory '/' MONO_WASM: Loaded:icudt.dat as icu size 1503760 from http://localhost:8000/icudt.dat MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from http://localhost:8000/dotnet.timezones.blat MONO_WASM: Creating directory '/usr/share/zoneinfo' MONO_WASM: Creating file '' in directory '/usr/share/zoneinfo' MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file user code Module.onRuntimeInitialized MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime user code Module.postRun user code after createDotnetRuntime() MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:TestMeaning MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:IsPrime MONO_WASM: Binding [JSImport] Sample.Test.sub from null MONO_WASM: Binding [JSImport] Sample.Test.add from null meaning: 42 ret: 42 Hello, World! WASM EXIT 0 

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 657f65b to d2884fbCompareJuly 17, 2022 08:58
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from d2884fb to 2050175CompareJuly 17, 2022 20:52
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is startup sequence with updated blazor

MONO_WASM: instantiateWasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_download_assets MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: instantiateWasm done MONO_WASM: preRunAsync MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:Microsoft.Extensions.Configuration.dll as assembly size 29696 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Abstractions.dll as assembly size 17920 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Binder.dll as assembly size 29184 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Binder.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Json.dll as assembly size 16384 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Json.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.FileExtensions.dll as assembly size 16896 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.FileExtensions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.Abstractions.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.dll as assembly size 72192 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.dll as assembly size 36352 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Physical.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Physical.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Abstractions.dll as assembly size 12288 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.Abstractions.dll as assembly size 53248 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Primitives.dll as assembly size 31232 from https://localhost:5001/_framework/Microsoft.Extensions.Primitives.dll MONO_WASM: Loaded:Microsoft.Extensions.Options.dll as assembly size 50176 from https://localhost:5001/_framework/Microsoft.Extensions.Options.dll MONO_WASM: Loaded:Microsoft.Extensions.FileSystemGlobbing.dll as assembly size 35840 from https://localhost:5001/_framework/Microsoft.Extensions.FileSystemGlobbing.dll MONO_WASM: Loaded:Microsoft.VisualBasic.dll as assembly size 7680 from https://localhost:5001/_framework/Microsoft.VisualBasic.dll MONO_WASM: Loaded:System.IO.Pipelines.dll as assembly size 70144 from https://localhost:5001/_framework/System.IO.Pipelines.dll MONO_WASM: Loaded:Microsoft.Win32.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/Microsoft.Win32.Primitives.dll MONO_WASM: Loaded:System.AppContext.dll as assembly size 5120 from https://localhost:5001/_framework/System.AppContext.dll MONO_WASM: Loaded:System.Buffers.dll as assembly size 5120 from https://localhost:5001/_framework/System.Buffers.dll MONO_WASM: Loaded:Microsoft.Win32.Registry.dll as assembly size 30208 from https://localhost:5001/_framework/Microsoft.Win32.Registry.dll MONO_WASM: Loaded:System.Collections.Concurrent.dll as assembly size 92672 from https://localhost:5001/_framework/System.Collections.Concurrent.dll MONO_WASM: Loaded:System.Collections.Specialized.dll as assembly size 44032 from https://localhost:5001/_framework/System.Collections.Specialized.dll MONO_WASM: Loaded:System.Collections.dll as assembly size 111104 from https://localhost:5001/_framework/System.Collections.dll MONO_WASM: Loaded:System.ComponentModel.Annotations.dll as assembly size 88576 from https://localhost:5001/_framework/System.ComponentModel.Annotations.dll MONO_WASM: Loaded:System.ComponentModel.DataAnnotations.dll as assembly size 7168 from https://localhost:5001/_framework/System.ComponentModel.DataAnnotations.dll MONO_WASM: Loaded:System.ComponentModel.EventBasedAsync.dll as assembly size 18432 from https://localhost:5001/_framework/System.ComponentModel.EventBasedAsync.dll MONO_WASM: Loaded:System.ComponentModel.dll as assembly size 6656 from https://localhost:5001/_framework/System.ComponentModel.dll MONO_WASM: Loaded:System.ComponentModel.Primitives.dll as assembly size 32256 from https://localhost:5001/_framework/System.ComponentModel.Primitives.dll MONO_WASM: Loaded:System.Configuration.dll as assembly size 9728 from https://localhost:5001/_framework/System.Configuration.dll MONO_WASM: Loaded:System.Collections.NonGeneric.dll as assembly size 43520 from https://localhost:5001/_framework/System.Collections.NonGeneric.dll MONO_WASM: Loaded:System.Console.dll as assembly size 49664 from https://localhost:5001/_framework/System.Console.dll MONO_WASM: Loaded:System.Core.dll as assembly size 13312 from https://localhost:5001/_framework/System.Core.dll MONO_WASM: Loaded:System.ComponentModel.TypeConverter.dll as assembly size 333312 from https://localhost:5001/_framework/System.ComponentModel.TypeConverter.dll MONO_WASM: Loaded:System.Collections.Immutable.dll as assembly size 212480 from https://localhost:5001/_framework/System.Collections.Immutable.dll MONO_WASM: Loaded:System.Data.dll as assembly size 13824 from https://localhost:5001/_framework/System.Data.dll MONO_WASM: Loaded:System.Data.DataSetExtensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Data.DataSetExtensions.dll MONO_WASM: Loaded:System.Diagnostics.FileVersionInfo.dll as assembly size 11776 from https://localhost:5001/_framework/System.Diagnostics.FileVersionInfo.dll MONO_WASM: Loaded:System.Diagnostics.Debug.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Debug.dll MONO_WASM: Loaded:Microsoft.CSharp.dll as assembly size 365568 from https://localhost:5001/_framework/Microsoft.CSharp.dll MONO_WASM: Loaded:System.Diagnostics.Process.dll as assembly size 55808 from https://localhost:5001/_framework/System.Diagnostics.Process.dll MONO_WASM: Loaded:System.Diagnostics.DiagnosticSource.dll as assembly size 151040 from https://localhost:5001/_framework/System.Diagnostics.DiagnosticSource.dll MONO_WASM: Loaded:Microsoft.VisualBasic.Core.dll as assembly size 516096 from https://localhost:5001/_framework/Microsoft.VisualBasic.Core.dll MONO_WASM: Loaded:System.Diagnostics.Contracts.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Contracts.dll MONO_WASM: Loaded:System.Diagnostics.StackTrace.dll as assembly size 16896 from https://localhost:5001/_framework/System.Diagnostics.StackTrace.dll MONO_WASM: Loaded:System.Diagnostics.Tools.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Tools.dll MONO_WASM: Loaded:System.Diagnostics.TraceSource.dll as assembly size 50176 from https://localhost:5001/_framework/System.Diagnostics.TraceSource.dll MONO_WASM: Loaded:System.Diagnostics.TextWriterTraceListener.dll as assembly size 23040 from https://localhost:5001/_framework/System.Diagnostics.TextWriterTraceListener.dll MONO_WASM: Loaded:System.Formats.Tar.dll as assembly size 32768 from https://localhost:5001/_framework/System.Formats.Tar.dll MONO_WASM: Loaded:System.Diagnostics.Tracing.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Tracing.dll MONO_WASM: Loaded:System.Globalization.Calendars.dll as assembly size 6144 from https://localhost:5001/_framework/System.Globalization.Calendars.dll MONO_WASM: Loaded:System.IO.Compression.Brotli.dll as assembly size 19456 from https://localhost:5001/_framework/System.IO.Compression.Brotli.dll MONO_WASM: Loaded:System.Globalization.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Globalization.Extensions.dll MONO_WASM: Loaded:System.Globalization.dll as assembly size 5632 from https://localhost:5001/_framework/System.Globalization.dll MONO_WASM: Loaded:System.IO.Compression.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.Compression.FileSystem.dll MONO_WASM: Loaded:System.Dynamic.Runtime.dll as assembly size 6144 from https://localhost:5001/_framework/System.Dynamic.Runtime.dll MONO_WASM: Loaded:System.IO.Compression.ZipFile.dll as assembly size 26624 from https://localhost:5001/_framework/System.IO.Compression.ZipFile.dll MONO_WASM: Loaded:System.IO.FileSystem.AccessControl.dll as assembly size 24064 from https://localhost:5001/_framework/System.IO.FileSystem.AccessControl.dll MONO_WASM: Loaded:System.IO.FileSystem.DriveInfo.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.FileSystem.DriveInfo.dll MONO_WASM: Loaded:System.Drawing.dll as assembly size 10752 from https://localhost:5001/_framework/System.Drawing.dll MONO_WASM: Loaded:System.IO.IsolatedStorage.dll as assembly size 27136 from https://localhost:5001/_framework/System.IO.IsolatedStorage.dll MONO_WASM: Loaded:System.Formats.Asn1.dll as assembly size 87040 from https://localhost:5001/_framework/System.Formats.Asn1.dll MONO_WASM: Loaded:System.IO.Compression.dll as assembly size 119808 from https://localhost:5001/_framework/System.IO.Compression.dll MONO_WASM: Loaded:System.IO.FileSystem.Watcher.dll as assembly size 25600 from https://localhost:5001/_framework/System.IO.FileSystem.Watcher.dll MONO_WASM: Loaded:System.IO.FileSystem.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.FileSystem.Primitives.dll MONO_WASM: Loaded:System.IO.MemoryMappedFiles.dll as assembly size 45056 from https://localhost:5001/_framework/System.IO.MemoryMappedFiles.dll MONO_WASM: Loaded:System.IO.UnmanagedMemoryStream.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.UnmanagedMemoryStream.dll MONO_WASM: Loaded:System.IO.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.FileSystem.dll MONO_WASM: Loaded:System.IO.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.dll MONO_WASM: Loaded:System.Drawing.Primitives.dll as assembly size 54784 from https://localhost:5001/_framework/System.Drawing.Primitives.dll MONO_WASM: Loaded:System.Linq.Queryable.dll as assembly size 86528 from https://localhost:5001/_framework/System.Linq.Queryable.dll MONO_WASM: Loaded:System.IO.Pipes.AccessControl.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.Pipes.AccessControl.dll MONO_WASM: Loaded:System.Net.Http.Json.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.Http.Json.dll MONO_WASM: Loaded:System.Memory.dll as assembly size 50688 from https://localhost:5001/_framework/System.Memory.dll MONO_WASM: Loaded:System.IO.Pipes.dll as assembly size 38400 from https://localhost:5001/_framework/System.IO.Pipes.dll MONO_WASM: Loaded:System.Net.NameResolution.dll as assembly size 14848 from https://localhost:5001/_framework/System.Net.NameResolution.dll MONO_WASM: Loaded:System.Net.HttpListener.dll as assembly size 60928 from https://localhost:5001/_framework/System.Net.HttpListener.dll MONO_WASM: Loaded:System.Net.ServicePoint.dll as assembly size 17408 from https://localhost:5001/_framework/System.Net.ServicePoint.dll MONO_WASM: Loaded:System.Net.Primitives.dll as assembly size 99840 from https://localhost:5001/_framework/System.Net.Primitives.dll MONO_WASM: Loaded:System.Net.Ping.dll as assembly size 18432 from https://localhost:5001/_framework/System.Net.Ping.dll MONO_WASM: Loaded:System.Linq.Parallel.dll as assembly size 259584 from https://localhost:5001/_framework/System.Linq.Parallel.dll MONO_WASM: Loaded:System.Linq.dll as assembly size 131584 from https://localhost:5001/_framework/System.Linq.dll MONO_WASM: Loaded:System.Net.Sockets.dll as assembly size 75264 from https://localhost:5001/_framework/System.Net.Sockets.dll MONO_WASM: Loaded:System.Net.Quic.dll as assembly size 33280 from https://localhost:5001/_framework/System.Net.Quic.dll MONO_WASM: Loaded:System.Net.Http.dll as assembly size 297472 from https://localhost:5001/_framework/System.Net.Http.dll MONO_WASM: Loaded:System.Net.Security.dll as assembly size 90624 from https://localhost:5001/_framework/System.Net.Security.dll MONO_WASM: Loaded:System.Net.WebSockets.Client.dll as assembly size 40448 from https://localhost:5001/_framework/System.Net.WebSockets.Client.dll MONO_WASM: Loaded:System.Net.Requests.dll as assembly size 59392 from https://localhost:5001/_framework/System.Net.Requests.dll MONO_WASM: Loaded:System.ObjectModel.dll as assembly size 32768 from https://localhost:5001/_framework/System.ObjectModel.dll MONO_WASM: Loaded:System.Numerics.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.dll MONO_WASM: Loaded:System.Net.WebHeaderCollection.dll as assembly size 26112 from https://localhost:5001/_framework/System.Net.WebHeaderCollection.dll MONO_WASM: Loaded:System.Net.WebClient.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.WebClient.dll MONO_WASM: Loaded:System.Net.WebProxy.dll as assembly size 11264 from https://localhost:5001/_framework/System.Net.WebProxy.dll MONO_WASM: Loaded:System.Reflection.DispatchProxy.dll as assembly size 28160 from https://localhost:5001/_framework/System.Reflection.DispatchProxy.dll MONO_WASM: Loaded:System.Net.NetworkInformation.dll as assembly size 32768 from https://localhost:5001/_framework/System.Net.NetworkInformation.dll MONO_WASM: Loaded:System.Reflection.Emit.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.dll MONO_WASM: Loaded:System.Net.WebSockets.dll as assembly size 86528 from https://localhost:5001/_framework/System.Net.WebSockets.dll MONO_WASM: Loaded:System.Net.Mail.dll as assembly size 109568 from https://localhost:5001/_framework/System.Net.Mail.dll MONO_WASM: Loaded:System.Reflection.Emit.ILGeneration.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.ILGeneration.dll MONO_WASM: Loaded:System.Reflection.TypeExtensions.dll as assembly size 15360 from https://localhost:5001/_framework/System.Reflection.TypeExtensions.dll MONO_WASM: Loaded:System.Net.dll as assembly size 7168 from https://localhost:5001/_framework/System.Net.dll MONO_WASM: Loaded:System.Reflection.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Reflection.Extensions.dll MONO_WASM: Loaded:System.Resources.Reader.dll as assembly size 5120 from https://localhost:5001/_framework/System.Resources.Reader.dll MONO_WASM: Loaded:System.Numerics.Vectors.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.Vectors.dll MONO_WASM: Loaded:System.Reflection.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Primitives.dll MONO_WASM: Loaded:System.Reflection.Emit.Lightweight.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.Lightweight.dll MONO_WASM: Loaded:System.Runtime.Extensions.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.Extensions.dll MONO_WASM: Loaded:System.Runtime.Handles.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.Handles.dll MONO_WASM: Loaded:System.Resources.ResourceManager.dll as assembly size 5632 from https://localhost:5001/_framework/System.Resources.ResourceManager.dll MONO_WASM: Loaded:System.Private.Xml.Linq.dll as assembly size 170496 from https://localhost:5001/_framework/System.Private.Xml.Linq.dll MONO_WASM: Loaded:System.Linq.Expressions.dll as assembly size 656896 from https://localhost:5001/_framework/System.Linq.Expressions.dll MONO_WASM: Loaded:System.Runtime.InteropServices.RuntimeInformation.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.InteropServices.RuntimeInformation.dll MONO_WASM: Loaded:System.Runtime.Intrinsics.dll as assembly size 6656 from https://localhost:5001/_framework/System.Runtime.Intrinsics.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.VisualC.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.CompilerServices.VisualC.dll MONO_WASM: Loaded:System.Resources.Writer.dll as assembly size 19456 from https://localhost:5001/_framework/System.Resources.Writer.dll MONO_WASM: Loaded:System.Runtime.Loader.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Loader.dll MONO_WASM: Loaded:System.Reflection.Metadata.dll as assembly size 512000 from https://localhost:5001/_framework/System.Reflection.Metadata.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.Unsafe.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.CompilerServices.Unsafe.dll MONO_WASM: Loaded:System.Runtime.Serialization.Formatters.dll as assembly size 68096 from https://localhost:5001/_framework/System.Runtime.Serialization.Formatters.dll MONO_WASM: Loaded:System.Reflection.dll as assembly size 6144 from https://localhost:5001/_framework/System.Reflection.dll MONO_WASM: Loaded:System.Security.Claims.dll as assembly size 46080 from https://localhost:5001/_framework/System.Security.Claims.dll MONO_WASM: Loaded:System.Runtime.InteropServices.dll as assembly size 31232 from https://localhost:5001/_framework/System.Runtime.InteropServices.dll MONO_WASM: Loaded:System.Security.Cryptography.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Encoding.dll MONO_WASM: Loaded:System.Security.Cryptography.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Primitives.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 80896 from https://localhost:5001/_framework/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:System.Security.Cryptography.OpenSsl.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.OpenSsl.dll MONO_WASM: Loaded:System.Runtime.Serialization.dll as assembly size 7168 from https://localhost:5001/_framework/System.Runtime.Serialization.dll MONO_WASM: Loaded:System.Runtime.Serialization.Xml.dll as assembly size 6144 from https://localhost:5001/_framework/System.Runtime.Serialization.Xml.dll MONO_WASM: Loaded:System.Security.Cryptography.X509Certificates.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.X509Certificates.dll MONO_WASM: Loaded:System.Runtime.Serialization.Primitives.dll as assembly size 12800 from https://localhost:5001/_framework/System.Runtime.Serialization.Primitives.dll MONO_WASM: Loaded:System.Runtime.Numerics.dll as assembly size 141824 from https://localhost:5001/_framework/System.Runtime.Numerics.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 111616 from https://localhost:5001/_framework/System.Private.Uri.dll MONO_WASM: Loaded:System.ServiceProcess.dll as assembly size 6144 from https://localhost:5001/_framework/System.ServiceProcess.dll MONO_WASM: Loaded:System.Security.dll as assembly size 8192 from https://localhost:5001/_framework/System.Security.dll MONO_WASM: Loaded:System.Text.Encoding.Extensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.Extensions.dll MONO_WASM: Loaded:System.Text.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 33792 from https://localhost:5001/_framework/System.Runtime.dll MONO_WASM: Loaded:System.Security.AccessControl.dll as assembly size 53248 from https://localhost:5001/_framework/System.Security.AccessControl.dll MONO_WASM: Loaded:System.Runtime.Serialization.Json.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Serialization.Json.dll MONO_WASM: Loaded:System.Security.SecureString.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.SecureString.dll MONO_WASM: Loaded:System.Security.Cryptography.Cng.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Cng.dll MONO_WASM: Loaded:System.Threading.Channels.dll as assembly size 51200 from https://localhost:5001/_framework/System.Threading.Channels.dll MONO_WASM: Loaded:System.Security.Cryptography.Csp.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Csp.dll MONO_WASM: Loaded:System.Security.Cryptography.Algorithms.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.Algorithms.dll MONO_WASM: Loaded:System.Threading.Tasks.Parallel.dll as assembly size 57344 from https://localhost:5001/_framework/System.Threading.Tasks.Parallel.dll MONO_WASM: Loaded:System.Threading.Tasks.dll as assembly size 6656 from https://localhost:5001/_framework/System.Threading.Tasks.dll MONO_WASM: Loaded:System.Threading.Timer.dll as assembly size 5120 from https://localhost:5001/_framework/System.Threading.Timer.dll MONO_WASM: Loaded:System.Security.Cryptography.dll as assembly size 511488 from https://localhost:5001/_framework/System.Security.Cryptography.dll MONO_WASM: Loaded:System.Threading.Thread.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Thread.dll MONO_WASM: Loaded:System.Security.Principal.Windows.dll as assembly size 29184 from https://localhost:5001/_framework/System.Security.Principal.Windows.dll MONO_WASM: Loaded:System.Windows.dll as assembly size 6144 from https://localhost:5001/_framework/System.Windows.dll MONO_WASM: Loaded:System.Threading.Overlapped.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Overlapped.dll MONO_WASM: Loaded:System.Xml.Linq.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.Linq.dll MONO_WASM: Loaded:System.ServiceModel.Web.dll as assembly size 7168 from https://localhost:5001/_framework/System.ServiceModel.Web.dll MONO_WASM: Loaded:System.Threading.Tasks.Extensions.dll as assembly size 6144 from https://localhost:5001/_framework/System.Threading.Tasks.Extensions.dll MONO_WASM: Loaded:System.Threading.dll as assembly size 44032 from https://localhost:5001/_framework/System.Threading.dll MONO_WASM: Loaded:System.Xml.XPath.XDocument.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.XPath.XDocument.dll MONO_WASM: Loaded:System.Xml.ReaderWriter.dll as assembly size 11776 from https://localhost:5001/_framework/System.Xml.ReaderWriter.dll MONO_WASM: Loaded:WindowsBase.dll as assembly size 6144 from https://localhost:5001/_framework/WindowsBase.dll MONO_WASM: Loaded:System.Transactions.dll as assembly size 6656 from https://localhost:5001/_framework/System.Transactions.dll MONO_WASM: Loaded:System.Text.Json.dll as assembly size 643584 from https://localhost:5001/_framework/System.Text.Json.dll MONO_WASM: Loaded:System.Threading.Tasks.Dataflow.dll as assembly size 237568 from https://localhost:5001/_framework/System.Threading.Tasks.Dataflow.dll MONO_WASM: Loaded:System.Security.Principal.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Principal.dll MONO_WASM: Loaded:mscorlib.dll as assembly size 47104 from https://localhost:5001/_framework/mscorlib.dll MONO_WASM: Loaded:System.ValueTuple.dll as assembly size 5632 from https://localhost:5001/_framework/System.ValueTuple.dll MONO_WASM: Loaded:System.Text.Encodings.Web.dll as assembly size 67584 from https://localhost:5001/_framework/System.Text.Encodings.Web.dll MONO_WASM: Loaded:System.Web.HttpUtility.dll as assembly size 19456 from https://localhost:5001/_framework/System.Web.HttpUtility.dll MONO_WASM: Loaded:System.Xml.XPath.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XPath.dll MONO_WASM: Loaded:System.Threading.ThreadPool.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.ThreadPool.dll MONO_WASM: Loaded:System.Xml.XmlSerializer.dll as assembly size 7680 from https://localhost:5001/_framework/System.Xml.XmlSerializer.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.dll as assembly size 6656 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.dll MONO_WASM: Loaded:System.Xml.XDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XDocument.dll MONO_WASM: Loaded:System.dll as assembly size 39936 from https://localhost:5001/_framework/System.dll MONO_WASM: Loaded:System.Xml.dll as assembly size 13824 from https://localhost:5001/_framework/System.Xml.dll MONO_WASM: Loaded:System.Xml.Serialization.dll as assembly size 6656 from https://localhost:5001/_framework/System.Xml.Serialization.dll MONO_WASM: Loaded:netstandard.dll as assembly size 90112 from https://localhost:5001/_framework/netstandard.dll MONO_WASM: Loaded:System.Text.RegularExpressions.dll as assembly size 433152 from https://localhost:5001/_framework/System.Text.RegularExpressions.dll MONO_WASM: Loaded:System.Xml.XmlDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XmlDocument.dll MONO_WASM: Loaded:System.Web.dll as assembly size 5120 from https://localhost:5001/_framework/System.Web.dll MONO_WASM: Loaded:System.Transactions.Local.dll as assembly size 171520 from https://localhost:5001/_framework/System.Transactions.Local.dll MONO_WASM: Loaded:System.Text.Encoding.CodePages.dll as assembly size 775680 from https://localhost:5001/_framework/System.Text.Encoding.CodePages.dll MONO_WASM: Loaded:System.Private.DataContractSerialization.dll as assembly size 956928 from https://localhost:5001/_framework/System.Private.DataContractSerialization.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.dll as assembly size 130560 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.dll as assembly size 84992 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.dll as assembly size 240640 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.dll as assembly size 25088 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.dll MONO_WASM: Loaded:System.Data.Common.dll as assembly size 1294336 from https://localhost:5001/_framework/System.Data.Common.dll MONO_WASM: Loaded:Microsoft.JSInterop.dll as assembly size 58880 from https://localhost:5001/_framework/Microsoft.JSInterop.dll MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.dll as assembly size 12800 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.dll MONO_WASM: Loaded:Microsoft.JSInterop.pdb as pdb size 34308 from https://localhost:5001/_framework/Microsoft.JSInterop.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.pdb as pdb size 44080 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.dll as assembly size 20992 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.pdb as pdb size 15416 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.pdb as pdb size 123316 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.pdb as pdb size 59568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.pdb MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.pdb as pdb size 18148 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.pdb as pdb size 27948 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.pdb as pdb size 21568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.pdb MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from https://localhost:5001/_framework/dotnet.timezones.blat MONO_WASM: Creating file 'dotnet.timezones.blat' in directory '/' MONO_WASM: Loaded:icudt_EFIGS.dat as icu size 550320 from https://localhost:5001/_framework/icudt_EFIGS.dat MONO_WASM: Loaded:System.Private.Xml.dll as assembly size 3859968 from https://localhost:5001/_framework/System.Private.Xml.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 4327936 from https://localhost:5001/_framework/System.Private.CoreLib.dll MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file dotnet.js.symbols. Ignoring. MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime MONO_WASM: postRunAsync 

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

# Conflicts:
#	src/mono/wasm/runtime/diagnostics.ts
#	src/mono/wasm/runtime/dotnet.d.ts
#	src/mono/wasm/runtime/pthreads/worker/index.ts
#	src/mono/wasm/runtime/startup.ts
#	src/mono/wasm/runtime/types.ts
@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Threaded sample isn't happy after the merge. I'm investigating

repro steps:

./build.sh --os browser -c Debug /p:WasmEnablePerfTracing=true
cd src/mono/sample/wasm/browser-eventpipe
make CONFIG=Debug clean publish run V=1 MSBUILD_ARGS=/p:MonoDiagnosticsMock=true

Screen Shot 2022-07-25 at 14 17 04

@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Update: the fix helps, but there is still a problem.

Screenshot from 2022-07-25 19-15-25

I think what's happening is that dotnet.worker.js initializes a Module global and passes it to createDotnetRuntime but this Module = instance assignment (https://github.com/emscripten-core/emscripten/blob/940ae7fe759a81c64e0bde0a41eb33655ad496e1/src/worker.js#L156) is never executed

Which might be because createDotnetRuntimedoesn't return a Promise for some reason. That''s the avenue I'm going to explore tonight. returns a promise that is never settled for some reason.

@lambdageek

Copy link
Copy Markdown
Member

Here's what our dotnet.js and dotnet.worker.js look like from this PR, with threading enabled https://gist.github.com/lambdageek/e54206e2e5365e3f3440a4942a303721#file-dotnet-worker-js

@lambdageek

lambdageek commented Jul 26, 2022

Copy link
Copy Markdown
Member

Ok, so the issue is in this run function in Emscripten. Note that if it's in a pthread, then it doesn't call doRun (or preRun or any of the rest), it calls a different function that's specific to pthreads. In that function it calls readyResolvePromise(Module) but it never calls postRun.

functionrun(args){args=args||arguments_;if(runDependencies>0){return;}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({"cmd": "loaded"});return;}preRun();if(runDependencies>0){return;}functiondoRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}}

So when we do

module.ready=module.ready.then(async()=>{// wait for previous stageawaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

Because nothing resolved afterPostRun, module.ready never resolves, and dotnet.worker.js just returns from self.onmessage ("load") without assigning Module = instance and the worker is left in a bad state.

Update it's less misleading to just return from configure_emscripten_startup without doing anything if we're in a pthread worker. The solution, I think is to change module.ready like this:

module.ready=module.ready.then(async()=>{// wait for previous stage// on pthread workers, postRun is never called, so there is nothing to wait forif(!ENVIRONMENT_IS_PTHREAD)awaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

@pavelsavara

With the above change, the diagnostics sample works for me.

Maybe we should just return from configure_emscripten_startup without changing preRun, onRuntimeInitialized, postRun and ready if we're in a worker since it's just misleading and i'm not sure if running any of the other config-based callbacks makes a ton of sense

@lambdageek

Copy link
Copy Markdown
Member

@pavelsavarapavelsavara#3

As follow-up to this PR we should figure out what kind of JS initialization we want to do in pthread workers. the normal callbacks don't fire. i'm not sure if that's ok or if it's leaving some part of our JS state incorrect.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek there is alredy condition in initializeImportsAndExports and I used it to exit startup sequence for workers.
That makes it work up to

WASM ERROR Error: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Threading.Thread.ThrowIfNoThreadStart(Boolean )
at System.Threading.Thread.Start(Boolean , Boolean )
at System.Threading.Thread.Start()
at Sample.Test.TestMeaning() in C:\Dev\runtime\src\mono\sample\wasm\browser-mt-eventpipe\Program.cs:line 27

Which is I guess some different issue. If the build is green, I will merge as is and we will continue in follow-up PRs.

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Screenshot from 2022-07-25 19-15-25

I noticed on the screenshot that the init_crypto is running multiple times. I think the latest in this PR should not do that anymore.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek when I rebuild with /p:WasmEnableThreads=true and not only /p:WasmEnablePerfTracing=true I could start threads :-D

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is release version
image

@lambdageek

Copy link
Copy Markdown
Member

This is release version
image

That's an asssert that we resumed a thread more times than we suspended it. Probably not due to this PR.

Comment on lines -356 to +316
configure_emscripten_startup(module, exportedAPI);

if (ENVIRONMENT_IS_WORKER) {
// HACK: Emscripten's dotnet.worker.js expects the exports of dotnet.js module to be Module object
// until we have our own fix for dotnet.worker.js file
// we also skip all emscripten startup event and configuration of worker's JS state
// note that emscripten events are not firing either
return <any>exportedAPI.Module;
}

configure_emscripten_startup(module, exportedAPI);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavelsavara

pavelsavara commented Jul 26, 2022

Copy link
Copy Markdown
MemberAuthor

There is well known Not found: args[0] = xLog

There is also timeout on V8+windows

 [wasm test] [09:40:06] info: console.debug: [MONO] AOT: FOUND method System.Runtime.Loader.AssemblyLoadContext:OnProcessExit () [0x181a - 0x181b 0x55dd8]
[wasm test] [09:55:06] info: Process 2844 didn't exit within 00:15:00 and will be killed

LogAnother log

edit: maybe this PR surfaced the #72880

@pavelsavara
pavelsavara merged commit 73374e8 into dotnet:mainJul 26, 2022
radical pushed a commit that referenced this pull request Jul 28, 2022
…tory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
@pavelsavara
pavelsavara deleted the wasm_improve_startup branch July 29, 2022 09:16
@ghostghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@lambdageek@kg@maraf@ilonatommy
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' [wasm] improve startup by pavelsavara · Pull Request #72275 · dotnet/runtime · GitHub
Skip to content

[wasm] improve startup - #72275

Merged
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup
Jul 26, 2022
Merged

[wasm] improve startup#72275
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Jul 15, 2022

Copy link
Copy Markdown
Member

streaming wasm instantiation, more parallel download of DLLs

and other goodnes seen in Blazor

  • new hook downloadResource?: (request: ResourceRequest) => LoadingResource allows Blazor to delegate the details to runtime while keeping the caching responsibility.
  • existing config.assets could now have resolvedUrl and pending response. That's blazor could tell us what to load and also provide pending cache promise.
  • made emsripten events async, our callbacks are called in correct order and block on previous one before the next is started.
  • improved log messages
  • load assets into memory as they arrive from network, avoiding memory allocation spike
  • run mono_wasm_pre_init_esential also in Blazor loader. This will fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. This will enable new [JSImport] for blazor.
  • locateFile is now used for all assets including mono-config.json. I also fixed scriptDirectory detection on all but v8+CJS. Therefore apps could be executed from different folder than is dotnet.js location. Credits to @yamachu
  • run init_crypto also on blazor startup sequence

Contributes to #70892
Contributes to #72810

@pavelsavarapavelsavara added this to the 7.0.0 milestone Jul 15, 2022
@pavelsavara
pavelsavara requested review from kg and marafJuly 15, 2022 16:09
@pavelsavarapavelsavara self-assigned this Jul 15, 2022
@pavelsavara
pavelsavara requested a review from lewing as a code ownerJuly 15, 2022 16:09
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • load assemblies into memory synchronously during onRuntimeInitialized because async user postRun run in parallel to each other and therefore can't use loaded assemblies yet. We will do the same in Blazor.
  • run mono_wasm_pre_init_esential also in Blazor loader. This will also fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. We will eliminate it from Blazor code.
Author:pavelsavara
Assignees:pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone:7.0.0

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

I tested with current and also future! Blazor

@lewing
lewing requested a review from lambdageekJuly 15, 2022 16:54
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara

This comment was marked as outdated.

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 8a1057f to d319c22CompareJuly 15, 2022 18:15
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jul 16, 2022

Copy link
Copy Markdown
MemberAuthor

This is the startup sequence for non-blazor

user code in createDotnetRuntime callback MONO_WASM: determined url of dotnet main script to be http://localhost:8000/
MONO_WASM: instantiateWasm MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.wasm' for dotnet.wasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit user code Module.preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_wasm_load_config MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: mono_download_assets MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Console.dll' for System.Console.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.CoreLib.dll' for System.Private.CoreLib.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.Uri.dll' for System.Private.Uri.dll MONO_WASM: instantiateWasm done MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.dll' for System.Runtime.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll' for System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll' for Wasm.Browser.ES6.Sample.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/supportFiles/0_runtimeconfig.bin' for supportFiles/0_runtimeconfig.bin MONO_WASM: Attempting to fetch 'http://localhost:8000/icudt.dat' for icudt.dat MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.timezones.blat' for dotnet.timezones.blat user code Module.preRun MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:System.Console.dll as assembly size 25088 from http://localhost:8000/managed/System.Console.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 1684992 from http://localhost:8000/managed/System.Private.CoreLib.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 80384 from http://localhost:8000/managed/System.Private.Uri.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 6144 from http://localhost:8000/managed/System.Runtime.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 31232 from http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:Wasm.Browser.ES6.Sample.dll as assembly size 17408 from http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll MONO_WASM: Loaded:supportFiles/0_runtimeconfig.bin as vfs size 950 from http://localhost:8000/supportFiles/0_runtimeconfig.bin MONO_WASM: Creating file 'runtimeconfig.bin' in directory '/' MONO_WASM: Loaded:icudt.dat as icu size 1503760 from http://localhost:8000/icudt.dat MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from http://localhost:8000/dotnet.timezones.blat MONO_WASM: Creating directory '/usr/share/zoneinfo' MONO_WASM: Creating file '' in directory '/usr/share/zoneinfo' MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file user code Module.onRuntimeInitialized MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime user code Module.postRun user code after createDotnetRuntime() MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:TestMeaning MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:IsPrime MONO_WASM: Binding [JSImport] Sample.Test.sub from null MONO_WASM: Binding [JSImport] Sample.Test.add from null meaning: 42 ret: 42 Hello, World! WASM EXIT 0 

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 657f65b to d2884fbCompareJuly 17, 2022 08:58
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from d2884fb to 2050175CompareJuly 17, 2022 20:52
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is startup sequence with updated blazor

MONO_WASM: instantiateWasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_download_assets MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: instantiateWasm done MONO_WASM: preRunAsync MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:Microsoft.Extensions.Configuration.dll as assembly size 29696 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Abstractions.dll as assembly size 17920 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Binder.dll as assembly size 29184 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Binder.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Json.dll as assembly size 16384 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Json.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.FileExtensions.dll as assembly size 16896 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.FileExtensions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.Abstractions.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.dll as assembly size 72192 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.dll as assembly size 36352 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Physical.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Physical.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Abstractions.dll as assembly size 12288 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.Abstractions.dll as assembly size 53248 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Primitives.dll as assembly size 31232 from https://localhost:5001/_framework/Microsoft.Extensions.Primitives.dll MONO_WASM: Loaded:Microsoft.Extensions.Options.dll as assembly size 50176 from https://localhost:5001/_framework/Microsoft.Extensions.Options.dll MONO_WASM: Loaded:Microsoft.Extensions.FileSystemGlobbing.dll as assembly size 35840 from https://localhost:5001/_framework/Microsoft.Extensions.FileSystemGlobbing.dll MONO_WASM: Loaded:Microsoft.VisualBasic.dll as assembly size 7680 from https://localhost:5001/_framework/Microsoft.VisualBasic.dll MONO_WASM: Loaded:System.IO.Pipelines.dll as assembly size 70144 from https://localhost:5001/_framework/System.IO.Pipelines.dll MONO_WASM: Loaded:Microsoft.Win32.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/Microsoft.Win32.Primitives.dll MONO_WASM: Loaded:System.AppContext.dll as assembly size 5120 from https://localhost:5001/_framework/System.AppContext.dll MONO_WASM: Loaded:System.Buffers.dll as assembly size 5120 from https://localhost:5001/_framework/System.Buffers.dll MONO_WASM: Loaded:Microsoft.Win32.Registry.dll as assembly size 30208 from https://localhost:5001/_framework/Microsoft.Win32.Registry.dll MONO_WASM: Loaded:System.Collections.Concurrent.dll as assembly size 92672 from https://localhost:5001/_framework/System.Collections.Concurrent.dll MONO_WASM: Loaded:System.Collections.Specialized.dll as assembly size 44032 from https://localhost:5001/_framework/System.Collections.Specialized.dll MONO_WASM: Loaded:System.Collections.dll as assembly size 111104 from https://localhost:5001/_framework/System.Collections.dll MONO_WASM: Loaded:System.ComponentModel.Annotations.dll as assembly size 88576 from https://localhost:5001/_framework/System.ComponentModel.Annotations.dll MONO_WASM: Loaded:System.ComponentModel.DataAnnotations.dll as assembly size 7168 from https://localhost:5001/_framework/System.ComponentModel.DataAnnotations.dll MONO_WASM: Loaded:System.ComponentModel.EventBasedAsync.dll as assembly size 18432 from https://localhost:5001/_framework/System.ComponentModel.EventBasedAsync.dll MONO_WASM: Loaded:System.ComponentModel.dll as assembly size 6656 from https://localhost:5001/_framework/System.ComponentModel.dll MONO_WASM: Loaded:System.ComponentModel.Primitives.dll as assembly size 32256 from https://localhost:5001/_framework/System.ComponentModel.Primitives.dll MONO_WASM: Loaded:System.Configuration.dll as assembly size 9728 from https://localhost:5001/_framework/System.Configuration.dll MONO_WASM: Loaded:System.Collections.NonGeneric.dll as assembly size 43520 from https://localhost:5001/_framework/System.Collections.NonGeneric.dll MONO_WASM: Loaded:System.Console.dll as assembly size 49664 from https://localhost:5001/_framework/System.Console.dll MONO_WASM: Loaded:System.Core.dll as assembly size 13312 from https://localhost:5001/_framework/System.Core.dll MONO_WASM: Loaded:System.ComponentModel.TypeConverter.dll as assembly size 333312 from https://localhost:5001/_framework/System.ComponentModel.TypeConverter.dll MONO_WASM: Loaded:System.Collections.Immutable.dll as assembly size 212480 from https://localhost:5001/_framework/System.Collections.Immutable.dll MONO_WASM: Loaded:System.Data.dll as assembly size 13824 from https://localhost:5001/_framework/System.Data.dll MONO_WASM: Loaded:System.Data.DataSetExtensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Data.DataSetExtensions.dll MONO_WASM: Loaded:System.Diagnostics.FileVersionInfo.dll as assembly size 11776 from https://localhost:5001/_framework/System.Diagnostics.FileVersionInfo.dll MONO_WASM: Loaded:System.Diagnostics.Debug.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Debug.dll MONO_WASM: Loaded:Microsoft.CSharp.dll as assembly size 365568 from https://localhost:5001/_framework/Microsoft.CSharp.dll MONO_WASM: Loaded:System.Diagnostics.Process.dll as assembly size 55808 from https://localhost:5001/_framework/System.Diagnostics.Process.dll MONO_WASM: Loaded:System.Diagnostics.DiagnosticSource.dll as assembly size 151040 from https://localhost:5001/_framework/System.Diagnostics.DiagnosticSource.dll MONO_WASM: Loaded:Microsoft.VisualBasic.Core.dll as assembly size 516096 from https://localhost:5001/_framework/Microsoft.VisualBasic.Core.dll MONO_WASM: Loaded:System.Diagnostics.Contracts.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Contracts.dll MONO_WASM: Loaded:System.Diagnostics.StackTrace.dll as assembly size 16896 from https://localhost:5001/_framework/System.Diagnostics.StackTrace.dll MONO_WASM: Loaded:System.Diagnostics.Tools.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Tools.dll MONO_WASM: Loaded:System.Diagnostics.TraceSource.dll as assembly size 50176 from https://localhost:5001/_framework/System.Diagnostics.TraceSource.dll MONO_WASM: Loaded:System.Diagnostics.TextWriterTraceListener.dll as assembly size 23040 from https://localhost:5001/_framework/System.Diagnostics.TextWriterTraceListener.dll MONO_WASM: Loaded:System.Formats.Tar.dll as assembly size 32768 from https://localhost:5001/_framework/System.Formats.Tar.dll MONO_WASM: Loaded:System.Diagnostics.Tracing.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Tracing.dll MONO_WASM: Loaded:System.Globalization.Calendars.dll as assembly size 6144 from https://localhost:5001/_framework/System.Globalization.Calendars.dll MONO_WASM: Loaded:System.IO.Compression.Brotli.dll as assembly size 19456 from https://localhost:5001/_framework/System.IO.Compression.Brotli.dll MONO_WASM: Loaded:System.Globalization.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Globalization.Extensions.dll MONO_WASM: Loaded:System.Globalization.dll as assembly size 5632 from https://localhost:5001/_framework/System.Globalization.dll MONO_WASM: Loaded:System.IO.Compression.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.Compression.FileSystem.dll MONO_WASM: Loaded:System.Dynamic.Runtime.dll as assembly size 6144 from https://localhost:5001/_framework/System.Dynamic.Runtime.dll MONO_WASM: Loaded:System.IO.Compression.ZipFile.dll as assembly size 26624 from https://localhost:5001/_framework/System.IO.Compression.ZipFile.dll MONO_WASM: Loaded:System.IO.FileSystem.AccessControl.dll as assembly size 24064 from https://localhost:5001/_framework/System.IO.FileSystem.AccessControl.dll MONO_WASM: Loaded:System.IO.FileSystem.DriveInfo.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.FileSystem.DriveInfo.dll MONO_WASM: Loaded:System.Drawing.dll as assembly size 10752 from https://localhost:5001/_framework/System.Drawing.dll MONO_WASM: Loaded:System.IO.IsolatedStorage.dll as assembly size 27136 from https://localhost:5001/_framework/System.IO.IsolatedStorage.dll MONO_WASM: Loaded:System.Formats.Asn1.dll as assembly size 87040 from https://localhost:5001/_framework/System.Formats.Asn1.dll MONO_WASM: Loaded:System.IO.Compression.dll as assembly size 119808 from https://localhost:5001/_framework/System.IO.Compression.dll MONO_WASM: Loaded:System.IO.FileSystem.Watcher.dll as assembly size 25600 from https://localhost:5001/_framework/System.IO.FileSystem.Watcher.dll MONO_WASM: Loaded:System.IO.FileSystem.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.FileSystem.Primitives.dll MONO_WASM: Loaded:System.IO.MemoryMappedFiles.dll as assembly size 45056 from https://localhost:5001/_framework/System.IO.MemoryMappedFiles.dll MONO_WASM: Loaded:System.IO.UnmanagedMemoryStream.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.UnmanagedMemoryStream.dll MONO_WASM: Loaded:System.IO.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.FileSystem.dll MONO_WASM: Loaded:System.IO.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.dll MONO_WASM: Loaded:System.Drawing.Primitives.dll as assembly size 54784 from https://localhost:5001/_framework/System.Drawing.Primitives.dll MONO_WASM: Loaded:System.Linq.Queryable.dll as assembly size 86528 from https://localhost:5001/_framework/System.Linq.Queryable.dll MONO_WASM: Loaded:System.IO.Pipes.AccessControl.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.Pipes.AccessControl.dll MONO_WASM: Loaded:System.Net.Http.Json.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.Http.Json.dll MONO_WASM: Loaded:System.Memory.dll as assembly size 50688 from https://localhost:5001/_framework/System.Memory.dll MONO_WASM: Loaded:System.IO.Pipes.dll as assembly size 38400 from https://localhost:5001/_framework/System.IO.Pipes.dll MONO_WASM: Loaded:System.Net.NameResolution.dll as assembly size 14848 from https://localhost:5001/_framework/System.Net.NameResolution.dll MONO_WASM: Loaded:System.Net.HttpListener.dll as assembly size 60928 from https://localhost:5001/_framework/System.Net.HttpListener.dll MONO_WASM: Loaded:System.Net.ServicePoint.dll as assembly size 17408 from https://localhost:5001/_framework/System.Net.ServicePoint.dll MONO_WASM: Loaded:System.Net.Primitives.dll as assembly size 99840 from https://localhost:5001/_framework/System.Net.Primitives.dll MONO_WASM: Loaded:System.Net.Ping.dll as assembly size 18432 from https://localhost:5001/_framework/System.Net.Ping.dll MONO_WASM: Loaded:System.Linq.Parallel.dll as assembly size 259584 from https://localhost:5001/_framework/System.Linq.Parallel.dll MONO_WASM: Loaded:System.Linq.dll as assembly size 131584 from https://localhost:5001/_framework/System.Linq.dll MONO_WASM: Loaded:System.Net.Sockets.dll as assembly size 75264 from https://localhost:5001/_framework/System.Net.Sockets.dll MONO_WASM: Loaded:System.Net.Quic.dll as assembly size 33280 from https://localhost:5001/_framework/System.Net.Quic.dll MONO_WASM: Loaded:System.Net.Http.dll as assembly size 297472 from https://localhost:5001/_framework/System.Net.Http.dll MONO_WASM: Loaded:System.Net.Security.dll as assembly size 90624 from https://localhost:5001/_framework/System.Net.Security.dll MONO_WASM: Loaded:System.Net.WebSockets.Client.dll as assembly size 40448 from https://localhost:5001/_framework/System.Net.WebSockets.Client.dll MONO_WASM: Loaded:System.Net.Requests.dll as assembly size 59392 from https://localhost:5001/_framework/System.Net.Requests.dll MONO_WASM: Loaded:System.ObjectModel.dll as assembly size 32768 from https://localhost:5001/_framework/System.ObjectModel.dll MONO_WASM: Loaded:System.Numerics.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.dll MONO_WASM: Loaded:System.Net.WebHeaderCollection.dll as assembly size 26112 from https://localhost:5001/_framework/System.Net.WebHeaderCollection.dll MONO_WASM: Loaded:System.Net.WebClient.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.WebClient.dll MONO_WASM: Loaded:System.Net.WebProxy.dll as assembly size 11264 from https://localhost:5001/_framework/System.Net.WebProxy.dll MONO_WASM: Loaded:System.Reflection.DispatchProxy.dll as assembly size 28160 from https://localhost:5001/_framework/System.Reflection.DispatchProxy.dll MONO_WASM: Loaded:System.Net.NetworkInformation.dll as assembly size 32768 from https://localhost:5001/_framework/System.Net.NetworkInformation.dll MONO_WASM: Loaded:System.Reflection.Emit.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.dll MONO_WASM: Loaded:System.Net.WebSockets.dll as assembly size 86528 from https://localhost:5001/_framework/System.Net.WebSockets.dll MONO_WASM: Loaded:System.Net.Mail.dll as assembly size 109568 from https://localhost:5001/_framework/System.Net.Mail.dll MONO_WASM: Loaded:System.Reflection.Emit.ILGeneration.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.ILGeneration.dll MONO_WASM: Loaded:System.Reflection.TypeExtensions.dll as assembly size 15360 from https://localhost:5001/_framework/System.Reflection.TypeExtensions.dll MONO_WASM: Loaded:System.Net.dll as assembly size 7168 from https://localhost:5001/_framework/System.Net.dll MONO_WASM: Loaded:System.Reflection.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Reflection.Extensions.dll MONO_WASM: Loaded:System.Resources.Reader.dll as assembly size 5120 from https://localhost:5001/_framework/System.Resources.Reader.dll MONO_WASM: Loaded:System.Numerics.Vectors.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.Vectors.dll MONO_WASM: Loaded:System.Reflection.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Primitives.dll MONO_WASM: Loaded:System.Reflection.Emit.Lightweight.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.Lightweight.dll MONO_WASM: Loaded:System.Runtime.Extensions.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.Extensions.dll MONO_WASM: Loaded:System.Runtime.Handles.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.Handles.dll MONO_WASM: Loaded:System.Resources.ResourceManager.dll as assembly size 5632 from https://localhost:5001/_framework/System.Resources.ResourceManager.dll MONO_WASM: Loaded:System.Private.Xml.Linq.dll as assembly size 170496 from https://localhost:5001/_framework/System.Private.Xml.Linq.dll MONO_WASM: Loaded:System.Linq.Expressions.dll as assembly size 656896 from https://localhost:5001/_framework/System.Linq.Expressions.dll MONO_WASM: Loaded:System.Runtime.InteropServices.RuntimeInformation.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.InteropServices.RuntimeInformation.dll MONO_WASM: Loaded:System.Runtime.Intrinsics.dll as assembly size 6656 from https://localhost:5001/_framework/System.Runtime.Intrinsics.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.VisualC.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.CompilerServices.VisualC.dll MONO_WASM: Loaded:System.Resources.Writer.dll as assembly size 19456 from https://localhost:5001/_framework/System.Resources.Writer.dll MONO_WASM: Loaded:System.Runtime.Loader.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Loader.dll MONO_WASM: Loaded:System.Reflection.Metadata.dll as assembly size 512000 from https://localhost:5001/_framework/System.Reflection.Metadata.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.Unsafe.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.CompilerServices.Unsafe.dll MONO_WASM: Loaded:System.Runtime.Serialization.Formatters.dll as assembly size 68096 from https://localhost:5001/_framework/System.Runtime.Serialization.Formatters.dll MONO_WASM: Loaded:System.Reflection.dll as assembly size 6144 from https://localhost:5001/_framework/System.Reflection.dll MONO_WASM: Loaded:System.Security.Claims.dll as assembly size 46080 from https://localhost:5001/_framework/System.Security.Claims.dll MONO_WASM: Loaded:System.Runtime.InteropServices.dll as assembly size 31232 from https://localhost:5001/_framework/System.Runtime.InteropServices.dll MONO_WASM: Loaded:System.Security.Cryptography.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Encoding.dll MONO_WASM: Loaded:System.Security.Cryptography.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Primitives.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 80896 from https://localhost:5001/_framework/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:System.Security.Cryptography.OpenSsl.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.OpenSsl.dll MONO_WASM: Loaded:System.Runtime.Serialization.dll as assembly size 7168 from https://localhost:5001/_framework/System.Runtime.Serialization.dll MONO_WASM: Loaded:System.Runtime.Serialization.Xml.dll as assembly size 6144 from https://localhost:5001/_framework/System.Runtime.Serialization.Xml.dll MONO_WASM: Loaded:System.Security.Cryptography.X509Certificates.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.X509Certificates.dll MONO_WASM: Loaded:System.Runtime.Serialization.Primitives.dll as assembly size 12800 from https://localhost:5001/_framework/System.Runtime.Serialization.Primitives.dll MONO_WASM: Loaded:System.Runtime.Numerics.dll as assembly size 141824 from https://localhost:5001/_framework/System.Runtime.Numerics.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 111616 from https://localhost:5001/_framework/System.Private.Uri.dll MONO_WASM: Loaded:System.ServiceProcess.dll as assembly size 6144 from https://localhost:5001/_framework/System.ServiceProcess.dll MONO_WASM: Loaded:System.Security.dll as assembly size 8192 from https://localhost:5001/_framework/System.Security.dll MONO_WASM: Loaded:System.Text.Encoding.Extensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.Extensions.dll MONO_WASM: Loaded:System.Text.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 33792 from https://localhost:5001/_framework/System.Runtime.dll MONO_WASM: Loaded:System.Security.AccessControl.dll as assembly size 53248 from https://localhost:5001/_framework/System.Security.AccessControl.dll MONO_WASM: Loaded:System.Runtime.Serialization.Json.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Serialization.Json.dll MONO_WASM: Loaded:System.Security.SecureString.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.SecureString.dll MONO_WASM: Loaded:System.Security.Cryptography.Cng.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Cng.dll MONO_WASM: Loaded:System.Threading.Channels.dll as assembly size 51200 from https://localhost:5001/_framework/System.Threading.Channels.dll MONO_WASM: Loaded:System.Security.Cryptography.Csp.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Csp.dll MONO_WASM: Loaded:System.Security.Cryptography.Algorithms.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.Algorithms.dll MONO_WASM: Loaded:System.Threading.Tasks.Parallel.dll as assembly size 57344 from https://localhost:5001/_framework/System.Threading.Tasks.Parallel.dll MONO_WASM: Loaded:System.Threading.Tasks.dll as assembly size 6656 from https://localhost:5001/_framework/System.Threading.Tasks.dll MONO_WASM: Loaded:System.Threading.Timer.dll as assembly size 5120 from https://localhost:5001/_framework/System.Threading.Timer.dll MONO_WASM: Loaded:System.Security.Cryptography.dll as assembly size 511488 from https://localhost:5001/_framework/System.Security.Cryptography.dll MONO_WASM: Loaded:System.Threading.Thread.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Thread.dll MONO_WASM: Loaded:System.Security.Principal.Windows.dll as assembly size 29184 from https://localhost:5001/_framework/System.Security.Principal.Windows.dll MONO_WASM: Loaded:System.Windows.dll as assembly size 6144 from https://localhost:5001/_framework/System.Windows.dll MONO_WASM: Loaded:System.Threading.Overlapped.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Overlapped.dll MONO_WASM: Loaded:System.Xml.Linq.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.Linq.dll MONO_WASM: Loaded:System.ServiceModel.Web.dll as assembly size 7168 from https://localhost:5001/_framework/System.ServiceModel.Web.dll MONO_WASM: Loaded:System.Threading.Tasks.Extensions.dll as assembly size 6144 from https://localhost:5001/_framework/System.Threading.Tasks.Extensions.dll MONO_WASM: Loaded:System.Threading.dll as assembly size 44032 from https://localhost:5001/_framework/System.Threading.dll MONO_WASM: Loaded:System.Xml.XPath.XDocument.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.XPath.XDocument.dll MONO_WASM: Loaded:System.Xml.ReaderWriter.dll as assembly size 11776 from https://localhost:5001/_framework/System.Xml.ReaderWriter.dll MONO_WASM: Loaded:WindowsBase.dll as assembly size 6144 from https://localhost:5001/_framework/WindowsBase.dll MONO_WASM: Loaded:System.Transactions.dll as assembly size 6656 from https://localhost:5001/_framework/System.Transactions.dll MONO_WASM: Loaded:System.Text.Json.dll as assembly size 643584 from https://localhost:5001/_framework/System.Text.Json.dll MONO_WASM: Loaded:System.Threading.Tasks.Dataflow.dll as assembly size 237568 from https://localhost:5001/_framework/System.Threading.Tasks.Dataflow.dll MONO_WASM: Loaded:System.Security.Principal.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Principal.dll MONO_WASM: Loaded:mscorlib.dll as assembly size 47104 from https://localhost:5001/_framework/mscorlib.dll MONO_WASM: Loaded:System.ValueTuple.dll as assembly size 5632 from https://localhost:5001/_framework/System.ValueTuple.dll MONO_WASM: Loaded:System.Text.Encodings.Web.dll as assembly size 67584 from https://localhost:5001/_framework/System.Text.Encodings.Web.dll MONO_WASM: Loaded:System.Web.HttpUtility.dll as assembly size 19456 from https://localhost:5001/_framework/System.Web.HttpUtility.dll MONO_WASM: Loaded:System.Xml.XPath.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XPath.dll MONO_WASM: Loaded:System.Threading.ThreadPool.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.ThreadPool.dll MONO_WASM: Loaded:System.Xml.XmlSerializer.dll as assembly size 7680 from https://localhost:5001/_framework/System.Xml.XmlSerializer.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.dll as assembly size 6656 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.dll MONO_WASM: Loaded:System.Xml.XDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XDocument.dll MONO_WASM: Loaded:System.dll as assembly size 39936 from https://localhost:5001/_framework/System.dll MONO_WASM: Loaded:System.Xml.dll as assembly size 13824 from https://localhost:5001/_framework/System.Xml.dll MONO_WASM: Loaded:System.Xml.Serialization.dll as assembly size 6656 from https://localhost:5001/_framework/System.Xml.Serialization.dll MONO_WASM: Loaded:netstandard.dll as assembly size 90112 from https://localhost:5001/_framework/netstandard.dll MONO_WASM: Loaded:System.Text.RegularExpressions.dll as assembly size 433152 from https://localhost:5001/_framework/System.Text.RegularExpressions.dll MONO_WASM: Loaded:System.Xml.XmlDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XmlDocument.dll MONO_WASM: Loaded:System.Web.dll as assembly size 5120 from https://localhost:5001/_framework/System.Web.dll MONO_WASM: Loaded:System.Transactions.Local.dll as assembly size 171520 from https://localhost:5001/_framework/System.Transactions.Local.dll MONO_WASM: Loaded:System.Text.Encoding.CodePages.dll as assembly size 775680 from https://localhost:5001/_framework/System.Text.Encoding.CodePages.dll MONO_WASM: Loaded:System.Private.DataContractSerialization.dll as assembly size 956928 from https://localhost:5001/_framework/System.Private.DataContractSerialization.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.dll as assembly size 130560 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.dll as assembly size 84992 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.dll as assembly size 240640 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.dll as assembly size 25088 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.dll MONO_WASM: Loaded:System.Data.Common.dll as assembly size 1294336 from https://localhost:5001/_framework/System.Data.Common.dll MONO_WASM: Loaded:Microsoft.JSInterop.dll as assembly size 58880 from https://localhost:5001/_framework/Microsoft.JSInterop.dll MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.dll as assembly size 12800 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.dll MONO_WASM: Loaded:Microsoft.JSInterop.pdb as pdb size 34308 from https://localhost:5001/_framework/Microsoft.JSInterop.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.pdb as pdb size 44080 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.dll as assembly size 20992 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.pdb as pdb size 15416 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.pdb as pdb size 123316 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.pdb as pdb size 59568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.pdb MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.pdb as pdb size 18148 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.pdb as pdb size 27948 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.pdb as pdb size 21568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.pdb MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from https://localhost:5001/_framework/dotnet.timezones.blat MONO_WASM: Creating file 'dotnet.timezones.blat' in directory '/' MONO_WASM: Loaded:icudt_EFIGS.dat as icu size 550320 from https://localhost:5001/_framework/icudt_EFIGS.dat MONO_WASM: Loaded:System.Private.Xml.dll as assembly size 3859968 from https://localhost:5001/_framework/System.Private.Xml.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 4327936 from https://localhost:5001/_framework/System.Private.CoreLib.dll MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file dotnet.js.symbols. Ignoring. MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime MONO_WASM: postRunAsync 

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

# Conflicts:
#	src/mono/wasm/runtime/diagnostics.ts
#	src/mono/wasm/runtime/dotnet.d.ts
#	src/mono/wasm/runtime/pthreads/worker/index.ts
#	src/mono/wasm/runtime/startup.ts
#	src/mono/wasm/runtime/types.ts
@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Threaded sample isn't happy after the merge. I'm investigating

repro steps:

./build.sh --os browser -c Debug /p:WasmEnablePerfTracing=true
cd src/mono/sample/wasm/browser-eventpipe
make CONFIG=Debug clean publish run V=1 MSBUILD_ARGS=/p:MonoDiagnosticsMock=true

Screen Shot 2022-07-25 at 14 17 04

@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Update: the fix helps, but there is still a problem.

Screenshot from 2022-07-25 19-15-25

I think what's happening is that dotnet.worker.js initializes a Module global and passes it to createDotnetRuntime but this Module = instance assignment (https://github.com/emscripten-core/emscripten/blob/940ae7fe759a81c64e0bde0a41eb33655ad496e1/src/worker.js#L156) is never executed

Which might be because createDotnetRuntimedoesn't return a Promise for some reason. That''s the avenue I'm going to explore tonight. returns a promise that is never settled for some reason.

@lambdageek

Copy link
Copy Markdown
Member

Here's what our dotnet.js and dotnet.worker.js look like from this PR, with threading enabled https://gist.github.com/lambdageek/e54206e2e5365e3f3440a4942a303721#file-dotnet-worker-js

@lambdageek

lambdageek commented Jul 26, 2022

Copy link
Copy Markdown
Member

Ok, so the issue is in this run function in Emscripten. Note that if it's in a pthread, then it doesn't call doRun (or preRun or any of the rest), it calls a different function that's specific to pthreads. In that function it calls readyResolvePromise(Module) but it never calls postRun.

functionrun(args){args=args||arguments_;if(runDependencies>0){return;}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({"cmd": "loaded"});return;}preRun();if(runDependencies>0){return;}functiondoRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}}

So when we do

module.ready=module.ready.then(async()=>{// wait for previous stageawaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

Because nothing resolved afterPostRun, module.ready never resolves, and dotnet.worker.js just returns from self.onmessage ("load") without assigning Module = instance and the worker is left in a bad state.

Update it's less misleading to just return from configure_emscripten_startup without doing anything if we're in a pthread worker. The solution, I think is to change module.ready like this:

module.ready=module.ready.then(async()=>{// wait for previous stage// on pthread workers, postRun is never called, so there is nothing to wait forif(!ENVIRONMENT_IS_PTHREAD)awaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

@pavelsavara

With the above change, the diagnostics sample works for me.

Maybe we should just return from configure_emscripten_startup without changing preRun, onRuntimeInitialized, postRun and ready if we're in a worker since it's just misleading and i'm not sure if running any of the other config-based callbacks makes a ton of sense

@lambdageek

Copy link
Copy Markdown
Member

@pavelsavarapavelsavara#3

As follow-up to this PR we should figure out what kind of JS initialization we want to do in pthread workers. the normal callbacks don't fire. i'm not sure if that's ok or if it's leaving some part of our JS state incorrect.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek there is alredy condition in initializeImportsAndExports and I used it to exit startup sequence for workers.
That makes it work up to

WASM ERROR Error: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Threading.Thread.ThrowIfNoThreadStart(Boolean )
at System.Threading.Thread.Start(Boolean , Boolean )
at System.Threading.Thread.Start()
at Sample.Test.TestMeaning() in C:\Dev\runtime\src\mono\sample\wasm\browser-mt-eventpipe\Program.cs:line 27

Which is I guess some different issue. If the build is green, I will merge as is and we will continue in follow-up PRs.

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Screenshot from 2022-07-25 19-15-25

I noticed on the screenshot that the init_crypto is running multiple times. I think the latest in this PR should not do that anymore.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek when I rebuild with /p:WasmEnableThreads=true and not only /p:WasmEnablePerfTracing=true I could start threads :-D

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is release version
image

@lambdageek

Copy link
Copy Markdown
Member

This is release version
image

That's an asssert that we resumed a thread more times than we suspended it. Probably not due to this PR.

Comment on lines -356 to +316
configure_emscripten_startup(module, exportedAPI);

if (ENVIRONMENT_IS_WORKER) {
// HACK: Emscripten's dotnet.worker.js expects the exports of dotnet.js module to be Module object
// until we have our own fix for dotnet.worker.js file
// we also skip all emscripten startup event and configuration of worker's JS state
// note that emscripten events are not firing either
return <any>exportedAPI.Module;
}

configure_emscripten_startup(module, exportedAPI);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavelsavara

pavelsavara commented Jul 26, 2022

Copy link
Copy Markdown
MemberAuthor

There is well known Not found: args[0] = xLog

There is also timeout on V8+windows

 [wasm test] [09:40:06] info: console.debug: [MONO] AOT: FOUND method System.Runtime.Loader.AssemblyLoadContext:OnProcessExit () [0x181a - 0x181b 0x55dd8]
[wasm test] [09:55:06] info: Process 2844 didn't exit within 00:15:00 and will be killed

LogAnother log

edit: maybe this PR surfaced the #72880

@pavelsavara
pavelsavara merged commit 73374e8 into dotnet:mainJul 26, 2022
radical pushed a commit that referenced this pull request Jul 28, 2022
…tory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
@pavelsavara
pavelsavara deleted the wasm_improve_startup branch July 29, 2022 09:16
@ghostghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@lambdageek@kg@maraf@ilonatommy
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); [wasm] improve startup by pavelsavara · Pull Request #72275 · dotnet/runtime · GitHub
Skip to content

[wasm] improve startup - #72275

Merged
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup
Jul 26, 2022
Merged

[wasm] improve startup#72275
pavelsavara merged 19 commits into
dotnet:mainfrom
pavelsavara:wasm_improve_startup

Conversation

@pavelsavara

@pavelsavarapavelsavara commented Jul 15, 2022

Copy link
Copy Markdown
Member

streaming wasm instantiation, more parallel download of DLLs

and other goodnes seen in Blazor

  • new hook downloadResource?: (request: ResourceRequest) => LoadingResource allows Blazor to delegate the details to runtime while keeping the caching responsibility.
  • existing config.assets could now have resolvedUrl and pending response. That's blazor could tell us what to load and also provide pending cache promise.
  • made emsripten events async, our callbacks are called in correct order and block on previous one before the next is started.
  • improved log messages
  • load assets into memory as they arrive from network, avoiding memory allocation spike
  • run mono_wasm_pre_init_esential also in Blazor loader. This will fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. This will enable new [JSImport] for blazor.
  • locateFile is now used for all assets including mono-config.json. I also fixed scriptDirectory detection on all but v8+CJS. Therefore apps could be executed from different folder than is dotnet.js location. Credits to @yamachu
  • run init_crypto also on blazor startup sequence

Contributes to #70892
Contributes to #72810

@pavelsavarapavelsavara added this to the 7.0.0 milestone Jul 15, 2022
@pavelsavara
pavelsavara requested review from kg and marafJuly 15, 2022 16:09
@pavelsavarapavelsavara self-assigned this Jul 15, 2022
@pavelsavara
pavelsavara requested a review from lewing as a code ownerJuly 15, 2022 16:09
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details
  • load assemblies into memory synchronously during onRuntimeInitialized because async user postRun run in parallel to each other and therefore can't use loaded assemblies yet. We will do the same in Blazor.
  • run mono_wasm_pre_init_esential also in Blazor loader. This will also fix subtle crypto for them.
  • run mono_wasm_after_runtime_initialized also in Blazor loader. This would do mono_wasm_load_runtime, , mono_wasm_runtime_ready and bindings_lazy_init for them. We will eliminate it from Blazor code.
Author:pavelsavara
Assignees:pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone:7.0.0

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

I tested with current and also future! Blazor

@lewing
lewing requested a review from lambdageekJuly 15, 2022 16:54
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara
pavelsavara marked this pull request as draft July 15, 2022 17:16
@pavelsavara

This comment was marked as outdated.

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 8a1057f to d319c22CompareJuly 15, 2022 18:15
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

pavelsavara commented Jul 16, 2022

Copy link
Copy Markdown
MemberAuthor

This is the startup sequence for non-blazor

user code in createDotnetRuntime callback MONO_WASM: determined url of dotnet main script to be http://localhost:8000/
MONO_WASM: instantiateWasm MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.wasm' for dotnet.wasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit user code Module.preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_wasm_load_config MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: mono_download_assets MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Console.dll' for System.Console.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.CoreLib.dll' for System.Private.CoreLib.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Private.Uri.dll' for System.Private.Uri.dll MONO_WASM: instantiateWasm done MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.dll' for System.Runtime.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll' for System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll' for Wasm.Browser.ES6.Sample.dll MONO_WASM: Attempting to fetch 'http://localhost:8000/supportFiles/0_runtimeconfig.bin' for supportFiles/0_runtimeconfig.bin MONO_WASM: Attempting to fetch 'http://localhost:8000/icudt.dat' for icudt.dat MONO_WASM: Attempting to fetch 'http://localhost:8000/dotnet.timezones.blat' for dotnet.timezones.blat user code Module.preRun MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:System.Console.dll as assembly size 25088 from http://localhost:8000/managed/System.Console.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 1684992 from http://localhost:8000/managed/System.Private.CoreLib.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 80384 from http://localhost:8000/managed/System.Private.Uri.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 6144 from http://localhost:8000/managed/System.Runtime.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 31232 from http://localhost:8000/managed/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:Wasm.Browser.ES6.Sample.dll as assembly size 17408 from http://localhost:8000/managed/Wasm.Browser.ES6.Sample.dll MONO_WASM: Loaded:supportFiles/0_runtimeconfig.bin as vfs size 950 from http://localhost:8000/supportFiles/0_runtimeconfig.bin MONO_WASM: Creating file 'runtimeconfig.bin' in directory '/' MONO_WASM: Loaded:icudt.dat as icu size 1503760 from http://localhost:8000/icudt.dat MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from http://localhost:8000/dotnet.timezones.blat MONO_WASM: Creating directory '/usr/share/zoneinfo' MONO_WASM: Creating file '' in directory '/usr/share/zoneinfo' MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file user code Module.onRuntimeInitialized MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime user code Module.postRun user code after createDotnetRuntime() MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:TestMeaning MONO_WASM: Binding [JSExport] [Wasm.Browser.ES6.Sample]Sample.Test:IsPrime MONO_WASM: Binding [JSImport] Sample.Test.sub from null MONO_WASM: Binding [JSImport] Sample.Test.add from null meaning: 42 ret: 42 Hello, World! WASM EXIT 0 

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from 657f65b to d2884fbCompareJuly 17, 2022 08:58
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara
pavelsavaraforce-pushed the wasm_improve_startup branch from d2884fb to 2050175CompareJuly 17, 2022 20:52
@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is startup sequence with updated blazor

MONO_WASM: instantiateWasm MONO_WASM: mono_wasm_pre_init_essential MONO_WASM: preInit MONO_WASM: mono_wasm_pre_init_essential_async MONO_WASM: mono_wasm_pre_init_full MONO_WASM: mono_download_assets MONO_WASM: mono_wasm_after_user_runtime_initialized streaming MONO_WASM: instantiateWasm done MONO_WASM: preRunAsync MONO_WASM: onRuntimeInitialized MONO_WASM: Loaded:Microsoft.Extensions.Configuration.dll as assembly size 29696 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Abstractions.dll as assembly size 17920 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Binder.dll as assembly size 29184 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Binder.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.Json.dll as assembly size 16384 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.Json.dll MONO_WASM: Loaded:Microsoft.Extensions.Configuration.FileExtensions.dll as assembly size 16896 from https://localhost:5001/_framework/Microsoft.Extensions.Configuration.FileExtensions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.Abstractions.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.DependencyInjection.dll as assembly size 72192 from https://localhost:5001/_framework/Microsoft.Extensions.DependencyInjection.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.dll as assembly size 36352 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Physical.dll as assembly size 33280 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Physical.dll MONO_WASM: Loaded:Microsoft.Extensions.FileProviders.Abstractions.dll as assembly size 12288 from https://localhost:5001/_framework/Microsoft.Extensions.FileProviders.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Logging.Abstractions.dll as assembly size 53248 from https://localhost:5001/_framework/Microsoft.Extensions.Logging.Abstractions.dll MONO_WASM: Loaded:Microsoft.Extensions.Primitives.dll as assembly size 31232 from https://localhost:5001/_framework/Microsoft.Extensions.Primitives.dll MONO_WASM: Loaded:Microsoft.Extensions.Options.dll as assembly size 50176 from https://localhost:5001/_framework/Microsoft.Extensions.Options.dll MONO_WASM: Loaded:Microsoft.Extensions.FileSystemGlobbing.dll as assembly size 35840 from https://localhost:5001/_framework/Microsoft.Extensions.FileSystemGlobbing.dll MONO_WASM: Loaded:Microsoft.VisualBasic.dll as assembly size 7680 from https://localhost:5001/_framework/Microsoft.VisualBasic.dll MONO_WASM: Loaded:System.IO.Pipelines.dll as assembly size 70144 from https://localhost:5001/_framework/System.IO.Pipelines.dll MONO_WASM: Loaded:Microsoft.Win32.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/Microsoft.Win32.Primitives.dll MONO_WASM: Loaded:System.AppContext.dll as assembly size 5120 from https://localhost:5001/_framework/System.AppContext.dll MONO_WASM: Loaded:System.Buffers.dll as assembly size 5120 from https://localhost:5001/_framework/System.Buffers.dll MONO_WASM: Loaded:Microsoft.Win32.Registry.dll as assembly size 30208 from https://localhost:5001/_framework/Microsoft.Win32.Registry.dll MONO_WASM: Loaded:System.Collections.Concurrent.dll as assembly size 92672 from https://localhost:5001/_framework/System.Collections.Concurrent.dll MONO_WASM: Loaded:System.Collections.Specialized.dll as assembly size 44032 from https://localhost:5001/_framework/System.Collections.Specialized.dll MONO_WASM: Loaded:System.Collections.dll as assembly size 111104 from https://localhost:5001/_framework/System.Collections.dll MONO_WASM: Loaded:System.ComponentModel.Annotations.dll as assembly size 88576 from https://localhost:5001/_framework/System.ComponentModel.Annotations.dll MONO_WASM: Loaded:System.ComponentModel.DataAnnotations.dll as assembly size 7168 from https://localhost:5001/_framework/System.ComponentModel.DataAnnotations.dll MONO_WASM: Loaded:System.ComponentModel.EventBasedAsync.dll as assembly size 18432 from https://localhost:5001/_framework/System.ComponentModel.EventBasedAsync.dll MONO_WASM: Loaded:System.ComponentModel.dll as assembly size 6656 from https://localhost:5001/_framework/System.ComponentModel.dll MONO_WASM: Loaded:System.ComponentModel.Primitives.dll as assembly size 32256 from https://localhost:5001/_framework/System.ComponentModel.Primitives.dll MONO_WASM: Loaded:System.Configuration.dll as assembly size 9728 from https://localhost:5001/_framework/System.Configuration.dll MONO_WASM: Loaded:System.Collections.NonGeneric.dll as assembly size 43520 from https://localhost:5001/_framework/System.Collections.NonGeneric.dll MONO_WASM: Loaded:System.Console.dll as assembly size 49664 from https://localhost:5001/_framework/System.Console.dll MONO_WASM: Loaded:System.Core.dll as assembly size 13312 from https://localhost:5001/_framework/System.Core.dll MONO_WASM: Loaded:System.ComponentModel.TypeConverter.dll as assembly size 333312 from https://localhost:5001/_framework/System.ComponentModel.TypeConverter.dll MONO_WASM: Loaded:System.Collections.Immutable.dll as assembly size 212480 from https://localhost:5001/_framework/System.Collections.Immutable.dll MONO_WASM: Loaded:System.Data.dll as assembly size 13824 from https://localhost:5001/_framework/System.Data.dll MONO_WASM: Loaded:System.Data.DataSetExtensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Data.DataSetExtensions.dll MONO_WASM: Loaded:System.Diagnostics.FileVersionInfo.dll as assembly size 11776 from https://localhost:5001/_framework/System.Diagnostics.FileVersionInfo.dll MONO_WASM: Loaded:System.Diagnostics.Debug.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Debug.dll MONO_WASM: Loaded:Microsoft.CSharp.dll as assembly size 365568 from https://localhost:5001/_framework/Microsoft.CSharp.dll MONO_WASM: Loaded:System.Diagnostics.Process.dll as assembly size 55808 from https://localhost:5001/_framework/System.Diagnostics.Process.dll MONO_WASM: Loaded:System.Diagnostics.DiagnosticSource.dll as assembly size 151040 from https://localhost:5001/_framework/System.Diagnostics.DiagnosticSource.dll MONO_WASM: Loaded:Microsoft.VisualBasic.Core.dll as assembly size 516096 from https://localhost:5001/_framework/Microsoft.VisualBasic.Core.dll MONO_WASM: Loaded:System.Diagnostics.Contracts.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Contracts.dll MONO_WASM: Loaded:System.Diagnostics.StackTrace.dll as assembly size 16896 from https://localhost:5001/_framework/System.Diagnostics.StackTrace.dll MONO_WASM: Loaded:System.Diagnostics.Tools.dll as assembly size 5632 from https://localhost:5001/_framework/System.Diagnostics.Tools.dll MONO_WASM: Loaded:System.Diagnostics.TraceSource.dll as assembly size 50176 from https://localhost:5001/_framework/System.Diagnostics.TraceSource.dll MONO_WASM: Loaded:System.Diagnostics.TextWriterTraceListener.dll as assembly size 23040 from https://localhost:5001/_framework/System.Diagnostics.TextWriterTraceListener.dll MONO_WASM: Loaded:System.Formats.Tar.dll as assembly size 32768 from https://localhost:5001/_framework/System.Formats.Tar.dll MONO_WASM: Loaded:System.Diagnostics.Tracing.dll as assembly size 6144 from https://localhost:5001/_framework/System.Diagnostics.Tracing.dll MONO_WASM: Loaded:System.Globalization.Calendars.dll as assembly size 6144 from https://localhost:5001/_framework/System.Globalization.Calendars.dll MONO_WASM: Loaded:System.IO.Compression.Brotli.dll as assembly size 19456 from https://localhost:5001/_framework/System.IO.Compression.Brotli.dll MONO_WASM: Loaded:System.Globalization.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Globalization.Extensions.dll MONO_WASM: Loaded:System.Globalization.dll as assembly size 5632 from https://localhost:5001/_framework/System.Globalization.dll MONO_WASM: Loaded:System.IO.Compression.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.Compression.FileSystem.dll MONO_WASM: Loaded:System.Dynamic.Runtime.dll as assembly size 6144 from https://localhost:5001/_framework/System.Dynamic.Runtime.dll MONO_WASM: Loaded:System.IO.Compression.ZipFile.dll as assembly size 26624 from https://localhost:5001/_framework/System.IO.Compression.ZipFile.dll MONO_WASM: Loaded:System.IO.FileSystem.AccessControl.dll as assembly size 24064 from https://localhost:5001/_framework/System.IO.FileSystem.AccessControl.dll MONO_WASM: Loaded:System.IO.FileSystem.DriveInfo.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.FileSystem.DriveInfo.dll MONO_WASM: Loaded:System.Drawing.dll as assembly size 10752 from https://localhost:5001/_framework/System.Drawing.dll MONO_WASM: Loaded:System.IO.IsolatedStorage.dll as assembly size 27136 from https://localhost:5001/_framework/System.IO.IsolatedStorage.dll MONO_WASM: Loaded:System.Formats.Asn1.dll as assembly size 87040 from https://localhost:5001/_framework/System.Formats.Asn1.dll MONO_WASM: Loaded:System.IO.Compression.dll as assembly size 119808 from https://localhost:5001/_framework/System.IO.Compression.dll MONO_WASM: Loaded:System.IO.FileSystem.Watcher.dll as assembly size 25600 from https://localhost:5001/_framework/System.IO.FileSystem.Watcher.dll MONO_WASM: Loaded:System.IO.FileSystem.Primitives.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.FileSystem.Primitives.dll MONO_WASM: Loaded:System.IO.MemoryMappedFiles.dll as assembly size 45056 from https://localhost:5001/_framework/System.IO.MemoryMappedFiles.dll MONO_WASM: Loaded:System.IO.UnmanagedMemoryStream.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.UnmanagedMemoryStream.dll MONO_WASM: Loaded:System.IO.FileSystem.dll as assembly size 5632 from https://localhost:5001/_framework/System.IO.FileSystem.dll MONO_WASM: Loaded:System.IO.dll as assembly size 5120 from https://localhost:5001/_framework/System.IO.dll MONO_WASM: Loaded:System.Drawing.Primitives.dll as assembly size 54784 from https://localhost:5001/_framework/System.Drawing.Primitives.dll MONO_WASM: Loaded:System.Linq.Queryable.dll as assembly size 86528 from https://localhost:5001/_framework/System.Linq.Queryable.dll MONO_WASM: Loaded:System.IO.Pipes.AccessControl.dll as assembly size 13312 from https://localhost:5001/_framework/System.IO.Pipes.AccessControl.dll MONO_WASM: Loaded:System.Net.Http.Json.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.Http.Json.dll MONO_WASM: Loaded:System.Memory.dll as assembly size 50688 from https://localhost:5001/_framework/System.Memory.dll MONO_WASM: Loaded:System.IO.Pipes.dll as assembly size 38400 from https://localhost:5001/_framework/System.IO.Pipes.dll MONO_WASM: Loaded:System.Net.NameResolution.dll as assembly size 14848 from https://localhost:5001/_framework/System.Net.NameResolution.dll MONO_WASM: Loaded:System.Net.HttpListener.dll as assembly size 60928 from https://localhost:5001/_framework/System.Net.HttpListener.dll MONO_WASM: Loaded:System.Net.ServicePoint.dll as assembly size 17408 from https://localhost:5001/_framework/System.Net.ServicePoint.dll MONO_WASM: Loaded:System.Net.Primitives.dll as assembly size 99840 from https://localhost:5001/_framework/System.Net.Primitives.dll MONO_WASM: Loaded:System.Net.Ping.dll as assembly size 18432 from https://localhost:5001/_framework/System.Net.Ping.dll MONO_WASM: Loaded:System.Linq.Parallel.dll as assembly size 259584 from https://localhost:5001/_framework/System.Linq.Parallel.dll MONO_WASM: Loaded:System.Linq.dll as assembly size 131584 from https://localhost:5001/_framework/System.Linq.dll MONO_WASM: Loaded:System.Net.Sockets.dll as assembly size 75264 from https://localhost:5001/_framework/System.Net.Sockets.dll MONO_WASM: Loaded:System.Net.Quic.dll as assembly size 33280 from https://localhost:5001/_framework/System.Net.Quic.dll MONO_WASM: Loaded:System.Net.Http.dll as assembly size 297472 from https://localhost:5001/_framework/System.Net.Http.dll MONO_WASM: Loaded:System.Net.Security.dll as assembly size 90624 from https://localhost:5001/_framework/System.Net.Security.dll MONO_WASM: Loaded:System.Net.WebSockets.Client.dll as assembly size 40448 from https://localhost:5001/_framework/System.Net.WebSockets.Client.dll MONO_WASM: Loaded:System.Net.Requests.dll as assembly size 59392 from https://localhost:5001/_framework/System.Net.Requests.dll MONO_WASM: Loaded:System.ObjectModel.dll as assembly size 32768 from https://localhost:5001/_framework/System.ObjectModel.dll MONO_WASM: Loaded:System.Numerics.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.dll MONO_WASM: Loaded:System.Net.WebHeaderCollection.dll as assembly size 26112 from https://localhost:5001/_framework/System.Net.WebHeaderCollection.dll MONO_WASM: Loaded:System.Net.WebClient.dll as assembly size 40960 from https://localhost:5001/_framework/System.Net.WebClient.dll MONO_WASM: Loaded:System.Net.WebProxy.dll as assembly size 11264 from https://localhost:5001/_framework/System.Net.WebProxy.dll MONO_WASM: Loaded:System.Reflection.DispatchProxy.dll as assembly size 28160 from https://localhost:5001/_framework/System.Reflection.DispatchProxy.dll MONO_WASM: Loaded:System.Net.NetworkInformation.dll as assembly size 32768 from https://localhost:5001/_framework/System.Net.NetworkInformation.dll MONO_WASM: Loaded:System.Reflection.Emit.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.dll MONO_WASM: Loaded:System.Net.WebSockets.dll as assembly size 86528 from https://localhost:5001/_framework/System.Net.WebSockets.dll MONO_WASM: Loaded:System.Net.Mail.dll as assembly size 109568 from https://localhost:5001/_framework/System.Net.Mail.dll MONO_WASM: Loaded:System.Reflection.Emit.ILGeneration.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.ILGeneration.dll MONO_WASM: Loaded:System.Reflection.TypeExtensions.dll as assembly size 15360 from https://localhost:5001/_framework/System.Reflection.TypeExtensions.dll MONO_WASM: Loaded:System.Net.dll as assembly size 7168 from https://localhost:5001/_framework/System.Net.dll MONO_WASM: Loaded:System.Reflection.Extensions.dll as assembly size 5120 from https://localhost:5001/_framework/System.Reflection.Extensions.dll MONO_WASM: Loaded:System.Resources.Reader.dll as assembly size 5120 from https://localhost:5001/_framework/System.Resources.Reader.dll MONO_WASM: Loaded:System.Numerics.Vectors.dll as assembly size 5632 from https://localhost:5001/_framework/System.Numerics.Vectors.dll MONO_WASM: Loaded:System.Reflection.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Primitives.dll MONO_WASM: Loaded:System.Reflection.Emit.Lightweight.dll as assembly size 5632 from https://localhost:5001/_framework/System.Reflection.Emit.Lightweight.dll MONO_WASM: Loaded:System.Runtime.Extensions.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.Extensions.dll MONO_WASM: Loaded:System.Runtime.Handles.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.Handles.dll MONO_WASM: Loaded:System.Resources.ResourceManager.dll as assembly size 5632 from https://localhost:5001/_framework/System.Resources.ResourceManager.dll MONO_WASM: Loaded:System.Private.Xml.Linq.dll as assembly size 170496 from https://localhost:5001/_framework/System.Private.Xml.Linq.dll MONO_WASM: Loaded:System.Linq.Expressions.dll as assembly size 656896 from https://localhost:5001/_framework/System.Linq.Expressions.dll MONO_WASM: Loaded:System.Runtime.InteropServices.RuntimeInformation.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.InteropServices.RuntimeInformation.dll MONO_WASM: Loaded:System.Runtime.Intrinsics.dll as assembly size 6656 from https://localhost:5001/_framework/System.Runtime.Intrinsics.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.VisualC.dll as assembly size 7680 from https://localhost:5001/_framework/System.Runtime.CompilerServices.VisualC.dll MONO_WASM: Loaded:System.Resources.Writer.dll as assembly size 19456 from https://localhost:5001/_framework/System.Resources.Writer.dll MONO_WASM: Loaded:System.Runtime.Loader.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Loader.dll MONO_WASM: Loaded:System.Reflection.Metadata.dll as assembly size 512000 from https://localhost:5001/_framework/System.Reflection.Metadata.dll MONO_WASM: Loaded:System.Runtime.CompilerServices.Unsafe.dll as assembly size 5120 from https://localhost:5001/_framework/System.Runtime.CompilerServices.Unsafe.dll MONO_WASM: Loaded:System.Runtime.Serialization.Formatters.dll as assembly size 68096 from https://localhost:5001/_framework/System.Runtime.Serialization.Formatters.dll MONO_WASM: Loaded:System.Reflection.dll as assembly size 6144 from https://localhost:5001/_framework/System.Reflection.dll MONO_WASM: Loaded:System.Security.Claims.dll as assembly size 46080 from https://localhost:5001/_framework/System.Security.Claims.dll MONO_WASM: Loaded:System.Runtime.InteropServices.dll as assembly size 31232 from https://localhost:5001/_framework/System.Runtime.InteropServices.dll MONO_WASM: Loaded:System.Security.Cryptography.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Encoding.dll MONO_WASM: Loaded:System.Security.Cryptography.Primitives.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.Primitives.dll MONO_WASM: Loaded:System.Runtime.InteropServices.JavaScript.dll as assembly size 80896 from https://localhost:5001/_framework/System.Runtime.InteropServices.JavaScript.dll MONO_WASM: Loaded:System.Security.Cryptography.OpenSsl.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Cryptography.OpenSsl.dll MONO_WASM: Loaded:System.Runtime.Serialization.dll as assembly size 7168 from https://localhost:5001/_framework/System.Runtime.Serialization.dll MONO_WASM: Loaded:System.Runtime.Serialization.Xml.dll as assembly size 6144 from https://localhost:5001/_framework/System.Runtime.Serialization.Xml.dll MONO_WASM: Loaded:System.Security.Cryptography.X509Certificates.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.X509Certificates.dll MONO_WASM: Loaded:System.Runtime.Serialization.Primitives.dll as assembly size 12800 from https://localhost:5001/_framework/System.Runtime.Serialization.Primitives.dll MONO_WASM: Loaded:System.Runtime.Numerics.dll as assembly size 141824 from https://localhost:5001/_framework/System.Runtime.Numerics.dll MONO_WASM: Loaded:System.Private.Uri.dll as assembly size 111616 from https://localhost:5001/_framework/System.Private.Uri.dll MONO_WASM: Loaded:System.ServiceProcess.dll as assembly size 6144 from https://localhost:5001/_framework/System.ServiceProcess.dll MONO_WASM: Loaded:System.Security.dll as assembly size 8192 from https://localhost:5001/_framework/System.Security.dll MONO_WASM: Loaded:System.Text.Encoding.Extensions.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.Extensions.dll MONO_WASM: Loaded:System.Text.Encoding.dll as assembly size 5632 from https://localhost:5001/_framework/System.Text.Encoding.dll MONO_WASM: Loaded:System.Runtime.dll as assembly size 33792 from https://localhost:5001/_framework/System.Runtime.dll MONO_WASM: Loaded:System.Security.AccessControl.dll as assembly size 53248 from https://localhost:5001/_framework/System.Security.AccessControl.dll MONO_WASM: Loaded:System.Runtime.Serialization.Json.dll as assembly size 5632 from https://localhost:5001/_framework/System.Runtime.Serialization.Json.dll MONO_WASM: Loaded:System.Security.SecureString.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.SecureString.dll MONO_WASM: Loaded:System.Security.Cryptography.Cng.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Cng.dll MONO_WASM: Loaded:System.Threading.Channels.dll as assembly size 51200 from https://localhost:5001/_framework/System.Threading.Channels.dll MONO_WASM: Loaded:System.Security.Cryptography.Csp.dll as assembly size 6144 from https://localhost:5001/_framework/System.Security.Cryptography.Csp.dll MONO_WASM: Loaded:System.Security.Cryptography.Algorithms.dll as assembly size 7168 from https://localhost:5001/_framework/System.Security.Cryptography.Algorithms.dll MONO_WASM: Loaded:System.Threading.Tasks.Parallel.dll as assembly size 57344 from https://localhost:5001/_framework/System.Threading.Tasks.Parallel.dll MONO_WASM: Loaded:System.Threading.Tasks.dll as assembly size 6656 from https://localhost:5001/_framework/System.Threading.Tasks.dll MONO_WASM: Loaded:System.Threading.Timer.dll as assembly size 5120 from https://localhost:5001/_framework/System.Threading.Timer.dll MONO_WASM: Loaded:System.Security.Cryptography.dll as assembly size 511488 from https://localhost:5001/_framework/System.Security.Cryptography.dll MONO_WASM: Loaded:System.Threading.Thread.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Thread.dll MONO_WASM: Loaded:System.Security.Principal.Windows.dll as assembly size 29184 from https://localhost:5001/_framework/System.Security.Principal.Windows.dll MONO_WASM: Loaded:System.Windows.dll as assembly size 6144 from https://localhost:5001/_framework/System.Windows.dll MONO_WASM: Loaded:System.Threading.Overlapped.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.Overlapped.dll MONO_WASM: Loaded:System.Xml.Linq.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.Linq.dll MONO_WASM: Loaded:System.ServiceModel.Web.dll as assembly size 7168 from https://localhost:5001/_framework/System.ServiceModel.Web.dll MONO_WASM: Loaded:System.Threading.Tasks.Extensions.dll as assembly size 6144 from https://localhost:5001/_framework/System.Threading.Tasks.Extensions.dll MONO_WASM: Loaded:System.Threading.dll as assembly size 44032 from https://localhost:5001/_framework/System.Threading.dll MONO_WASM: Loaded:System.Xml.XPath.XDocument.dll as assembly size 6144 from https://localhost:5001/_framework/System.Xml.XPath.XDocument.dll MONO_WASM: Loaded:System.Xml.ReaderWriter.dll as assembly size 11776 from https://localhost:5001/_framework/System.Xml.ReaderWriter.dll MONO_WASM: Loaded:WindowsBase.dll as assembly size 6144 from https://localhost:5001/_framework/WindowsBase.dll MONO_WASM: Loaded:System.Transactions.dll as assembly size 6656 from https://localhost:5001/_framework/System.Transactions.dll MONO_WASM: Loaded:System.Text.Json.dll as assembly size 643584 from https://localhost:5001/_framework/System.Text.Json.dll MONO_WASM: Loaded:System.Threading.Tasks.Dataflow.dll as assembly size 237568 from https://localhost:5001/_framework/System.Threading.Tasks.Dataflow.dll MONO_WASM: Loaded:System.Security.Principal.dll as assembly size 5632 from https://localhost:5001/_framework/System.Security.Principal.dll MONO_WASM: Loaded:mscorlib.dll as assembly size 47104 from https://localhost:5001/_framework/mscorlib.dll MONO_WASM: Loaded:System.ValueTuple.dll as assembly size 5632 from https://localhost:5001/_framework/System.ValueTuple.dll MONO_WASM: Loaded:System.Text.Encodings.Web.dll as assembly size 67584 from https://localhost:5001/_framework/System.Text.Encodings.Web.dll MONO_WASM: Loaded:System.Web.HttpUtility.dll as assembly size 19456 from https://localhost:5001/_framework/System.Web.HttpUtility.dll MONO_WASM: Loaded:System.Xml.XPath.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XPath.dll MONO_WASM: Loaded:System.Threading.ThreadPool.dll as assembly size 5632 from https://localhost:5001/_framework/System.Threading.ThreadPool.dll MONO_WASM: Loaded:System.Xml.XmlSerializer.dll as assembly size 7680 from https://localhost:5001/_framework/System.Xml.XmlSerializer.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.dll as assembly size 6656 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.dll MONO_WASM: Loaded:System.Xml.XDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XDocument.dll MONO_WASM: Loaded:System.dll as assembly size 39936 from https://localhost:5001/_framework/System.dll MONO_WASM: Loaded:System.Xml.dll as assembly size 13824 from https://localhost:5001/_framework/System.Xml.dll MONO_WASM: Loaded:System.Xml.Serialization.dll as assembly size 6656 from https://localhost:5001/_framework/System.Xml.Serialization.dll MONO_WASM: Loaded:netstandard.dll as assembly size 90112 from https://localhost:5001/_framework/netstandard.dll MONO_WASM: Loaded:System.Text.RegularExpressions.dll as assembly size 433152 from https://localhost:5001/_framework/System.Text.RegularExpressions.dll MONO_WASM: Loaded:System.Xml.XmlDocument.dll as assembly size 5632 from https://localhost:5001/_framework/System.Xml.XmlDocument.dll MONO_WASM: Loaded:System.Web.dll as assembly size 5120 from https://localhost:5001/_framework/System.Web.dll MONO_WASM: Loaded:System.Transactions.Local.dll as assembly size 171520 from https://localhost:5001/_framework/System.Transactions.Local.dll MONO_WASM: Loaded:System.Text.Encoding.CodePages.dll as assembly size 775680 from https://localhost:5001/_framework/System.Text.Encoding.CodePages.dll MONO_WASM: Loaded:System.Private.DataContractSerialization.dll as assembly size 956928 from https://localhost:5001/_framework/System.Private.DataContractSerialization.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.dll as assembly size 130560 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.dll as assembly size 84992 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.dll as assembly size 240640 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.dll MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.dll as assembly size 25088 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.dll MONO_WASM: Loaded:System.Data.Common.dll as assembly size 1294336 from https://localhost:5001/_framework/System.Data.Common.dll MONO_WASM: Loaded:Microsoft.JSInterop.dll as assembly size 58880 from https://localhost:5001/_framework/Microsoft.JSInterop.dll MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.dll as assembly size 12800 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.dll MONO_WASM: Loaded:Microsoft.JSInterop.pdb as pdb size 34308 from https://localhost:5001/_framework/Microsoft.JSInterop.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.WebAssembly.pdb as pdb size 44080 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.dll as assembly size 20992 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.dll MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Shared.pdb as pdb size 15416 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Shared.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.pdb as pdb size 123316 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Web.pdb as pdb size 59568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Web.pdb MONO_WASM: Loaded:Microsoft.JSInterop.WebAssembly.pdb as pdb size 18148 from https://localhost:5001/_framework/Microsoft.JSInterop.WebAssembly.pdb MONO_WASM: Loaded:HostedBlazorWebassemblyApp.Client.pdb as pdb size 27948 from https://localhost:5001/_framework/HostedBlazorWebassemblyApp.Client.pdb MONO_WASM: Loaded:Microsoft.AspNetCore.Components.Forms.pdb as pdb size 21568 from https://localhost:5001/_framework/Microsoft.AspNetCore.Components.Forms.pdb MONO_WASM: Loaded:dotnet.timezones.blat as vfs size 331468 from https://localhost:5001/_framework/dotnet.timezones.blat MONO_WASM: Creating file 'dotnet.timezones.blat' in directory '/' MONO_WASM: Loaded:icudt_EFIGS.dat as icu size 550320 from https://localhost:5001/_framework/icudt_EFIGS.dat MONO_WASM: Loaded:System.Private.Xml.dll as assembly size 3859968 from https://localhost:5001/_framework/System.Private.Xml.dll MONO_WASM: Loaded:System.Private.CoreLib.dll as assembly size 4327936 from https://localhost:5001/_framework/System.Private.CoreLib.dll MONO_WASM: all assets are loaded in wasm memory MONO_WASM: mono_wasm_before_user_runtime_initialized MONO_WASM: ICU data archive(s) loaded, disabling invariant mode MONO_WASM: mono_wasm_load_runtime MONO_WASM: bindings_init mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28 MONO_WASM: Could not find symbols file dotnet.js.symbols. Ignoring. MONO_WASM: mono_wasm_after_user_runtime_initialized MONO_WASM: Initializing mono runtime MONO_WASM: postRunAsync 

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

# Conflicts:
#	src/mono/wasm/runtime/diagnostics.ts
#	src/mono/wasm/runtime/dotnet.d.ts
#	src/mono/wasm/runtime/pthreads/worker/index.ts
#	src/mono/wasm/runtime/startup.ts
#	src/mono/wasm/runtime/types.ts
@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Threaded sample isn't happy after the merge. I'm investigating

repro steps:

./build.sh --os browser -c Debug /p:WasmEnablePerfTracing=true
cd src/mono/sample/wasm/browser-eventpipe
make CONFIG=Debug clean publish run V=1 MSBUILD_ARGS=/p:MonoDiagnosticsMock=true

Screen Shot 2022-07-25 at 14 17 04

@lambdageek

lambdageek commented Jul 25, 2022

Copy link
Copy Markdown
Member

Update: the fix helps, but there is still a problem.

Screenshot from 2022-07-25 19-15-25

I think what's happening is that dotnet.worker.js initializes a Module global and passes it to createDotnetRuntime but this Module = instance assignment (https://github.com/emscripten-core/emscripten/blob/940ae7fe759a81c64e0bde0a41eb33655ad496e1/src/worker.js#L156) is never executed

Which might be because createDotnetRuntimedoesn't return a Promise for some reason. That''s the avenue I'm going to explore tonight. returns a promise that is never settled for some reason.

@lambdageek

Copy link
Copy Markdown
Member

Here's what our dotnet.js and dotnet.worker.js look like from this PR, with threading enabled https://gist.github.com/lambdageek/e54206e2e5365e3f3440a4942a303721#file-dotnet-worker-js

@lambdageek

lambdageek commented Jul 26, 2022

Copy link
Copy Markdown
Member

Ok, so the issue is in this run function in Emscripten. Note that if it's in a pthread, then it doesn't call doRun (or preRun or any of the rest), it calls a different function that's specific to pthreads. In that function it calls readyResolvePromise(Module) but it never calls postRun.

functionrun(args){args=args||arguments_;if(runDependencies>0){return;}if(ENVIRONMENT_IS_PTHREAD){readyPromiseResolve(Module);initRuntime();postMessage({"cmd": "loaded"});return;}preRun();if(runDependencies>0){return;}functiondoRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else{doRun();}}

So when we do

module.ready=module.ready.then(async()=>{// wait for previous stageawaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

Because nothing resolved afterPostRun, module.ready never resolves, and dotnet.worker.js just returns from self.onmessage ("load") without assigning Module = instance and the worker is left in a bad state.

Update it's less misleading to just return from configure_emscripten_startup without doing anything if we're in a pthread worker. The solution, I think is to change module.ready like this:

module.ready=module.ready.then(async()=>{// wait for previous stage// on pthread workers, postRun is never called, so there is nothing to wait forif(!ENVIRONMENT_IS_PTHREAD)awaitafterPostRun.promise;// - here we resolve the promise returned by createDotnetRuntime exportreturnexportedAPI;// - any code after createDotnetRuntime is executed now});

@pavelsavara

With the above change, the diagnostics sample works for me.

Maybe we should just return from configure_emscripten_startup without changing preRun, onRuntimeInitialized, postRun and ready if we're in a worker since it's just misleading and i'm not sure if running any of the other config-based callbacks makes a ton of sense

@lambdageek

Copy link
Copy Markdown
Member

@pavelsavarapavelsavara#3

As follow-up to this PR we should figure out what kind of JS initialization we want to do in pthread workers. the normal callbacks don't fire. i'm not sure if that's ok or if it's leaving some part of our JS state incorrect.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek there is alredy condition in initializeImportsAndExports and I used it to exit startup sequence for workers.
That makes it work up to

WASM ERROR Error: System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Threading.Thread.ThrowIfNoThreadStart(Boolean )
at System.Threading.Thread.Start(Boolean , Boolean )
at System.Threading.Thread.Start()
at Sample.Test.TestMeaning() in C:\Dev\runtime\src\mono\sample\wasm\browser-mt-eventpipe\Program.cs:line 27

Which is I guess some different issue. If the build is green, I will merge as is and we will continue in follow-up PRs.

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

Screenshot from 2022-07-25 19-15-25

I noticed on the screenshot that the init_crypto is running multiple times. I think the latest in this PR should not do that anymore.

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

@lambdageek when I rebuild with /p:WasmEnableThreads=true and not only /p:WasmEnablePerfTracing=true I could start threads :-D

image

@pavelsavara

Copy link
Copy Markdown
MemberAuthor

This is release version
image

@lambdageek

Copy link
Copy Markdown
Member

This is release version
image

That's an asssert that we resumed a thread more times than we suspended it. Probably not due to this PR.

Comment on lines -356 to +316
configure_emscripten_startup(module, exportedAPI);

if (ENVIRONMENT_IS_WORKER) {
// HACK: Emscripten's dotnet.worker.js expects the exports of dotnet.js module to be Module object
// until we have our own fix for dotnet.worker.js file
// we also skip all emscripten startup event and configuration of worker's JS state
// note that emscripten events are not firing either
return <any>exportedAPI.Module;
}

configure_emscripten_startup(module, exportedAPI);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pavelsavara

pavelsavara commented Jul 26, 2022

Copy link
Copy Markdown
MemberAuthor

There is well known Not found: args[0] = xLog

There is also timeout on V8+windows

 [wasm test] [09:40:06] info: console.debug: [MONO] AOT: FOUND method System.Runtime.Loader.AssemblyLoadContext:OnProcessExit () [0x181a - 0x181b 0x55dd8]
[wasm test] [09:55:06] info: Process 2844 didn't exit within 00:15:00 and will be killed

LogAnother log

edit: maybe this PR surfaced the #72880

@pavelsavara
pavelsavara merged commit 73374e8 into dotnet:mainJul 26, 2022
radical pushed a commit that referenced this pull request Jul 28, 2022
…tory (#69441)
In #72275 we fixed locateFile to deal with relative file path or URL. We could also handle absolute path/URL. This PR is adding tests to prove it works.
@pavelsavara
pavelsavara deleted the wasm_improve_startup branch July 29, 2022 09:16
@ghostghost locked as resolved and limited conversation to collaborators Aug 28, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@pavelsavara@lambdageek@kg@maraf@ilonatommy