Opened 18 months ago

Last modified 7 days ago

#14497 pending defect (fixed)

BACKENDS: PSP: Crash on Start since 2.7.0

Reported by: Wolve-Chen Owned by: lephilousophe
Priority: high Component: Port: PSP
Version: Keywords: crash on start
Cc: Game:

Description (last modified by Wolve-Chen)

ScummVM version: 2.7.0 Stable and 2.8.0 20230606 Daily

Bug details: ScummVM doesn't start, crashes on start.

Your OS:
Sony Playstation Portable
Build: 1005 1st GEN white
OS: 6.61 LME-2.3
CPU/RAM: 333MHz/333MHz

The 2.2.0 version of ScummVM worked perfectly.

Deleted it completely. Also scummvm.ini and the Saves folder on ms0:
Copied 2.7.0 into the PSP/GAME folder and treid to start. Screen went black and after a couple seconds I landed back on the desktop(of the PSP). There seems to be a change in 2.7.0, that the PHAT PSP can't handle.

Change History (15)

comment:1 by Wolve-Chen, 18 months ago

Description: modified (diff)

comment:2 by lephilousophe, 18 months ago

Could you try with 2.6.1 instead? 2.2 is a really old version.
https://downloads.scummvm.org/frs/scummvm/2.6.1/scummvm-2.6.1-psp.zip

comment:3 by lotharsm, 17 months ago

Summary: PSP Crash on Start since 2.7.0BACKENDS: PSP: Crash on Start since 2.7.0

comment:4 by Wolve-Chen, 17 months ago

I tried the 2.6.1 and it starts.
Mass adding Games worked, too.
The 2.6.1 seems to be the last working version for the PHAT PSP 1005 with 6.61 LME-2.3.
The changes made in 2.7.0 crash ScummVM on the PSP.

comment:5 by Wolve-Chen, 17 months ago

Monkey Island 2 starts, Larry Leisure Suite 7 does not (crashes back to PSP Menu).

comment:6 by rsn8887, 16 months ago

I tested both 2.7.0 and 2.7.1 on my real hardware PSP slim and they work fine.

It could be a problem due to PSP phat hardware having less RAM? I don’t have a phat model to test.

comment:7 by rsn8887, 16 months ago

According to ccawley’s tests this might be due to loading from fonts.dat. In future versions, it might help to allow a smaller fonts-small.dat to reduce memory footprint on machines with less than 64MB RAM.

comment:8 by sev-, 12 months ago

Would be nice to get fixed before 2.8.0 release.

I will work on adding fonts-small.dat, and then the relevant ports use that instead of fonts.dat

comment:9 by rsn8887, 9 months ago

I can confirm this bug is still present with 2.8.0 release. PSP 1000 crashes on start, PSP 2000/3000 works fine. This can be even tested with the emulator PPSSPP (you can set the PSP Model in the settings to 1000).

comment:10 by rsn8887, 9 months ago

If I configure and build ScummVM with --enable-detection-dynamic, ScummVM starts on the emulated PSP 1000 and allows me to add games. However, when I start a game, it says "Could not find any engine capable of running the selected game."

It seems to me that
a) this is a memory issue
b) on PSP, --enable-detection-dynamic seems to be incompatible with the engine plugins themselves, in the sense that ScummVM always reports it could not find any capable engine. Normally, PSP builds are done without the --enable-detection-dynamic flag, that's why I never saw this incompatibility before.

Last edited 9 months ago by rsn8887 (previous) (diff)

comment:11 by rsn8887, 9 months ago

The "could not find any engine capable of running the selected game." error that appears on PSP (1000, 2000 and 3000) when I use --enable-detection-dynamic seems to be due to an out of memory:

