wangchen61698 commented on PR #17587:
URL: https://github.com/apache/nuttx/pull/17587#issuecomment-3686275667

   > @wangchen61698 please explain the issue in the previous code, something 
like: "originally the code only test if the message was to be schedule during 
the debug (DEBUGASSERT), now the code test it is run time and return a BUSY 
error". Also provide some testing showing that the fix works
   
   This issue is encountered during stress testing on certain devices
   Direct cause of the problem: The IGMP_SCHEDMSG flag in group->flags has been 
set, resulting in a crash.
   <img width="1488" height="847" alt="image" 
src="https://github.com/user-attachments/assets/571a6fd2-dd09-44d5-ad33-875e8406eb55";
 />
   The thread that encountered the issue was triggered by the timeout of the 
IGMP timer task. The input parameter msgid of igmp_schedmsg is 
IGMPv2_MEMBERSHIP_REPORT (0x16 = 23), and the group already has an existing 
msgid (IGMP_LEAVE_GROUP, 0x17 = 22), indicating that before the timer expired, 
another thread modified the content of this group
   <img width="1100" height="816" alt="image" 
src="https://github.com/user-attachments/assets/465e58f5-41e6-4699-8cf5-08cab2dbe628";
 />
   Upon checking the stack information of the related task, it was found that 
thread 644 performed a leavegroup operation on the same group (0x457369e0)
   <img width="1308" height="970" alt="image" 
src="https://github.com/user-attachments/assets/616fe59e-2c94-4281-99ea-cd6fa08fed95";
 />
   This modification is to prevent a direct crash due to the setting of 
IGMP_SCHEDMSG during stress testing, and instead, it directly returns an error 
log, without affecting the stress testing
   After the modification, the stress test is no longer affected by this issue
   Due to the inherent difficulty in constructing the scenario, only a simple 
proof was constructed to show that the code can proceed to the corresponding 
process when this scenario occurs, which is in line with expectations
   For specific construction information, please refer to TEST
   


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