Project

General

Profile

Emulator Issues #9135

Wii Menu 4.3U - "The system file are corrupted" screen after changed the disc and select channels.

Added by windows4ya over 3 years ago. Updated over 3 years ago.

Status:
Fixed
Priority:
High
Assignee:
% Done:

0%

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

Description

Game Name?

Wii System Menu 4.3U

What's the problem? Describe what went wrong.

  1. Go to tools > Load Wii System Menu 513E
  2. After The Wii System loaded Select change disc on file menu
  3. Select Wii rom
  4. The game appears on Disc Channel
  5. Try to click on any channels on wii menu then The "The system file are corrupted" screen appears

What steps will reproduce the problem?

Use Dolphin 4.0-8010 or lower

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?

4.0-8012 (4.0-8010 or older solved this issue.)

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

CPU: Intel Celeron B820
GPU: NVIDIA GeForce GT 620M
OS: Windows 8.1 Pro
6GB RAM usable 5.8GB

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

The latest dolphin version make The Internet Channel work again but this "The system file are corrupted" screen issue doesn't solve yet. I've seen this problem 1 month ago. and I stick with dolphin 4.0-8010 for a month now.
Internet Channel doesn't work on 4.0-8010.

Here is a "The system file are corrupted" screen after clicked on any channels on wii menu with disc inserted

This issue doesn't happen if you didn't use change disc option on wii menu.

bug.png (27.4 KB) bug.png windows4ya, 12/04/2015 11:18 AM
5080

Related issues

Has duplicate Emulator - Emulator Issues #9046: Dolphin 4.0-8012 (Pull Request #3139 - Mark which Wii root to use in the NAND path code) crashes Wii System Menu Ver. 2.1EDuplicate

History

#1 Updated by windows4ya over 3 years ago

EDIT:
What steps will reproduce the problem?

Start the wii menu and change disc on Dolphin 4.0-8012 or newer

#2 Updated by JMC4789 over 3 years ago

  • Status changed from New to Accepted
  • Assignee set to JosJuice
  • Priority changed from Normal to High

#3 Updated by JosJuice over 3 years ago

  • Milestone set to Current

#4 Updated by Anonymous over 3 years ago

This is the same sort of problem I was having. - https://bugs.dolphin-emu.org/issues/9046

#5 Updated by JosJuice over 3 years ago

  • Regression changed from No to Yes

#6 Updated by JosJuice over 3 years ago

  • Assignee deleted (JosJuice)

I won't have much time to work on Dolphin for a while, and I'm not the one who made the commit anyway.

#7 Updated by Fog over 3 years ago

I was able to reproduce the steps, but made Dolphin crash instead when selecting a WiiWare title. I will have to try with the Internet Channel to see if the same result happens or not.

Anyways, the crash seems to happen once it hits IOFile::Seek. That's about as far I got yesterday, but perhaps someone could look into it from there.

#9 Updated by BhaaL over 3 years ago

I can reproduce this on 450P (should be 4.1 Europe) when right-clicking a game, then selecting "Change Disc".
However, for me Dolphin crashes as a whole instead of showing the "system files are corrupt" message.

m_data is not empty(), as the check indicates, so it does the memcpy. Which looks like a bad idea from there:
m_data = { size=1125917086973956 }

#10 Updated by BhaaL over 3 years ago

Reverting the unique_ptr part of c22d1d6 (which sadly wasn't its own commit =/) fixes the issue. I suspect something is going out of scope, causing the CNANDContentLoader to be free'd while we still want to use it.

#11 Updated by BhaaL over 3 years ago

Commenting out this call to CNANDContentManager::ClearCache fixes the crash, but thats rather random to simply remove it (I hope @comex had a reason to put it there).
When changing disc, it is being called twice (before the banner changes to the inserted disc), causing those accesses to get free'd memory instead.
CWII_IPC_HLE_Device_es::OpenInternal is breaking the tracking capabilities of unique_ptr, since we store the raw pointer there, with a different life time than the map in CNANDContentManager.

#12 Updated by BhaaL over 3 years ago

Since I don't want this to get lost, dumping it on here:

-19:59:14- [Fog_TAS] as for that clearcache line
-19:59:46- [Fog_TAS] CNANDContentLoader reads title.tmd and caches data from it, ES_DIVerify writes to title.tmd
-20:00:02- [Fog_TAS] paraphrasing here

So: clearing the cache on DI_Verify makes sense, altho the side-effect of things crashing isn't necessarily what we want.

About the else of that block (with the failing memcpy):

-20:05:01- [comex] ok, let me actually look at this code properly
-20:05:16- [comex] you probably found it, but the commit was 04c41c1d3
-20:06:07- [comex] oh, i see, it's for wads
-20:06:21- [comex] specifically, loading them without extracting them first
-20:06:27- [comex] look at CNANDContentLoader::InitializeContentEntries
-20:07:19- [comex] the code seems wrong if the content is actually empty (0 bytes) though

So, it is likely that we still need that else, but exploding on clear (due to accessing of free'd memory) combined with the last mention (it being wrong for empty contents; regardless of whether that can ever be) strongly suggests we should think this over.

If I had to write up some sort of plan, I'd first try to get rid of the m_pContentLoader reference (and along that, the m_NANDContent cache that has its redundancy note above CWII_IPC_HLE_Device_es::AccessContentDevice for quite some time). As requirement for that, SContentAccess.m_pContent needs to go too, with some replacement for m_Size/m_Index (which are state-saved) and m_Data (which is the key in all this). The latter is responsible for the crashes we see in here, and the tricky part is loading it at the right time while keeping it in memory unnecessarily.
Perhaps CNANDContentLoader::InitializeContentEntries can be delayed and/or in-time resolved when this sort of access happens, or be wrapped in something like IOFile so we don't have to distinguish this case.

#13 Updated by JosJuice over 3 years ago

  • Has duplicate Emulator Issues #9046: Dolphin 4.0-8012 (Pull Request #3139 - Mark which Wii root to use in the NAND path code) crashes Wii System Menu Ver. 2.1E added

#14 Updated by Fog over 3 years ago

  • Status changed from Accepted to Fix pending
  • Assignee set to BhaaL

#15 Updated by Fog over 3 years ago

  • Status changed from Fix pending to Fixed

Merged in latest master.

Also available in: Atom PDF