Mounting Blu-Ray ISOs from network crashes ps3netsrv
Attempting to mount an ISO of a Blu-Ray movie (BDISO folder) from a ps3netsrv network directory crashes the ps3netsrv process. See below:
# ./ps3netsrv /share/PS3ISO 38008 192.168.*.*
ps3netsrv build 20250803 [READ-ONLY] (mod by aldostools)
Path: /share/PS3ISO
Host IP #1: 192.168.1.2:38008
Waiting for client...
[0] Connection from 192.168.1.28
open dir /GAMES
open dir /PS3ISO
open dir /BDISO
open dir /DVDISO
open dir /PS2ISO
open dir /PSXISO
open dir /GAMEI
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted
Thank you for your comments. Could you identify the file that is breaking the application? If possible, try moving all BDISO files out from the directory, then test adding them back one by one until your get the issue again.
The target is to identify the exact file that is causing the error to check the properties of that file that are different than the other ones: special characters in the file name, name length, path, file size, read/write attributes, ISO structure, etc.
Thank you for your comments. Could you identify the file that is breaking the application? If possible, try moving all BDISO files out from the directory, then test adding them back one by one until your get the issue again.
The target is to identify the exact file that is causing the error to check the properties of that file that are different than the other ones: special characters in the file name, name length, path, file size, read/write attributes, ISO structure, etc.
Every real Blu-Ray (BDMV) ISO crashes it.
Could you try the original ps3netsrv from deank or from Cobra or an older version? I would like to confirm if this is a bug introduced recently or if it is just an unreported old issue.
Could you try the original ps3netsrv from deank or from Cobra or an older version? I would like to confirm if this is a bug introduced recently or if it is just an unreported old issue.
It's definitely been there for several years because I've been using a version from like 3 or 4 years ago until very recently. I've only updated a couple of days ago to see if it fixes this crash, which it didn't.
If you want me to test another version, give me a link and I'll test it when I return home this evening (around 19 UTC).
@aldostools I tried running it in a debugger on my PC and it didn't crash. Either it's Linux specific (my PC is Windows) or it's a memory issue, because I normally run it from a NAS that has 8GB RAM, while the PC I debugged on has 16GB. It should be noted that the ISO I was mounting was 25GB though.
I still lean towards thinking it's a memory issue because std::bad_alloc is normally thrown when "new" fails to allocate memory.
Things to do imho:
- As a bandaid, add a catch statement in client_thread to prevent ps3netsrv from completely crashing.
- Add a lot of debug prints to the code to try and find where the crash happens.
- Figure out why it tries to allocate gigabytes of memory in the first place, and why it happens only with BDs and not with PS3 ISOs, which are also many gigabytes in size.
@aldostools Seems that every time it crashes, webMAN MOD removes the source from the list, which you said is on purpose, but it makes debugging very annoying because I have to readd and restart the console every time. Is there any way to avoid this?
if webMAN MOD cannot access the ps3netsrv, it disables the scanning of the remote server temporarily. It is restored when you reboot the PS3 (except if you save the wm_config with the remote server already disabled).
If you don't want to re-enable the access to the ps3netsrv every time it crashes, you have 3 options: 1- Reboot the PS3 to restore the access to the disabled remote server. 2- Disable the content scanning at the startup, so you don't have to re-scan the game list everytime. 3- Mount the game manually from the PC accesing the folder /net0/PS3ISO or /net0/GAMES. Click on the file size to mount the ISO or the folder.
if webMAN MOD cannot access the ps3netsrv, it disables the scanning of the remote server temporarily. It is restored when you reboot the PS3 (except if you save the wm_config with the remote server already disabled).
If you don't want to re-enable the access to the ps3netsrv every time it crashes, you have 3 options: 1- Reboot the PS3 to restore the access to the disabled remote server. 2- Disable the content scanning at the startup, so you don't have to re-scan the game list everytime. 3- Mount the game manually from the PC accesing the folder /net0/PS3ISO or /net0/GAMES. Click on the file size to mount the ISO or the folder.
I'm in the process of trying to locate the crash, and since I can't reproduce it in a proper debugging environment I have to resort to printf-debugging, so having to reboot the PS3 to re-enable the content every time I add a new print is a bit tiresome...
I'm in the process of trying to locate the crash, and since I can't reproduce it in a proper debugging environment I have to resort to printf-debugging, so having to reboot the PS3 to re-enable the content every time I add a new print is a bit tiresome...
As I commented earlier, the reboot is only one of the 3 methods that I recommended to avoid the removal of the remote games.