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

[PR] nsh_vars: Remove rogue sched_unlock() [nuttx-apps]

pussuw opened a new pull request, #2823:
URL: https://github.com/apache/nuttx-apps/pull/2823

   
   ## Summary
   There is no corresponding sched_lock() for this and therefore this causes random crashes.
   
   Found when running a long init script which utilizes shell variables in SMP mode.
   
   ## Impact
   Remove sched_unlock() from a place that does not use sched_lock()
   ## Testing
   Downstream MPFS target which utilizes nsh_vars.
   


-- 
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] nsh_vars: Remove rogue sched_unlock() [nuttx-apps]

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

   Thank you @patacongo and @pussuw this PR can be safely merged :-)


-- 
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] nsh_vars: Remove rogue sched_unlock() [nuttx-apps]

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


-- 
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] nsh_vars: Remove rogue sched_unlock() [nuttx-apps]

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

   > @patacongo is it safe to remove this abandoned `shed_unlock()` or the `sched_lock()` is missing?
   
   Ville has it right.  It might have had meaning at one time.  Originally, NSH was part of the nuttx repository and was moved out, losing the history that far back.  The apps were separated at NuttX-5.19 since they are not architecturally a part of the OS.
   
   NOTE also:  sched_lock() does not work does not provide mutual exclusion in the case of SMP; the locked code section can still be re-entered from other CPUs.  So it is wrong as is on many levels.
   


-- 
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] nsh_vars: Remove rogue sched_unlock() [nuttx-apps]

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

   There should be no reason to do mutual exclusion (sched_lock) here as pstate is allocated per shell and only the shell itself can add / remove vars.


-- 
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] nsh_vars: Remove rogue sched_unlock() [nuttx-apps]

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

   @patacongo is it safe to remove this abandoned `shed_unlock()` or the `sched_lock()` is missing? From a history of file I can see it is here from the beginning of time :-)


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