You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "zyfeier (via GitHub)" <gi...@apache.org> on 2024/10/11 01:26:49 UTC

[PR] sched/group: clear tcb group after group_release [nuttx]

zyfeier opened a new pull request, #14069:
URL: https://github.com/apache/nuttx/pull/14069

   ## Summary
   
   nxsig_action will use tcb group when group release, so need clear tcb group after group_release.
   
   [ap] dump_assert_info: Assertion failed : at file: signal/sig_action.c:205 task: ofonod process: Kernel 0xec89d5
   [ap] sched_dumpstack: backtrace:
   [ap] sched_dumpstack: [29] [<0x66e2e2>] backtrace_unwind+0x105/0x108
   [ap] sched_dumpstack: [29] [<0x660272>] sched_backtrace+0x41/0x48
   [ap] sched_dumpstack: [29] [<0x61c4dc>] sched_dumpstack+0x33/0x80
   [ap] sched_dumpstack: [29] [<0x6023e4>] _assert+0x19b/0x39c
   [ap] sched_dumpstack: [29] [<0x61b7e4>] __assert+0x7/0x10
   [ap] sched_dumpstack: [29] [<0x6071a2>] nxsig_action+0x119/0x248
   [ap] sched_dumpstack: [29] [<0x6072d8>] sigaction+0x7/0x24
   [ap] sched_dumpstack: [29] [<0x66a072>] signal+0x4d/0x80
   [ap] sched_dumpstack: [29] [<0x100fd36>] signalfd_file_close+0x35/0x60
   [ap] sched_dumpstack: [29] [<0x64a7d8>] file_close+0x1b/0x44
   [ap] sched_dumpstack: [29] [<0x649ac0>] files_putlist+0x2b/0x70
   [ap] sched_dumpstack: [29] [<0x60491a>] group_leave+0x99/0xe4
   [ap] sched_dumpstack: [29] [<0x605df8>] nxtask_exithook+0x4f/0xf4
   [ap] sched_dumpstack: [29] [<0x603ca0>] _exit+0x33/0x3c
   [ap] sched_dumpstack: [29] [<0x61ecf0>] abort+0x7/0xc
   
   ## Impact
   
   task_exit
   
   ## Testing
   
   BES board with ostest and monkey test pass


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] sched/group: clear tcb group after group_release [nuttx]

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on PR #14069:
URL: https://github.com/apache/nuttx/pull/14069#issuecomment-2406400753

   Why not check the validity of the group and return error? since the group has already exited
   
   ![image](https://github.com/user-attachments/assets/3016799e-8e8b-4c10-bad3-7593e3c42ba7)
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] sched/group: clear tcb group after group_release [nuttx]

Posted by "GUIDINGLI (via GitHub)" <gi...@apache.org>.
GUIDINGLI merged PR #14069:
URL: https://github.com/apache/nuttx/pull/14069


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] sched/group: clear tcb group after group_release [nuttx]

Posted by "nuttxpr (via GitHub)" <gi...@apache.org>.
nuttxpr commented on PR #14069:
URL: https://github.com/apache/nuttx/pull/14069#issuecomment-2406363159

   [**\[Experimental Bot, please feedback here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+13552&type=issues)
   
   
   
   The PR summary and impact sections are lacking and don't meet the NuttX requirements. Here's a breakdown and suggestions for improvement:
   
   **What's Missing/Needs Improvement:**
   
   * **Summary:**
       * **Why is the change necessary?** The summary mentions a bug ("Assertion failed") but doesn't explain *why* clearing the TCB group after `group_release` is the correct solution. 
       * **What functional part is being changed?** Be more specific than "task_exit." Which functions are modified? What data structures are affected?
       * **How does the change work?**  Provide a concise explanation of the mechanism used to clear the TCB group.
   
   * **Impact:**
       * **Is a new feature added?**  Unclear. The description suggests a bug fix, which wouldn't be a new feature.
       * **Impact on the user?** It's crucial to analyze if this change might cause applications to behave differently.  
       * **Other impacts:** The PR only mentions "task_exit." Analyze and address all other potential impacts (build process, hardware, documentation, security, compatibility).
   
   **How to Improve the PR Description:**
   
   1. **Explain the Bug:** Clearly describe the root cause of the assertion failure. Why does `nxsig_action` using the TCB group during `group_release` lead to an issue?
   2. **Solution Details:** Provide a step-by-step explanation of how clearing the TCB group resolves the problem.
   3. **Functional Impact:** Be specific about which functions or modules are directly affected by the code changes.
   4. **User Impact:** Will this fix change any behavior observable by applications running on NuttX? If so, how?
   5. **Thorough Impact Assessment:**  Address *all* impact categories listed in the requirements. Even if an impact is "NO," state it explicitly (e.g., "Impact on build: NO").
   6. **Testing Clarity:**
       * **Environment Details:** Provide complete information about your build host and target environments (OS versions, compiler versions, specific board models).
       * **Relevant Test Logs:**  The current logs are not informative. Include only the relevant portions of the logs that demonstrate the bug before the fix and the successful behavior after the fix.
   
   **Example of an Improved Summary:**
   
   > **Fix: Assertion failure in `nxsig_action` during `group_release`**
   
   > This PR addresses an assertion failure occurring in `nxsig_action` when a task exits while a signal is being delivered to its group. The issue arises because `nxsig_action` attempts to access the task's TCB group information during `group_release`, which may have already freed the group data.  
   
   > The fix ensures that the TCB group is explicitly cleared before `group_release` is called, preventing the invalid memory access and resolving the assertion failure.
   
   By providing a more detailed and comprehensive PR description, you make it easier for reviewers to understand your changes and ensure they meet the NuttX project's standards. 
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org