"
elfloader: open("plugins/SCUMM.PLG")
elfloader: plugins/SCUMM.PLG found!
elfloader: phoff = 52, phentsz = 32, phnum = 2
elfloader: Loading segment 0
elfloader: offs = 80, filesz = 1f0d34, memsz = 1f12dc, align = 80
failed to find space to allocate 2036444 bytes
WARNING: elfloader: Out of memory.!
WARNING: elfloader: Failed loading plugin 'plugins/SCUMM.PLG'!
elfloader: open("plugins/SCUMM.PLG")
elfloader: plugins/SCUMM.PLG found!
elfloader: phoff = 52, phentsz = 32, phnum = 2
elfloader: Loading segment 0
elfloader: offs = 80, filesz = 1f0d34, memsz = 1f12dc, align = 80
failed to find space to allocate 2036444 bytes
WARNING: elfloader: Out of memory.!
WARNING: elfloader: Failed loading plugin 'plugins/SCUMM.PLG'!
MetaEngine: SCUMM [v0-v6 games, v7 & v8 games] couldn't find a match for an engine plugin.
punycode_decode: returning ms0<U+0081>º
Adding Gui Object 0x9ba7340 to trash
Delayed deletion of Gui Object 0x9ba7340
ELFMemoryManager: freed 7047644 bytes at 0x9229400. Total 0 bytes
elfloader: Deleting shorts segment from 0x0 to 0x0.
"

If I don't use --enable-detection-dynamic, on PSP 2000/3000, there's no out of memory (PSP 1000 crashes on startup of ScummVM in this case):
"
elfloader: open("plugins/SCUMM.PLG")
elfloader: plugins/SCUMM.PLG found!
elfloader: phoff = 52, phentsz = 32, phnum = 2
elfloader: Loading segment 0
elfloader: offs = 80, filesz = 1f0d34, memsz = 1f12dc, align = 80
ELFMemoryManager: allocated 2036444 bytes at 0x9911500. Total 2036444 bytes
elfloader: Allocated segment @ 0x9911500
elfloader: Setting 0x9b02234 to 0x9b027dc to 0 for bss
elfloader: Reading the segment into memory
elfloader: Segment has been read into memory
elfloader: Loading segment 1
elfloader: offs = 1f0db4, filesz = 0, memsz = 0, align = 80
elfloader: Shorts segment size 0 allocated. End = 0x0. Remaining space = 98b5fc0. Highest so far is 0x9cd7d20.
elfloader: Shorts segment @ 0x0 to 0x0. Segment wants to be at 0. Offset=0
elfloader: Reading the segment into memory
elfloader: Segment has been read into memory
elfloader: Symbol section at section 13, size 270e0
elfloader: Loaded 9998 symbols.
elfloader: Loaded relocation table. 52354 entries. base address=0x9911500
elfloader: R_MIPS_HI16: i=0, offset=c0, ahl = 1a0000, target = 3c02001a
"
(...) the game loads and starts in this case.

It might be that the memory footprint of ScummVM has just grown too large for PSP1000, which only has 32MB RAM.

Last edited 9 months ago by rsn8887 (previous) (diff)

comment:12 by rsn8887, 9 months ago

If I delete all themes .zip files, I can get the 2.8.0 release to start on (emulated) PSP 1000. It starts with the ugly builtin theme, which has less memory footprint than the remastered theme. However, as soon as I try to add a game, it crashes again due to out of memory.

Last edited 9 months ago by rsn8887 (previous) (diff)

comment:13 by rsn8887, 9 months ago

Compiling ScummVM with only few engines and using _detection_full=no significantly shrinks the executable and reduces the memory footprint. I just compiled with only Scumm engine and now I can play Full Throttle even on the PSP 1000 and with scummremastered theme without crashes.

Using _detection_full=no, the executable shrank from 17 MB to 10 MB when including only the scumm engine.

But that probably doesn't help for a full release with all the stable engines.

comment:14 by tag2015, 8 months ago

As reported in #15017 this is still an issue in 2.8.1

comment:15 by lephilousophe, 7 days ago

Owner: set to lephilousophe
Resolution: fixed
Status: newpending

This would need a new test on master, now that the detection plugin is unloaded before loading an engine plugin.

Note: See TracTickets for help on using tickets.