Application crashed (Windows)

Royal Render checks the exit code of an application.
A successful execution should return code 0.


It looks like this at the end of a render log file:


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

++  Jun 17. 01:12.13  Render executable closed    ++++++++++++++++++++++++++++++++++++++++++++++++++++

++  Royal Render checks the return code of the executable or the OS    +++++++++++++++++++++++++++++++

++  Executable returned -1073740771 (0xc000041d) as exit code for frame 601 (jobthread 0).    ++++++++

++  => Executable crashed    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



There are two types of exit codes:

1) Application specific
They are usually within the range -100 to 100. (but this does not mean that such codes are not created by the OS as well)
If an application recognizes an error, it usually prints an error message and exits.
Some applications return an exit code in this case as well.
Some applications do NOT print an error, but return an exit code. 

Some applications provide a list of exit codes and the error that created this specific code.
(see for example rrHelp section 3dsmax. It returns an exit code without error message and you have to take a look at their exit code table)



2) OS specific 

They can have any range.
On windows, large negative numbers (as in the example above) are definitely OS specific.
The application or a plugin of the application has a bug and Windows terminated the application.

Usually there is not a lot you can do about it.
Beside reporting the bug or trying not to use some feature or object.
If you want to find out which object is reponsible, you should do a scene breakdown.



Windows Only:

On Windows, it might be possible to find out which library/plugin/application part is responsible for a crash.

This might help you to find out which object is responsible.
This can be done by analysing Crash Dump files with Visual Studio.
The vendor (developer) of the application might even be able to find the exact source location with the help of the dump file.
(Autodesk even provides symbol files to 3rd party members of their Development Network that can be used to find the function name that is responsible for the crash).


Please open the rrWorkstationInstaller on  ONE  machine.

Use the menu "Special" to enable windows crash dump files.

Send a scene that will crash.

Perhaps a scene that does not use a lot of RAM as the dump files might get that big as well. 

Open the folder C:\\CrashDumps and check if there is a crash dump file after a render has crashed.

Open the dump file in Visual Studio and run it (play button).

Open the window Stack Trace and check it top to bottom.
The top function is the one that crashed, the second is the function that called it.
As you are probably not able to view the function names, you have to look at the name of the library/DLL file.
The name might indicate which feature is responsible for the issue.



Module not found (Windows)

If you get this error message, then the render app was unable to load a plugin/.dll library because that plugin requires an other dll library file.

You can use the tool Dependency Walker 64bit to check which libraries the plugin requires.

When checking the missing libraries, do not forget to check the folder of the render app executable. As these libraries are found at render time, but not by the Dependency Walker.


Example Redshift for Maya:

  • Download and extract the Dependency Walker 64 to any folder and start it.
  • Open the file 
    c:\ProgramData\Redshift\Plugins\Maya\2020\nt-x86-64\redshift4maya.mll
  • Wait and wait even more until it has finished processing the file and displays some information.
  • Right-click in the top left window and choose "Collapse All"
  • Then click on the [+] to expand the first level.
    Now you can see which DLLs are missing for this DLL:

                                           



  • The application "Maya" (which loads the Redshift plugin) has DLLs within the folder of the Maya executable.
    These DLLs are automatically found at run-time. (And as you can see some DLLs have Maya in their name)
    Dependency Walker does not know that.
    Therefore you have to add the path of the Maya executable.
    Click on menu Options / Configure Module Search Order...
    At the bottom, browse to the path 
    c:\Program Files\Autodesk\Maya2020\bin\
    and press "Add Directory"
  • Press OK.

  • Back in the main window, right-click in the top left window and choose "Collapse All"
  • Then click on the [+] to expand the first level.

  • An other missing DLL is named REDSHIFT-CORE....
    The same suggest it is part of Redshift and a quick search finds the file in \Redshift\bin\
    Which means that this folder has to be added the PATH env var at run-time.

    In this example case with "Redshift", RR should add this folder to the PATH if you use for example RRs farm-wide install for Redshift.
    Please see the rrHelp section of your render app (Maya, Houdini, C4D, ..) for Redshift notes.

  • The last missing DLL is ADSKXGEN. Which is "AutoDeSK XGen".
    Which *should* be found if the Xgen module is loaded into Maya.



Note:

In most cases the DLLs named "MSVCP...", "VCRUNTIME..." had been missing.
They are installed by the "MS Visual Studio Redistributable package x64". 
There are installers which install a range of DLLs for all Visual Studio versions.
For example the "Microsoft Visual C++ 2022 Redistributable Package (x64)" installer should state that it will install libraries for VS 2015-2022.