version 2023/2025/2040: multiple async operation can't complete

Hello Admin,

Thank you very much for always promptly responding to and fixing software issues.

Here is the problem:

internal class Program
{
  
    static void Main(string[] args)
    {
        Console.WriteLine("async start");
        T().Wait();
        Console.WriteLine("Finished");   <------------------ Can't run into here
        Console.ReadLine();
    }

    [Obfuscation(Exclude = false,Feature = "ultra")]
    static async Task T()
    {
        var a = new AsyncClass();
        await a.DoAsyncWork();
    }


    [Obfuscation(Feature = "ultra", Exclude = false)]
    public class AsyncClass
    {
        public async System.Threading.Tasks.Task DoAsyncWork()
        {
            await System.Threading.Tasks.Task.Delay(1000);
            Console.WriteLine("Async work completed");
        }
    }

Only release configuration have this problem, debug configuration runs well.
vmp 2023 with default settings and .net framework 4.8.1

2025/2040 also has this problem

[del]build 2040 memory leak, It takes 10+GB memory before GC. VMMap can see a very large private data.
build 2025 do not have this problem.

Not found minimal code to reproduce the problem yet.

[/del]

Maybe our mistake still look into it

antoher issue:
DivideByZeroException inside VM, .net framework 4.6.1
after upgraded to 4.8, problem solved.

just report here, we will ask user to use latest version.

Fixed in the 2109 build.

Hello Admin
2110 look solved this problem,

but this one:
public void UnsafeMethod()
{
int* ptr = stackalloc int[1];
*ptr = 42;
Console.WriteLine("Unsafe method: " + *ptr);
}

got error on build 2110, runs well on build 2025, could you please have a look?

Fixed in the 2119 build.

Hello, following code can’t be run on 2119, .net 4.8.1
Thank you for your help

System.InvalidOperationException

[Obfuscation(Feature = "virtualization", Exclude = false)]
public static string GetMD5_32(string ConvertString)
{
    var md5 = new MD5CryptoServiceProvider();
    byte[] t = md5.ComputeHash(UTF8Encoding.Default.GetBytes(ConvertString));
    StringBuilder sb = new StringBuilder(32);

    for (int i = 0; i < t.Length; i++)
    {
        sb.Append(t[i].ToString("x").PadLeft(2, '0'));
    }
    return sb.ToString();
}

Fixed in the 2126 build.

Thanks for fast response

2126, the same example, could you please have a look?

 public static int TestEvent()
    {
        var eventExample = new EventExample();
        eventExample.ExampleEvent += () => eventExample.Counter++;
        eventExample.RaiseEvent();
        eventExample.RaiseEvent();
        return eventExample.Counter;
    }

System.OutOfMemoryException

What is “EventExample”?

sorry

 public class EventExample
    {
        public int Counter { get; set; }
        public event Action ExampleEvent;

        public void RaiseEvent()
        {
            ExampleEvent?.Invoke();
        }
    }

I compile it again use same original exe and same VMP config on same computer. this time it runs well.