REVCLOUD command crashes AutoCAD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am investigating an access violation that crashes AutoCAD when issuing REVCLOUD command in a drawing where our C# plugin is listening to command and object add/modify/remove events. The crash occurs immediately after I press enter after having typed the command.
The code executed by our listener callbacks just before the crash does not seem to do much anything, certainly nothing suspicious, and most of it unrelated to AutoCAD API (e.g. logging the event). Of course there is plenty of things that have been done before that point, i.e. before the REVCLOUD command is issued.
The crash does not occur on AutoCAD 2020 or older, but does for at least AutoCAD 2021 and AutoCAD 2024.
I am suspecting there is something our code does wrong along the way (e.g. failing to Dispose something that needs to be disposed) but it only manifests later and only with newer AutoCAD versions.
The crash is very reproducible, i.e. happens every time when using REVCLOUD in a drawing where the event listeners are active. However, in the same AutoCAD process for a drawing without the event listeners the REVCLOUD command works fine.
Here's the stack trace at the time of the crash, obtained using WinDBG:
[0x0] acdb24!AcDbDatabase::tilemode 0x5dfe7ff188 0x7ffdbb41a0b2
[0x1] acrevcloud+0xa0b2 0x5dfe7ff190 0x7ffdbb419518
[0x2] acrevcloud+0x9518 0x5dfe7ff2c0 0x7ffdbb41965a
[0x3] acrevcloud+0x965a 0x5dfe7ff320 0x7ffdbb41f0a8
[0x4] acrevcloud+0xf0a8 0x5dfe7ff3c0 0x7ffcedcbb889
[0x5] accore!AcApDocImpManager::unlockCurDocument+0xb75 0x5dfe7ff6f0 0x7ffcedcb990e
[0x6] accore!acedInitCommandVersion+0x562 0x5dfe7ff7c0 0x7ffcedcb9636
[0x7] accore!acedInitCommandVersion+0x28a 0x5dfe7ff870 0x7ffcedcafaf1
[0x8] accore!AcApAppImp::GetSDIMode+0xab5 0x5dfe7ff8e0 0x7ffcedd07050
[0x9] accore!CCmdThroat::Run+0x118 0x5dfe7ffc70 0x7ffcedd07cba
[0xa] accore!AcApAppImp::run+0x52 0x5dfe7ffd10 0x7ffcedd07c79
[0xb] accore!AcApAppImp::run+0x11 0x5dfe7ffd40 0x7ff615a4ac65
[0xc] acad!AcMenuIconLibrary::CommandCache+0x669d 0x5dfe7ffd70 0x7ffe52cf2bf0
[0xd] mfc140u!AfxWinMain+0xc0 0x5dfe7ffde0 0x7ff615a9b73e
[0xe] acad!AcLineThumbnail::operator=+0xb45e 0x5dfe7ffe20 0x7ffe7ce0e8d7
[0xf] KERNEL32!BaseThreadInitThunk+0x17 0x5dfe7ffe60 0x7ffe7df514fc
[0x10] ntdll!RtlUserThreadStart+0x2c 0x5dfe7ffe90 0x0
Any ideas on how to investigate this problem are greatly appreciated.