a-lunev commented on a change in pull request #5373:
URL: https://github.com/apache/incubator-nuttx/pull/5373#discussion_r797575817



##########
File path: net/tcp/tcp_send_buffered.c
##########
@@ -1145,6 +1168,20 @@ ssize_t psock_tcp_send(FAR struct socket *psock, FAR 
const void *buf,
       if (psock->s_sndcb == NULL)
         {
           psock->s_sndcb = tcp_callback_alloc(conn);
+
+#ifdef CONFIG_DEBUG_ASSERTIONS

Review comment:
       It is about another potential issue. I am suspecting the following:
   In case of closing TCP connection the TCP callback is marked as null and the 
callback flags are zeroed (it is normal), however in some places of the code 
the socket is not yet marked as closed by the time, therefore the user app can 
call write() further. In this case one more callback may be created in 
psock_tcp_send(). Then the socket is finally marked as closed, however the 
second callback is alive and may trigger.
   Thus my plan is first to confirm the root cause (I am not yet sure the 
potential issue really exists), then to fix the issue (if this root cause is 
confirmed).
   Even if the root cause is not confirmed for now, in any case this debug 
assert is reasonable to be in the code forever to prevent similar issue in the 
future because of further code modifications.




-- 
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