td icon indicating copy to clipboard operation
td copied to clipboard

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Open georgii01 opened this issue 1 year ago • 1 comments

Hi,

I built a new version of Telegram.Td.dll The issue appeared after switching to TDLib 1.8.42 x64. I had no issues with TDLib 1.8.26 x64. Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at td.ClientManager.execute(unique_ptrtd::td_api::Object* , unique_ptrtd::td_api::Function* ) at Telegram.Td.Client.Execute(Function function) at TdExample.Example.Main()

static void Main()
        {
            // disable TDLib log
            Td.Client.Execute(new TdApi.SetLogVerbosityLevel(0));
            if (Td.Client.Execute(new TdApi.SetLogStream(new TdApi.LogStreamFile("tdlib.log", 1 << 27, false))) is TdApi.Error)
            {
                throw new System.IO.IOException("Write access to the current directory is required");
            }
            new Thread(() =>
            {
                Thread.CurrentThread.IsBackground = true;
                Td.Client.Run();
            }).Start();
...

Windows Server 2022 Datacenter Azure Edition Version OS Build 20348.2966

Related to https://github.com/tdlib/td/issues/1038

georgii01 avatar Jan 15 '25 20:01 georgii01

See https://github.com/tdlib/td/issues/3202.

levlam avatar Jan 16 '25 05:01 levlam