Determining Revit crash reason

Determining Revit crash reason

vbondar
Explorer Explorer
1,940 Views
8 Replies
Message 1 of 9

Determining Revit crash reason

vbondar
Explorer
Explorer

We have an issue with crashing Revit on startup after the installation of our plugin (after deinstall Revit works well again). We cannot see any entries with our plugin loading in the log files that are created by Revit. It can be reproduced only for one particular user. Are there other places where you can determine the reasons for the crash of Revit besides the logs?

0 Likes
Accepted solutions (1)
1,941 Views
8 Replies
Replies (8)
Message 2 of 9

jeremy_tammik
Alumni
Alumni

I am not aware of anything except the log and journal files. Your add-in can add entries to the journal file as well, you know. Also, you can equip your add-in with logging messages and save them to disk before it crashes. Can you run your add-in in the debugger on the customer machine? I also asked the devteam for further advice for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 9

vbondar
Explorer
Explorer
Thanks, Jeremy. We are starting writing our own logs to disk at the start of OnStartup and it is not working. So it seems like the reason can be even before it. For now, we have no ability to debug on the customer machine. If we cannot find other ways in determining the reason we will start a discussion about debugging with the customer (I think some legal things should be clarified in such cases in our company).
0 Likes
Message 4 of 9

jeremy_tammik
Alumni
Alumni

Devteam suggestion:

 

Could it be that the system is missing some prerequisites that the add-on needs? Maybe they can use Dependency Walker? There might also be some clues in the Event Viewer > Windows Application logs.
  
Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 9

vbondar
Explorer
Explorer
Thank you for devteam suggestion. We are putting all prerequisites in our installer. So I think we should ask to get logs from Event Viewer for now. Also, we tried to request Revit dump by creating a specific registry entry (https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps) but it is not working for this specific user - I think we should provide a more detailed guide on how to create such a dump and try one more time.

I noticed that sometimes Revit creates a dump file along with the log files - but this does not always happen. Are there any rules for creating such dump files?
0 Likes
Message 6 of 9

jeremy_tammik
Alumni
Alumni

I am not aware of any way to request a dump file from Revit, so I asked the devteam once again.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 7 of 9

vbondar4AC5Q
Observer
Observer
The user with the current issue created a dump file on Revit crush by enabling collecting User-Mode Dumps for Revit.exe (https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps) and here is some info from there (Debug with Mixed):
- module version: 21.01.50.27
- module original location: C:\Program Files\Autodesk\Revit 2021\RevitAPIUILink.dll
- Unhandled exception code: 0x80131623
- CLR version: 4.8.4420.0
- OS version: 10.0.19043

But since API users have no PDB files for Revit debugging, I cannot see the core issue. Is it possible to somehow find out the reason for the crash by providing this dump file and logs (where there are no lines about our plugin) to Autodesk?

Please note that we created a dump file ourselves (via the method described at the start of this comment) since we didn't find any in the Revit journal folder.
0 Likes
Message 8 of 9

jeremy_tammik
Alumni
Alumni

Passed it on to the devteam for you...

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 9 of 9

vbondar
Explorer
Explorer
Accepted solution

I apologize for my long absence. The reason for it was due to the environment variable COR_ENABLE_PROFILING (link - https://learn.microsoft.com/en-us/dotnet/framework/unmanaged-api/profiling/setting-up-a-profiling-en...) being set to 1, and the plugin being obfuscated with anti-debug options. Windows attempted to profile something, but it was unable to do so because of the obfuscation. This resulted in Revit crashing, possibly due to the inclusion of the obfuscated dll in RevitAPIUILink.dll.

vbondar_0-1686059572345.png