You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to try out the limits of DotNetIsolator and changed the ConsoleSample.Program.cs file to have call runtime.Invoke(...)many more times (because you don't know how often a 3rd party code would call Invoke(...)). I also emptied the lambda body to speed up the invocation and to not have parameters, captured variables or return values have any influence.
Any non-empty lambda body causes the error to happen at an even lower invocation count.
Issue
Up to 35317 invocations there is no problem: The final output of the host is printed in the console (with impressive 0,04ms/call!).
But when incrementing numCalls by just 1 to 35318, it breaks with a WasmtimeException (see below).
Maybe this is an issue of Wasmtime itself, but I'm not sure as I'm not experienced in this kind of magic 😉.
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.3.23178.7\
.NET workloads installed:
There are no installed workloads to display.
Other architectures found:
arm64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
dotnet workload list
Installed Workload Id Manifest Version Installation Source
---------------------------------------------------------------------------------------------
macos 13.1.462-net8-p3/8.0.100-preview.3 VS 17.7.33711.374
maccatalyst 16.2.462-net8-p3/8.0.100-preview.3 VS 17.7.33711.374
maui-windows 8.0.0-preview.3.8149/8.0.100-preview.3 VS 17.7.33711.374
maui-maccatalyst 8.0.0-preview.3.8149/8.0.100-preview.3 VS 17.7.33711.374
maui-ios 8.0.0-preview.3.8149/8.0.100-preview.3 VS 17.7.33711.374
wasm-tools 8.0.0-preview.3.23174.8/8.0.100-preview.3 VS 17.7.33711.374
wasm-tools-net6 8.0.0-preview.3.23174.8/8.0.100-preview.3 VS 17.7.33711.374
runtimes-windows 8.0.0-preview.3.23174.8/8.0.100-preview.3 VS 17.7.33711.374
ios 16.2.462-net8-p3/8.0.100-preview.3 VS 17.7.33711.374
android 34.0.0-preview.3.224/8.0.100-preview.3 VS 17.7.33711.374
maui-android 8.0.0-preview.3.8149/8.0.100-preview.3 VS 17.7.33711.374
Personal Note
That's some awesome stuff your doing here! Please keep it on!
The text was updated successfully, but these errors were encountered:
warappa
changed the title
Too many invokations cause WasmtimeException "sgen-stw.c:77, condition ... not met"
Too many invocations cause WasmtimeException "sgen-stw.c:77, condition ... not met"
May 19, 2023
I've observed that this is not only caused by too many invocations, but also by too much data transfer.
By limiting to only 1 invocation, using the following code I manually binary searched the maximum amount of bytes I could return.
I cause the same error by either: Incrementing that amount by 1; Or the sum of multiple invocations exceeds that number.
WasiConfigurationwasiConfiguration=new WasiConfiguration().WithInheritedStandardOutput().WithInheritedStandardError();usingvarhost=new IsolatedRuntimeHost().WithAssemblyLoader(LoadAssembly);usingvarisolatedRuntime=new IsolatedRuntime(host);// Maximum bytes without crash: 0b0111_0110_0100_1010_1110_0011 = 7752419 = 7.39 MiBconstintbytesToGenerate=0b0111_0110_0100_1010_1110_0011;IsolatedObjectbyteGenerator= isolatedRuntime.CreateObject<ReturnManyPseudoRandomByteGenerator>();
byteGenerator.Invoke<int,int,byte[]>("GenerateBytes",1, bytesToGenerate);classReturnManyPseudoRandomByteGenerator{publicbyte[]GenerateBytes(intseed,intcount){Randomrandom=new(seed);byte[]bytes=newbyte[count];
random.NextBytes(bytes);returnbytes;}}
Setup
I wanted to try out the limits of DotNetIsolator and changed the
ConsoleSample.Program.cs
file to have callruntime.Invoke(...)
many more times (because you don't know how often a 3rd party code would callInvoke(...)
). I also emptied the lambda body to speed up the invocation and to not have parameters, captured variables or return values have any influence.Any non-empty lambda body causes the error to happen at an even lower invocation count.
Issue
Up to
35317
invocations there is no problem: The final output of the host is printed in the console (with impressive 0,04ms/call!).But when incrementing
numCalls
by just1
to35318
, it breaks with aWasmtimeException
(see below).Maybe this is an issue of Wasmtime itself, but I'm not sure as I'm not experienced in this kind of magic 😉.
Edited ConsoleSample
Raised Exception
Expected Result
There should be no upper limit in invocation count.
Additional Information
Tested on 6dbe1a3
This error also happened on previous versions of DotNetIsolator.
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100-preview.3.23178.7\
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.0-preview.3.23174.8
Architecture: x64
Commit: 47bad717bd
.NET SDKs installed:
3.1.426 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
5.0.416 [C:\Program Files\dotnet\sdk]
6.0.311 [C:\Program Files\dotnet\sdk]
7.0.100-preview.7.22377.5 [C:\Program Files\dotnet\sdk]
7.0.100-rc.1.22431.12 [C:\Program Files\dotnet\sdk]
7.0.105 [C:\Program Files\dotnet\sdk]
7.0.302 [C:\Program Files\dotnet\sdk]
7.0.400-preview.23225.8 [C:\Program Files\dotnet\sdk]
8.0.100-preview.3.23178.7 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-preview.7.22376.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-rc.1.22427.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.3.23177.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-preview.7.22375.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-rc.1.22426.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.3.23174.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0-preview.7.22377.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0-rc.1.22427.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0-preview.3.23178.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
arm64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Personal Note
That's some awesome stuff your doing here! Please keep it on!
The text was updated successfully, but these errors were encountered: