-
Notifications
You must be signed in to change notification settings - Fork 7.5k
frdm_k64f: samples/net/sockets/echo_server doesn't work #13301
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
Do you have stack sentinel enabled? Running the samples on
Increasing |
Oh really? One may only wonder how did we live before. printk() was used concurrently from everywhere - from multiple threads, from ISRs, whatever, and nothing deadlocked. |
I can smell an irony here... What options we have to improve situation? |
@pfalcon you have shell talking to uart in the interrupt mode and printk in polling. That will clash eventually. As now we have option to have synchronous logs i think that the best is to redirect printk to log. If we want in future to use printk through the same medium as shell/logger but in parallel then we need to implement tty interace imo. |
@jarz-nordic:
Well, please let me finish with #13260, proposal for resolving which includes reverting #12747 (the nature of which appear to be the opposite - make different thread output to deadlock on each other), and then I'll look into retesting with new data available here and come out with options, though I bet it will be the well-known one - IMMEDIATE should be default for logging. |
echo_server runs with |
Let me translate that: "mutex" means "deadlock". More detailed account comes in #13260, I'd appreciate if you could look there. The only reason it pops up here is because we have deadlocking around. (Causes may be absolutely different, so let's not discuss that case here.) |
I've made some changes to eth_mcux to handle kinetis interrupts similar to i.mx:
This will prevent the deadlock by letting Ethernet interrupts run their course without anyone interrupting. I ran without CONFIG_LOG_PRINTK=y. |
echo_server seems to run with the changes to eth_mcux.c for the first moment, but it gets totally instable. edit: |
I don't have an ethernet board to reproduce, but I can add here my observations from running the samples on qemu_x86. Both,
zephyr/subsys/net/ip/net_stats.h Line 83 in 054e1be
And echo server failed here:
I've also ran the samples over 802.15.4 on |
@i8080 looks like this is no longer an issue at this moment. |
The sending of the final FIN message was being put on the sent_list to be handled by the retry logic and being sent directly. But in the case of a socket that never had a connection, the logic after the direct send would decrement the reference on the packet which would cause the retry logic to eventually have a situation where the pkt is on the sent_list queue but the buffer associated with the packet is freed back to slab. The code would then get a null pointer to the tcp header and would fault when setting the crc to zero on frdm-k64f platform. Fixes #13489, #13301 Signed-off-by: david leach <[email protected]>
Sorry for the delay with getting back to test this, but various fixes applied in the meantime indeed appear to have positive effect, and I confirm that as of master ddf744d, samples/net/sockets/echo_server works out of the box. I test all for combinations of (IPv4, IPv6) x (TCP, UDP). @i8080, I'm closing this issue, as we need to maintain actual picture of the bugs for the release. If you still see an issue, please comment/reopen. |
For logging issues (which are no longer visible by default, but pop up with CONFIG_LOG_IMMEDIATE), I opened #13897 |
samples/net/sockets/echo_server shows no reaction on frdm_k64f board with default setting
as suggested by @jarz-nordic it runs with additional
CONFIG_LOG_PRINTK=y
enabledThe text was updated successfully, but these errors were encountered: