-
Notifications
You must be signed in to change notification settings - Fork 134
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
setsockopt(SO_SNDBUF, 32768): Not enough space #180
Comments
socket.cpp disables SO_LINGER on 3DS. Woud you please explain the reason? Does it mean the socket will never or always stay the 2 minutes in state TIME_WAIT? BTW slowing down wget does not help. It's still running out of resources. |
|
Yes, but the root cause is a resource leak in ftpd. And this needs to be found and closed. |
How long is a while? I've been transferring for hours and not seen this problem. |
Let me know if this works better |
Well, it depends on your ftp client. Your client might use one connection to download the entire content of the sd card. wget creates a new connection for every file. That's why I provided a command line to reproduce the error.
Will do... |
I was using your command both as-is and also with fixing -timout 1 to --timeout 1 Every client makes a new connection for every file. That's just how FTP works. |
Both classic and normal ftpd still have the issue. However, I believe I can narrow down the scenario under which the error occurs. A fresh mirror does not show the error. However, if I update an existing mirror and a larger file was only partially transferred in a previous run, there is a high probability that the error will occur. What exactly is happening? wget first tries to download the remaining part via REST. If an error occurs, it switches to RETR. However, if an error occurs with REST, and this happens often, then the memory error occurs immediately after. Could it be that in this case ftpd does not release resources? |
I will try to reproduce using this new information. |
I found and fixed a bug with REST (it apparently never worked before) so now it should actually resume transfers. The only way I was able to reproduce your problem was by disconnecting the network cable from my pc during transfer. Seems like 3DS sockets never report errors to poll() (or at least they take longer than I'm willing to wait), so I added an inactivity timeout. If a session has no socket transfers for 60 seconds, then I end that session, which looks to cleanup this error case. Can you try it out for me? After the session was cleaned up, I reconnected my network cable. Then wget errored and retried, and the sync successfully completed. |
Thank you for your efforts, but unfortunately the error is unchanged. I checked twice to use the correct ftpd. LogGrößen stimmen nicht überein (lokal 3691428688) -- erneuter Download. --2024-01-21 09:35:50-- ftp://dizzy:5000/Nintendo%203DS/ed36547026f3bf059688a7a491a11dd4/261100e3471222cf534136340002544d/title/00040000/0f700200/content/00000002.app wget retries the REST four more times and then the error occurs on the 3DS. Instead of pulling the cable, you could truncate an already downloaded file and keep the timestamp (important!). The size of the file also seems to have an influence. Smaller files do not trigger the error. Would a recording of the network traffic be helpful? Or could you provide an ftpd with debug? |
I tried using curlftpfs for creating incremental backups. This leads to the same issue. From what I can tell from ftpd's log message, curlftpfs is also using the REST command a lot. I can reproduce the error within seconds via downloading a 100 MB file. |
Describe the bug
I'm using
ftpd classic
on a New 3DS to backup the SD card, which is filled with approx. 50GB. After a whileftp
keeps failing withsetsockopt(SO_SNDBUF, 32768): Not enough space
.Either used memory is not freed or sockets are not closed.
To Reproduce
Steps to reproduce the behavior:
ftpd
on the 3DS side.wget --mirror -c --timout=1 -P <localdir> ftp://<ip_of_3ds>:5000/
wget
failsftpd
on 3DSExpected behavior
ftpd
frees / closes all used resources and transfer does not fail.Screenshots
N/A
Platform (please complete the following information):
Additional context
Since
wget
opens a new connection for each transfer, it depends on the number of files to be transferred whetherftpd
runs out of resources or not.The text was updated successfully, but these errors were encountered: