libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
9.86k stars 1.78k forks source link

SWITCH: NES Headerless roms crash the OS #9621

Open Scorpeg opened 4 years ago

Scorpeg commented 4 years ago

Unfortunately I do not know, if this is a Retroarch or core bug (but I suppose Retroarch, as it is same for all cores). From what I see in Atmosphere logs crash occurs in bsdsocket, so it seems Retroarch tries to connect to some online database to get a header and crashes. I tried to run with wireless enabled and disabled - same.

Description

Basically Retroarch crashes whole system, if you try to load headerless NES rom. Atmosphere crash report: https://gist.github.com/Scorpeg/f676adcb291c57c31aeee6760eb3cafb

Expected behavior

Game should work or show some human-readable error if not possible to run.

Actual behavior

System crashes

Steps to reproduce the bug

  1. Get any headerless rom
  2. Load content and run
  3. Crash

Version/Commit

Oct 7 2019/4dcd7a0

Environment information

negativeExponent commented 4 years ago

which core? in any case this should be on whichever core is having this problem (only Mesen supports headerless) which should allow graceful exit when it cannot load the rom.

RobLoach commented 4 years ago

In addition, what is the CRC of the rom you're trying to load?

Scorpeg commented 4 years ago

which core? in any case this should be on whichever core is having this problem (only Mesen supports headerless) which should allow graceful exit when it cannot load the rom.

Everything is in first post - it occurs in every NES core available in Switch build. Mesen is not available there, only FCEUMM, Nestopia UE and QuickNES and they all crash. This is why I suppose it is retroarch bug and not core bug (as all these cores on other systems just show "Failed to load content"). Maybe they do some search in libretro db first for some reason or trying to load assets, idk... But crash occurs in Switch core bsdsocket, which is generally related to network access.

In addition, what is the CRC of the rom you're trying to load?

Absolutely any rom without header. For example this one https://datomatic.no-intro.org/index.php?page=show_record&s=45&n=1435 but any other headerless rom have same crash effect. Binary same rom, but with 16 byte NES header works normally.