pussuw commented on PR #11165:
URL: https://github.com/apache/nuttx/pull/11165#issuecomment-1807897534

   > > @pkarashchenko @patacongo You might be interested in this. Also, do you 
mind if I remove the nested cancellation point logic now as well ?
   > 
   > That is something I had planned to do and is a good idea if you are 
careful. My primary concern was "sneak" paths that could cause nesting. I don't 
know if the following is possible but consider this:
   > 
   >     1. A task sets up a signal handler and calls a cancellation point 
function,
   > 
   >     2. The function signals the task, since it is the same task, I think 
that the signal handler will run immediatedly (true?),
   > 
   >     3. The signal handler runs and calls another cancellation pointer 
function, effectively resulting in nesting.
   > 
   > 
   > If such a think could happen, then that would likely result in a resource 
leak since the second cancellation point function would not be allowed to do 
its clean-up.
   > 
   > One thing that you can do is:
   > 
   >     1. Retain the nesting count (only) and only if CONFIG_DEBUG_ASSERTIONS 
is enabled
   > 
   >     2. Then assert that the nesting count is zero on entry into the 
cancellation point function.
   
   Yes the situation you describe is entirely possible when system calls are 
disabled. When system calls are enabled the signal delivery gets deferred until 
the system call is finished. So maybe it is not a good idea for me to fiddle 
with that part after all..


-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to