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

Bug: Possibly allocating way too much memory. #3

Open
IngwiePhoenix opened this issue Jul 24, 2020 · 20 comments
Open

Bug: Possibly allocating way too much memory. #3

IngwiePhoenix opened this issue Jul 24, 2020 · 20 comments

Comments

@IngwiePhoenix
Copy link

I am using SyncBack in trying to automate the synchronization of my RetroArch and PSP saves (uma0:/data/retroarch/savefiles and uma0:/pspemu/PSP/SAVEDATA respectively). However, after just a few seconds of heavy FTP activity, the Vita itself becomes super unresponsive and the FTP server is no longer available. It can also only be shut down by holding down the power button.

Since it can not load icons, nor even the settings app (doesn't even get to the live area card), I am assuming that it is allocating so much memory that there is:

  • Either no memory left to allocate any for icons or outright launching other apps
  • Or the CPU is being heavily used. This one doesn't make a lot of sense since I can bring up the speed menu (holding the PS button) and the power menu (hold POWER button). However, I can't shut down. It literally freezes at that screen...

I have the VitaSDK installed in WSL2 - but I have no idea how I could remotely debug the memory usage of a plugin. I installed this plugin through Autoplugin2 - so I have to actually verify that I have the latest version installed. Considering though, that this is out since a while, I would assume Autoplugin did install the latest one available.

Do you know how I can possibly debug this? Thanks!

@teakhanirons
Copy link
Owner

teakhanirons commented Jul 24, 2020

@SonicMastr encountered this too. As I do not like RetroArch or do anything that needs that much memory along with only using the FTP on LiveArea, I have not either experienced or noticed this.

Although I remember @GrapheneCt once telling me that the memory allocated for the thread was too high, it might be related to that.

@teakhanirons
Copy link
Owner

Now that I think about it, I do remember FTP being slow when in an app.

Graphene was talking about this part, if I'm not wrong: https://github.com/teakhanirons/ftpeverywhere/blob/master/src/net.c#L18

It could also be the taipool allocation or the ftpvita buffer.

Can you elaborate a bit on your use case? Are you FTP'ing in RetroArch or on LiveArea?

@IngwiePhoenix
Copy link
Author

I wasn't even in an app. xD After each reboot, I just had it sit on the live area, even removed the CPU Core unlocking plugin since I thought it was causing issues.

@teakhanirons
Copy link
Owner

I have literally no idea other than reducing the allocated memory stuff as stated in my previous post. I'M SORRY ;_;

@GrapheneCt
Copy link

This sounds like kpanic. Likely SceAppMgr crash.

@IngwiePhoenix
Copy link
Author

What'd be a way to debug this? I just pulled down DolceSDK since that was used for this project so that I'd have it at hand.

@GrapheneCt
Copy link

GrapheneCt commented Jul 25, 2020

You can use https://github.com/CelesteBlue-dev/PSVita-RE-tools/tree/master/PrincessLog/build to see what is beign printed to stdout. Will be very helpfull.

Issue might be related to taipool. However that needs confirmation.

@IngwiePhoenix
Copy link
Author

I'll throw this at it then and see what I get out! :)

@IngwiePhoenix
Copy link
Author

No good. Looks like the logger is also overwhelmed by whatever is going on there. Which of those tools could do USB logging? I might be able to catch a little more output before the crash.

Man, I wish I could just run something like top over and over to see the memory growth - or whatever is growing in the end.

I'll also try to just build the plugin off the source tree and use that instead. Maybe I'll be lucky with a more recent build... maybe.

@IngwiePhoenix
Copy link
Author

Same behaviour with the freshly built variant as well.
I doubt it will do anything but I'll try to move the plugin from *main to KERNEL. Moving the logger around did not do anything but cancel logging (well... should've seen that coming, lol) but who knows. Gonna give it a try.

@IngwiePhoenix
Copy link
Author

Okay - being sleepy is not helpful. .suprx is obviously a USER extension, not a KERNEL extension. Good thing I have EmergencyMount for that. xD Oops... Welp, I did all I could, except for trying USB logging I guess.

@IngwiePhoenix
Copy link
Author

Tried PSMLogUSB - but to no avail either. I ran out of ideas now...

@IngwiePhoenix
Copy link
Author

Full ur0:tai/config.txt:

# This file is used as an alternative if ux0:tai/config.txt is not found.
# For users plugins, you must refresh taiHEN from HENkaku Settings for
# changes to take place.
# For kernel plugins, you must reboot for changes to take place.
*KERNEL
ur0:tai/EmergencyMount.skprx
ur0:tai/storagemgr.skprx
ur0:/tai/PSMLogUSB.skprx
ur0:tai/nonpdrm.skprx
ur0:tai/repatch.skprx
# ur0:tai/udcd_uvc.skprx
ux0:app/pspemucfw/sce_module/adrenaline_kernel.skprx
ur0:tai/noavls.skprx
ur0:/tai/ioplus.skprx
ur0:/tai/music_premium.skprx
ur0:/tai/nopowerlimits.skprx
ur0:/tai/rapidmenu.skprx
ur0:tai/itls.skprx
ur0:/tai/psonescrot.skprx
# henkaku.skprx is hard-coded to load and is not listed here
*main
ur0:tai/custom_warning.suprx
ur0:tai/shellbat.suprx
ur0:tai/henkaku.suprx
ur0:/tai/pngshot.suprx
ur0:/tai/download_enabler.suprx
ur0:/tai/ftpeverywhere.suprx
*NPXS10015
# this is for modifying the version string
ur0:tai/henkaku.suprx
*NPXS10016
# this is for modifying the version string in settings widget
ur0:tai/henkaku.suprx
# ITLS
*NPXS10036
ur0:/tai/reScreeny.suprx

I turned logger and FTP off and udcd_uvc back on; preparing to stream stuff later. But this was my config before I reverted it to, well "normal". Any other ideas what I can do to debug this?

@GrapheneCt
Copy link

GrapheneCt commented Jul 25, 2020

Did you try ftpeverywhere with udcd_uvc disabled?

There are probably memory leak somewhere. I did manage to reproduce the crash, in my case it reported that system is out of memory.

@IngwiePhoenix
Copy link
Author

IngwiePhoenix commented Jul 25, 2020 via email

@IngwiePhoenix
Copy link
Author

@GrapheneCt I just realized you had this: https://github.com/GrapheneCt/BGFTP
What exactly is different between this, and BGFTP, that could possibly lead to the "silent crash" that i am experiencing?

@IngwiePhoenix
Copy link
Author

There are probably memory leak somewhere. I did manage to reproduce the crash, in my case it reported that system is out of memory.

How did you manage to debug this in the end? I'd like to know in advance for when I run into other issues that I might be able to provide more information. :)

@GrapheneCt
Copy link

A lot are different. One of my systems has PSMLog, other one PrincessLog, I didn't have any issues with them. System prints to stdout when it can't allocate memory or kpanic happens.

@jonnyapps
Copy link

Did this ever get resolved? I'm looking to do the exact same thing with syncing files.

PS Thanks for your work on this project.

@teakhanirons
Copy link
Owner

No, I just use EmergencyMount or BGFTP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants