Fledge68 / WiiFlow_Lite

My mod of the Wii USB Loader WiiFlow
470 stars 58 forks source link

Crash if the end of USB2 partition passes 2TB mark #210

Closed kccricket closed 3 years ago

kccricket commented 4 years ago

Running WiiFlow Lite 5.4.7 beta 6 on an original Wii. With a USB HDD containing multiple partitions, WiifLow will crash if the end of the second partition is beyond the 2TB mark on the drive. I can reproduce the crash by accessing USB2, either by switching to the game menu assigned to USB2 or by navigating to USB2 in the WiiFlow file browser. The crash would sometimes display a stack dump or briefly display the animated WiiFlow loader image before it's quickly replaced with static (a stack overflow overwriting the image in memory?).

My setup is a 3TB HDD. USB1 partition was FAT32 1.75TB. USB2 partition was FAT32 approximately 1TB. WiiFlow would not crash if USB2 was recreated as smaller than 250GB (small enough that the end was under the drive's 2TB mark).

Log file sample from when I was running 5.4.6, but I can reproduce on 5.4.7 beta 6. It's interesting to note that the log identifies the drive as 2TB.

Welcome to WiiFlow WFL 5.4.6!
This is the debug output.
Real Wii
AHBPROT disabled = yes
patched isfs_permissions 1 times.
patched es_setuid 1 times.
patched es_identify 1 times.
patched hash_check 0 times.
patched new_hash_check 1 times.
Init ISFS
Found WiiFlow Save
Using Port Settings from wiiflow save
Deinit ISFS
AHBPROT disabled after IOS Reload: yes
patched isfs_permissions 0 times.
Init ISFS
D2X IOS249[56] v10
FAT Partition at sd: mounted.
Changing USB port to port 0....
 * * * * * * * * * * * *
 * HDD Information
 * Sectors: 4294967295
 * Size [Sector Size]: 1.924 TB [512]
 * * * * * * * * * * * *
FAT Partition at usb1: mounted.
FAT Partition at usb2: mounted.
Running sound thread
Wiiflow boot.dol Location: sd:/apps/wiiflow
Data Directory: sd:/wiiflow
Wii Games Directory: %s:/wbfs
kccricket commented 4 years ago

IMG_8041

Fledge68 commented 4 years ago

mbr or gpt?

kccricket commented 4 years ago

GPT.

Fledge68 commented 4 years ago

so if i post some test dols would you be able to test them? do you still have that hard drive setup?

kccricket commented 4 years ago

Yep. Drive is ready to go. Can reproduce crash consistently by using the file explorer feature.

I can't decide if your dedication to this program is admirable or insane. 💯

Fledge68 commented 4 years ago

i would love to fix this but 2 things prevent it.

  1. hardly any free time for coding these days.
  2. my lack of understanding gpt drives and partitioning.

i looked at the code and some things looked wrong but that could be my lack of gpt expertise. in your debug log the hdd information you said is wrong. I see where wiiflow code uses either the IOS or libogc to get the size of disk and sector size. the ios and libogc i cannot fix.

so in the end you basically need to convert your drive to mbr. i've seen users on gbatemp explaining that its possible and how to do it. remember the wii is old and outdated. always stick to FAT32 and MBR.

Fledge68 commented 4 years ago

just happen to stumble on this today.

instructions for converting 3TB+ drives to FAT32 MBR https://gbatemp.net/threads/usb-loader-gx.149922/page-1129#post-6662953