Project

General

Profile

Actions

Emulator Issues #9751

open

Rust's MIR Backend produces code that Dolphin's JIT can't handle

Added by CryZe92 over 8 years ago. Updated over 8 years ago.

Status:
Accepted
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name?

The Legend of Zelda: The Wind Waker

Game ID? (right click the game in the game list, properties, info tab)

GZLJ01

MD5 Hash? (right click the game in the game list, properties, info tab, MD5 Hash: Compute)

ee666f417abeb4a91a1b496aa53404e9

What's the problem? Describe what went wrong.

I'm writing Rom Hacks for Wind Waker in Rust and recently updated my compiler to a new Nightly Compiler. The newer versions of Rust use a new intermediate representation called MIR. It turns out that Dolphin's JIT compiler often can't handle the code produced by MIR. I thought it might be because of bugs in MIR, but it turns out that Interpreter Mode works totally fine. So it seems like there are some bugs in Dolphin's JIT compiler.

What steps will reproduce the problem?

You need a fairly recent Nightly Rust compiler to build the project. The project is available here: https://github.com/CryZe/WindWakerBetaQuest/tree/bug-stuff
Make sure to build the branch "bug-stuff". The remaining instructions should be in the repository. Just build the DOL file with make and start the game.
Use Dolphin's Debugger and activate logging OSReport messages and look at the logs. With JIT it should get stuck in an infinite loop of "Recalculate Warp Table", while with Interpreter Mode it doesn't.

Which versions of Dolphin did you test on? Does using an older version of Dolphin solve your issue? If yes, which versions of Dolphin used to work?

5.0-308

What are your PC specifications? (CPU, GPU, Operating System, more)

Doesn't matter.

Is there any other relevant information? (e.g. logs, screenshots,
configuration files)

"Recalculate Warp Table" Spam with JIT active:

Function that causes the bugs:

Here's the Function that crashes. For some reason the second memcmp is executed with the JIT compiler, while it jumps over it with

Actions #1

Updated by CryZe92 over 8 years ago

*Here's the Function that causes the spam. For some reason the second memcmp is executed with the JIT compiler, while it jumps over it with the Interpreter.

Actions #2

Updated by JMC4789 over 8 years ago

  • Status changed from New to Accepted

This has more than enough debug information to accept. Thank you for the issue report.

Actions

Also available in: Atom PDF