-
Notifications
You must be signed in to change notification settings - Fork 7.6k
v1.0.4: AsyncUDP doesn't properly release resources when receiving packets (fix proposed in description) #3320
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
Comments
I posted this issue because I wasn’t sure if v1.0.4 is being tracked separately. Apologies if this is considered double posting or just a duplicate. Please delete if it’s inappropriate. I feel this one is more appropriately named :) |
@ssilverman there is only one tracker and it is cumulative in nature. I'd suggest hop on gitter.im and discuss the issue with @me-no-dev and others there. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
There's still no explanation about why the proposed fix in #3290 doesn't work. The pass-by-reference version in AsyncUDP is still broken. |
[STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it openin the future. |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: Adafruit ESP32 Feather
Core Installation version: 1.0.4
IDE name: Arduino 1.8.10
Flash Frequency: 80MHz
PSRAM enabled: don't know
Upload Speed: 921600
Computer OS: OSX 10.14.6
Description:
This is the same problem as for v1.0.3 detailed here: #3287
A proposed fix is here: #3290
The reasoning behind the fix is here: #3288
In summary, once all the UDP buffers are used up, the program stops being able to accept UDP packets.
Basically, per the API,
AsyncUDP
's callback should take a reference, but that doesn't work. Instead, the callback taking a copy (and thus calling the copy constructor) does work. The references topbuf
aren't tracked correctly and the current logic for handling both the pass-as-copy and pass-as-reference doesn't work for both cases. The fix in #3290 does work for both cases.The proposed fix may not be the best way to write this, and I'm sure the design will be improved, but the fix works with the current code by re-balancing the copy constructor to call
pbuf_ref
.A test sketch is below and the bash script for repeatedly sending 512-byte packets is here (change the IP address and packet size as you wish):
Sketch:
The text was updated successfully, but these errors were encountered: