WriteRest: op out of range when using JIT or JITIL

Bug #1722129 reported by carlix
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
dolphin-emu (Ubuntu)
Fix Released
Undecided
Unassigned
Artful
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
dolphin-emu crashes when attemping to play any game. This makes the package almost unusable.

dolphin-emu 5.0 does not function correctly when built with PIE enabled because the JIT compiler relies on the location of various code which is loaded at the wrong place if PIE is enabled. The package contains a DEB_BUILD_MAINT_OPTIONS option to disable PIE. Unfortunately dpkg from zesty contained a bug which ignores this option (#1576915). The bug was fixed in artful, but since dolphin-emu was not rebuilt in artful, the bug occurs there as well.

[Test Case]
Download the Jewels ROM from this page:
http://wiibrew.org/wiki/Jewels

Extract the download to get a ".dol" binary.

Open dolphin-emu and attempt to run it.

The game should start, possibly with some warnings. It should not print the most common PIE error: "WriteRest: op out of range".

[Regression Potential]
The only reverse dependency of dolphin-emu is the games-emulator metapackage.

Applying the glibc patch may have some side effect not found during testing. I think this is unlikely because the patch is relatively simple (renaming all occurences of a few constants).

[Other Info]
The debdiff for artful contains a patch to fix a FTBFS with glibc 2.26 which is required to be able to rebuild dolphin-emu in artful.

The above patch is not yet included in bionic, but I have fixed it in Debian in 5.0+dfsg-2 so it should be fixed there as soon as bionic opens for development and it's synced from Debian.

[Original Description]
I'm using Dolphin 5.0 on Linux. Worked great until recently, when an update apparently broke JIT support. With it enabled, the error message 'WriteRest: op out of range' <0x### uses ####>' appears and the game won't start. Using anything but JIT still works, but is obviously slower.

Revision history for this message
James Cowgill (jcowgill) wrote :

Which Ubuntu release are you using?

Which exact version of dolphin-emu are you using? Please give the output of this command:
$ dpkg -l dolphin-emu

Also, the version numbers in the dolphin-emu about box would help.

Which game are you tring to run?

Changed in dolphin-emu (Ubuntu):
status: New → Incomplete
Revision history for this message
carlix (carlixlinux) wrote :

Ubuntu 17.10

dolphin-emu 5.0+dfsg-1bu amd64 Gamecube and Wii emulator

I tried Super Mario Sunshine, this link could be helpful: https://www.reddit.com/r/DolphinEmulator/comments/5a5pph/writerest_op_out_of_range_when_using_jit_or_jitil/

Revision history for this message
James Cowgill (jcowgill) wrote :

*sighs heavily at Ubuntu*

Thanks for the link! It does explain this nicely and I can reproduce the issue here. I didn't notice it because I primarily use Debian and the bug is not present there.

As the thread on reddit says, the bug happens because dolphin-emu is compiled with PIE when it shuold not be. I put this at the top of the build script which should have disabled PIE:

 # dolphin does not work with -fPIE
 export DEB_BUILD_MAINT_OPTIONS := hardening=+all,-pie

This works on Debian, but apparently Ubuntu ignores it. I'll see what I can do to fix this.

Changed in dolphin-emu (Ubuntu):
assignee: nobody → James Cowgill (jcowgill)
status: Incomplete → Confirmed
Revision history for this message
James Cowgill (jcowgill) wrote :
description: updated
Changed in dolphin-emu (Ubuntu):
assignee: James Cowgill (jcowgill) → nobody
Simon Quigley (tsimonq2)
Changed in dolphin-emu (Ubuntu Artful):
status: New → Confirmed
Changed in dolphin-emu (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Simon Quigley (tsimonq2) wrote :

Oh, since I didn't say it before, I uploaded it yesterday.

Thanks!

Revision history for this message
Renan Araujo Rischiotto (renanrischiotto1) wrote :

Please fix this :(

Revision history for this message
carlix (carlixlinux) wrote :

I installed dolphin-emu today (09/11/17) and the problem still persist https://s1.postimg.org/38vwtvmuof/Captura_de_pantalla_de_2017-11-09_11-19-33.png

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello carlix, or anyone else affected,

Accepted dolphin-emu into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/dolphin-emu/5.0+dfsg-1ubuntu0.17.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in dolphin-emu (Ubuntu Artful):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-artful
Revision history for this message
carlix (carlixlinux) wrote :

I installed dolphin-emu 5.0 from the proposed repository and now it works perfectly, I can play Super Mario Sunshine now, thanks a lot for your help!!!

tags: added: verification-done-artful
removed: verification-needed verification-needed-artful
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dolphin-emu - 5.0+dfsg-1ubuntu0.17.10.1

---------------
dolphin-emu (5.0+dfsg-1ubuntu0.17.10.1) artful; urgency=medium

  * Apply upstream patch to fix FTBFS with glibc 2.26.
  * Rebuild package with more recent dpkg to disable PIE. (LP: #1722129)

 -- James Cowgill <email address hidden> Sat, 04 Nov 2017 15:53:30 -0500

Changed in dolphin-emu (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for dolphin-emu has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.