zhhyu7 commented on PR #17304:
URL: https://github.com/apache/nuttx/pull/17304#issuecomment-3512518974

   > > @jnippula Could you please try this patch to see if it can solve your 
problem? #17306
   > > It might be root cause.
   > 
   > Yes, that patch helps to the crash issue I had, because the tcp_alloc uses 
NET_BUFPOOL_TRYALLOC(), which sets timeout to 0. But there is still potential 
race condition when using NET_BUFPOOL_TIMEDALLOC or NET_BUFPOOL_ALLOC, where 
timeout > 0. The devif_poll should not release reserved IOB, which it does not 
consume.
   
   The protocol stack should not break net_lock in the TX or RX process, so the 
d_iob operation in an independent TX or RX process is safe. Even if we do not 
release d_iob in devif_poll, when we return to tcp_alloc_accept, the content of 
d_iob has already changed, and at this time, some of the values assigned to 
accept conn should be incorrect. Moreover, for the old network card drivers 
that do not use d_iob for packet transmission, not clearing d_iob after the 
interface returns will cause exceptions in subsequent processes. As far as I 
know, it should be like this, but it's also possible that there are some 
details I haven't noticed, This information is for your reference.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to