Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing while running Luadev r0 (lua interpreter) #19085

Open
5 tasks done
BrownNPC opened this issue Apr 22, 2024 · 17 comments
Open
5 tasks done

Crashing while running Luadev r0 (lua interpreter) #19085

BrownNPC opened this issue Apr 22, 2024 · 17 comments
Labels
Homebrew Issues only noticed in homebrew apps PGF / sceFont Issue involves PGF fonts.
Milestone

Comments

@BrownNPC
Copy link

BrownNPC commented Apr 22, 2024

Game or games this happens in

Luadev r0 (lua interpreter)

What area of the game / PPSSPP

PPSSPP no longer supports this old homebrew lua interpreter
It used to work on version 1.9.3
and it does work on jpcsp.

How to reproduce:

git clone https://github.com/jcnmsg/luadev-r0-psp.git
mkdir ./luadev-r0-psp/projects/hello-world-test
cp ./luadev-r0-psp/EBOOT.PBP ./luadev-r0-psp/projects/hello-world-test/

create a file script.lua in ./luadev-r0-psp/projects/hello-world-test/

blue = color.new(0,0,255) 
white = color.new(255, 255, 255)
black = color.new(0, 0, 0)
 
screen.print(10, 10, "Hello world!" , 0.6, blue, blue)
screen.print(10, 26, "This is my first program and it runs on the PSP!" , 0.4, white, black)
 
screen.flip()
 
while true do
    screen.waitvblankstart()
end

start EBOOT.PBP in ./luadev-r0-psp/projects/hello-world-test/EBOOT.PBP

What should happen

PPSSPP shouldn't crash and handle the unimplemented features.

Logs

13:44:177 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/syslib.prx'): FAILED, 2 - access = 1 ''
13:44:177 user_main    E[LOADER]: HLE/sceKernelModule.cpp:2030 80010002=sceKernelLoadModule(umd0:/syslib.prx, 00000000, 00000000): file does not exist
13:44:178 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/recovery.lua'): FAILED, 2 - access = 1 ''
13:44:188 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/recovery.lue'): FAILED, 2 - access = 1 ''
13:44:208 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/script.lue'): 
FAILED, 2 - access = 1 ''

Platform

Linux / BSD

Mobile device model or graphics card (GPU)

GT 720

PPSSPP version affected

PPSSPP v1.17.1 [flatpak]

Last working version

1.9.3

Graphics backend (3D API)

OpenGL / GLES

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try without any cheats and without loading any save states.
  • Include logs or screenshots of issue.
@anr2me
Copy link
Collaborator

anr2me commented Apr 22, 2024

Hmm.. this is on Windows:
image
image

PS: i can't download the latest devbuild because the list didn't shows up on my firefox, so i use the latest version i had nevermind, it's just too slow (Downloading the latest ppsspp devbuild with 7.7 KB/s speed LOL my ISP probably throttling my connection again), the list shows up much later

@hrydgard
Copy link
Owner

Hm, not sure why the devbuilds server is slow :( I'll look into that. It's a temporary hosting solution anyway, but it should work okay.

@hrydgard hrydgard added this to the v1.18.0 milestone Apr 22, 2024
@hrydgard hrydgard added the Homebrew Issues only noticed in homebrew apps label Apr 22, 2024
@LunaMoo
Copy link
Collaborator

LunaMoo commented Apr 22, 2024

I'm not on the very latest, but still 1.17.1 and it works, however it can't find the script when placed inside projects folder, the binary from the site loads it from it's own main directory. Edit: and that seems to be expected behaviour seeing the guide mentions "Copy the EBOOT.PBP file to your new project folder:", but that guide is also inaccurate as the project should be memstick\PSP\GAME*your project name here*\ which has both EBOOT.PBP and script.lua files.

Edit2: and here: works fine on buildbot version as well:
runs fine

Also it doesn't crash when script is missing in it's folder, it just shows it's own error:
while script missing

So I guess you guys forget that homebrew is special case and needs to be launched from within "memstick\PSP\GAME" (and yeah, real PSP wouldn't even see it if it was outside of that folder, PPSSPP can load most games from any folder you want, but homebrew are special case, they use hardcoded paths outside of it's own container and for safety it's a golden rule to only launch them from correct folder structure).

This whole point on the guide for using this homebrew is wrong:

5. On your emulator go to File > Load and load the EBOOT.PBP in your project folder. You should see the result:

Should be changed to:

5. Move your project folder consisting of EBOOT.PBP and script.lua into "memstick\PSP\GAME" and launch it from homebrew menu on PPSSPP.

I assume the information about "Last working version" being "1.9.3" comes from the linked guide itself as there should have been no behaviour change, the person writing that guide probably just stored it in correct folder to begin with and as such saw no issues that could arise from storing it elsewhere.

@anr2me
Copy link
Collaborator

anr2me commented Apr 22, 2024

I'm not on the very latest, but still 1.17.1 and it works, however it can't find the script when placed inside projects folder, the binary from the site loads it from it's own main directory. Edit: and that seems to be expected behaviour seeing the guide mentions "Copy the EBOOT.PBP file to your new project folder:", but that guide is also inaccurate as the project should be memstick\PSP\GAMEyour project name here\ which has both EBOOT.PBP and script.lua files.

Edit2: and here: works fine on buildbot version as well: runs fine

Also it doesn't crash when script is missing in it's folder, it just shows it's own error: while script missing

So I guess you guys forget that homebrew is special case and needs to be launched from within "memstick\PSP\GAME" (and yeah, real PSP wouldn't even see it if it was outside of that folder, PPSSPP can load most games from any folder you want, but homebrew are special case, they use hardcoded paths outside of it's own container and for safety it's a golden rule to only launch them from correct folder structure).

This whole point on the guide for using this homebrew is wrong:

5. On your emulator go to File > Load and load the EBOOT.PBP in your project folder. You should see the result:

Should be changed to:

5. Move your project folder consisting of EBOOT.PBP and script.lua into "memstick\PSP\GAME" and launch it from homebrew menu on PPSSPP.

I assume the information about "Last working version" being "1.9.3" comes from the linked guide itself as there should have been no behaviour change, the person writing that guide probably just stored it in correct folder to begin with and as such saw no issues that could arise from storing it elsewhere.

Based on my logs, I did put the hello-world-test folder inside PSP/GAME folder, but i use the File->Load menu to launch the EBOOT.PBP (didn't know that homebrew has it's own launcher)

Edit: Opening it from Homebrew menu have the same issue in my case, but i haven't DL the latest devbuild as it's too slow and failed in the middle of DL.
image
image

Edit2: i was disabling "Ignore bad memory access" before in order to catch the first crash, if i enable it, it will only renders black screen, with a few bad address in the logs
image
Same issue using the latest artifact, and the latest release version at ppsspp.org too.
Strangely mine is showing a different title id than yours.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Apr 23, 2024

Homebrew lacks proper gameID, so it's fakeID generated per folder name.

I will check once I get home, but I don't think I really have any settings that would make it work, more likely something is breaking it, maybe even lengthy folder name, I kept mine short.

@BrownNPC
Copy link
Author

BrownNPC commented Apr 23, 2024

SO, I made a new directory, inside this folder I have the EBOOT file as well as the script.lua file with the hello world program.
I ran the eboot by running xdg-open ./EBOOT.PBP
then I get the error in my bash console:

21:57:247 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/syslib.prx'): FAILED, 30 - access = 11 ''
21:57:257 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/syslib.prx'): FAILED, 2 - access = 1 ''
21:57:257 user_main    E[LOADER]: HLE/sceKernelModule.cpp:2030 80010002=sceKernelLoadModule(umd0:/syslib.prx, 00000000, 00000000): file does not exist
21:57:258 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/recovery.lua'): FAILED, 2 - access = 1 ''
21:57:267 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/recovery.lue'): FAILED, 2 - access = 1 ''
21:57:287 user_main    E[FILESYS]: FileSystems/DirectoryFileSystem.cpp:58 DirectoryFileSystem::OpenFile('/script.lue'): FAILED, 2 - access = 1 ''

Then I tried to run the windows version 1.9.3 using wine, and it ran properly.

On the latest windows version running through wine I get this

Screenshot_20240423_183423

The folder is inside memstick/psp/game just like Luna stated.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Apr 23, 2024

Probably something specific you guys are doing, I even tried latest artifact and many usually game breaking settings and I couldn't find any way or setting to reproduce the crash.

Even the other examples like ball drop works fine:
LUAD00976_00000

And v0 for me at the address you both get that illegal read is normal looking address.
diss lua

I didn't bother following the guide through, meaning I also didn't used git for cloning it, just web browser download.

@anr2me
Copy link
Collaborator

anr2me commented Apr 23, 2024

I didn't bother following the guide through, meaning I also didn't used git for cloning it, just web browser download.

Same with me :) i don't have git on this freshly installed windows 11, so i only downloaded the EBOOT.PBP using browser and created the script.lua

I also extract ppsspp files into a new folder with everything as default, still got the same error.

Edit: if i removed the script.lua file it works fine, so i guess something in the script causing it to crash
image

@LunaMoo
Copy link
Collaborator

LunaMoo commented Apr 23, 2024

I think I found the problem.
I went completely clean and finally reproduced your crash. Then I just copied my psp fonts and it fixed it. So there's something about provided font or it's memory allocation which this homebrew doesn't like. It will work with original PSP fonts.

@LunaMoo LunaMoo added the PGF / sceFont Issue involves PGF fonts. label Apr 23, 2024
@hrydgard hrydgard modified the milestones: v1.18.0, v1.19.0 Apr 25, 2024
@hrydgard
Copy link
Owner

Do luadev apps have some specific identifier, like PARAM.SFO id or something? We could warn about this.

Alternatively, there might be some other kind of workaround we can do. Tagging to take a look for the next upcoming version.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Apr 26, 2024

Probably not, but since the app works and only breaks when loading hardcoded filename of script.lua with non default PSP fonts, a warning could happen on "script.lua" read, maybe also only for homebrew.

Through I find it weird that the app bundle comes with software to create/customize PSP fonts and doesn't support custom one we have in PPSSPP.

@anr2me
Copy link
Collaborator

anr2me commented Apr 26, 2024

It's kinda strange, for example i use ppsspp v.1.17.1 release version as the base, if i overwrite the ltn0.pgf ~ ltn15.pgf with the one from the latest artifact it works fine (not crashing), meanwhile the latest artifact nor the release version, both didn't works (crashed) with the fonts it came with O.o it even crashed with an empty script.lua file

Edit: nevermind, need more testing, i'm not sure which version the fonts i had on the folder with the latest artifact executable, when i tried to extract the font from the latest artifact to a new folder and use those fonts on the release version, it crashed again :( may be the fonts were from 1.9.3 which works fine with 1.17.1 executable when changing version i usually copy the executable a long with the assets folder, not sure why it works before but when i try on a new folder didn't works

I guess the only way to make it works is by using latin fonts from 1.9.3 or before 1.11.0 (as alternative to real PSP fonts), only need to replace the ltn0.pgf to be precise.

Edit2: The ltn0.pgf from this commit 06b0e33 is the last working version, and started to crash from this commit 737e0d5
may be @nassau-tk knew what's the difference between those commits.

@nassau-tk
Copy link
Contributor

Probaly, It was created unknown user for 1.9.3.
My font was created for 1.11.0 release.

@anr2me
Copy link
Collaborator

anr2me commented Apr 26, 2024

Probaly, It was created unknown user for 1.9.3. My font was created for 1.11.0 release.

Both commits (06b0e33 and 737e0d5) were made by you, right?
But only one of them didn't crashed.

And the last working version should be 1.10.3 instead of 1.9.3

@nassau-tk
Copy link
Contributor

Yes, Thats right!
I will check it!

@nassau-tk
Copy link
Contributor

[What's the difference between November 1st and November 23rd?]

Probably, The converter I am using is different.

06b0e33 01.Nov. ==> ttf2pgfj.exe
767e0d5 23.Nov. ==> pgftool

And, When I compared it with the hex editor, [01Nov] was almost the same as the original, but [23.Nov] had a unique value.
*Both characters included are exactly the same as the original.

But, I think [23.Nov] is working on PPSSPP.
And, ttf2pgfj.exe can't create pgf correctly.

By the way, what is Luadev r0 ????

@BrownNPC
Copy link
Author

BrownNPC commented Apr 28, 2024

By the way, what is Luadev r0 ????

Lua interpreter for the psp. it allows u to write apps for it in lua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Homebrew Issues only noticed in homebrew apps PGF / sceFont Issue involves PGF fonts.
Projects
None yet
Development

No branches or pull requests

5 participants