You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/06/07 13:51:32 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new issue #1213: Does memory leak in nxsched_release_tcb for KERNEL mode?

xiaoxiang781216 opened a new issue #1213:
URL: https://github.com/apache/incubator-nuttx/issues/1213


   ```
         if (tcb->stack_alloc_ptr &&
             (tcb->flags & TCB_FLAG_CUSTOM_STACK) == 0)
           {
   #ifdef CONFIG_BUILD_KERNEL
             /* If the exiting thread is not a kernel thread, then it has an
              * address environment.  Don't bother to release the stack memory
              * in this case... There is no point since the memory lies in the
              * user memory region that will be destroyed anyway (and the
              * address environment has probably already been destroyed at
              * this point.. so we would crash if we even tried it).  But if
              * this is a privileged group, when we still have to release the
              * memory using the kernel allocator.
              */
   
             if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_KERNEL)
   #endif
               {
                 up_release_stack(tcb, ttype);
               }
           }
   ```
   Yes, address environment will free the memory when process exit, but the stack memory can't be reused before that.  So this is still a memory leak.


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

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



[GitHub] [incubator-nuttx] patacongo closed issue #1213: Does memory leak in nxsched_release_tcb for KERNEL mode?

Posted by GitBox <gi...@apache.org>.
patacongo closed issue #1213:
URL: https://github.com/apache/incubator-nuttx/issues/1213


   


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

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