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

Issues related to VMProtect
Post Reply
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

Hello Admin,

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

Here is the problem:

Code: Select all

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
Last edited by weloveayaka on Mon Apr 08, 2024 3:10 am, edited 1 time in total.
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

2025/2040 also has this problem
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

[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
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

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.
Admin
Site Admin
Posts: 2686
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post by Admin »

weloveayaka wrote: Mon Mar 25, 2024 2:18 am 2025/2040 also has this problem
Fixed in the 2109 build.
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

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?
Admin
Site Admin
Posts: 2686
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post by Admin »

Fixed in the 2119 build.
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

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

System.InvalidOperationException

Code: Select all

[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();
}
Admin
Site Admin
Posts: 2686
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post by Admin »

Fixed in the 2126 build.
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

Thanks for fast response

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

Code: Select all

 public static int TestEvent()
    {
        var eventExample = new EventExample();
        eventExample.ExampleEvent += () => eventExample.Counter++;
        eventExample.RaiseEvent();
        eventExample.RaiseEvent();
        return eventExample.Counter;
    }
System.OutOfMemoryException
Admin
Site Admin
Posts: 2686
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post by Admin »

What is "EventExample"?
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

sorry

Code: Select all

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

        public void RaiseEvent()
        {
            ExampleEvent?.Invoke();
        }
    }
   
weloveayaka
Posts: 66
Joined: Wed Jul 05, 2023 6:21 am

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

Post by weloveayaka »

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