Failure to catch unhandled exception when attached to UE5 process.

When I attempt to debug my running UE5 project by attaching to the process my breakpoints work correctly however Rider doesn't catch unhandled exceptions and just detaches from the process. If I launch the project with the Debug button in Rider then it catches the same exceptions just fine. I've tried this on multiple machines running windows 10 and 11 and the result is the same. Is this just a limitation or do I have something misconfigured? Thanks!

0
5 comments

Hello John,

Thank you for contacting Rider support. That sounds weird.

I would appreciate it if you could share additional information as described below:

  • Go to Help | Diagnostic tools | Choose Trace Scenarios;
  • Enable the trace scenario for Debugger;
  • Reproduce the issue;
  • Collect the full log bundle via Help | Collect Logs and Diagnostic Data;
  • Disable the trace scenarios enabled;
  • Share a screenshot of the code snippet that throws the exception; Is it in your game code or is it some UCommandlet by chance?
  • If possible, share a project (so that we could quickly reproduce the same scenario)
  • Upload the resulting files to our server and share the upload ID.

Have a nice day!

0

Ok I've uploaded the logs and a simple test project to reproduce the issue. 2025_04_17_28vqgp4NFgAKeBaZyyrgtQ 

The project was made with UE 5.5.4.

Steps to reproduce:
1. Open project to DebugMap
2. Choose Play in Standalone.
3. Quickly switch to the UProject open in Rider and attach to the standalone game.
4. Rider will successfully attach but then the UE Crash reporter will come up and Rider will automatically detach.

 

0

Hello John,

The debugger requires time to attach, so it seems this is just a timing issue. It attaches later than the exception is thrown, so the game instance is about to terminate, when debugger tries attaching to it. There are the available options you might want to try:

  • Obviously, you can debug your game by launching Unreal Editor directly from Rider via Debug button. It will not work for debugging Standalone game, but work good for debugging game in Viewport (default way of running the game in Unreal editor);
  • The next option is to use the “Child Process Debugging” feature (File | Settings | Build, Execution, Deployment | Debugger). If you enable it and run Unreal Editor via “Debug”, Rider can attach the debugger to the Standalone game you launch by itself (avoiding manual “Attach to process” steps). Upon ticking this option, be sure to configure settings file. There is an instruction inside. The below sample config worked out for me:
    <DefaultRule attach="false"/>
    <Rule processName="part_of_path*/my_app*" commandLine="-arg1" attach="false"/>
    <Rule processName="UnrealEditor" attach="true"/>
  • The last and the most accurate option for debugging the Standalone Game is to make a dedicated Run Configuration for that: 
    • Go Run | Edit Configurations;
    • Add ('+') a “Native Executable” run configuration;
    • Set “Exe path:” to C:/YourPathToEngineRoot/Engine/Binaries/Win64/UnrealEditor.exe;
    • Set “Program arguments:” to "C:\PathToYour\DebugTest.uproject" /Game/DebugMap -game -PIEVIACONSOLE -Multiprocess GameUserSettingsINI="PIEGameUserSettings0" -MultiprocessSaveConfig -forcepassthrough -messaging -SessionName="Play in Standalone Game" -windowed -ResX=1280 -ResY=720`;
    • Set “Working directory: ” to C:/YourPathToEngineRoot;
    • Remove the “Build solution” Before launch step and add “Build project ‘GameProject’” instead;
    • Apply the changes. 
    • Now you can launch debugging of Standalone game in a single click; (selecting the configuration from the toolbar in top-right corner → click “Debug”)

Hope it helps. Tell me if there is anything else I can assist you with.

Have a nice day!

0

Hi Dmitry,

Thanks for the reply. The child process debugging looks like a decent solution for now. However I don't think its a timing issue. I've modified the test project (2025_04_30_3Sf37sgT7zg2ckLgYhzZbD) to wait 10 seconds before causing the exception and it still just automatically detaches. 

0

Hello John,

Thank you for the clarification and for all the details shared! I suppose you are right, there is an issue. I registered this issue on our tracker: RIDER-126277 LLDB doesn't catch an unhandled exception upon "Attach to process".

Feel free to upvote it to demonstrate your interest.

Should you have any other questions or difficulties, please tell me. Have a nice day!

0

Please sign in to leave a comment.