You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2025/11/11 09:41:35 UTC

[PR] Revert "sched_lock: remove the check for whether tcb is NULL" [nuttx]

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

   Reverts apache/nuttx#17300


-- 
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/sched_lock: remove null pointer check of rtcb [nuttx]

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

   Hi @anchao , I support reverting the commit until the review comments are satisfied. But, this revert PR looks like it has modifications and isn't a direct revert. I think we should revert the exact commit changes and then reopen for discussion.


-- 
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/sched_lock: remove null pointer check of rtcb [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 closed pull request #17310: sched/sched_lock: remove null pointer check of rtcb
URL: https://github.com/apache/nuttx/pull/17310


-- 
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/sched_lock: remove null pointer check of rtcb [nuttx]

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

   > What's the point of fighting for performance in debug code? It's normal for debug code to have no performance.
   > Null pointer debug assertions are useful because they sometimes allow you to find bugs that are hard to find, like stack/buffers overflows. I remember that this type of assertions helped me to find bugs in completely unrelated parts of the kernel.
   > 
   > Also I very much doubt that all architectures support null pointer detection, the first thing that comes to my mind is STM32F0 (cortex-m0). For all STM32 0x0000:0000 is the correct address, which means that by default there will be no exception even for chips with MPU. This can lead to bugs that are difficult to detect and debug.
   
   I agree. I wonder if someone could explain though why we don't need the runtime check out of debug mode? Why is the rtcb never null?
   


-- 
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] Revert "sched_lock: remove the check for whether tcb is NULL" [nuttx]

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

   I submitted a change request in PR https://github.com/apache/nuttx/pull/17300 , but @xiaoxiang781216  was ignored and the commit was forcibly merged. Please revert this change.
   
   REF: https://github.com/apache/nuttx/pull/17300#discussion_r2513526376
   


-- 
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/sched_lock: remove null pointer check of rtcb [nuttx]

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

   > What's the point of fighting for performance in debug code? It's normal for debug code to have no performance. Null pointer debug assertions are useful because they sometimes allow you to find bugs that are hard to find, like stack/buffers overflows. I remember that this type of assertions helped me to find bugs in completely unrelated parts of the kernel.
   
   I disagree with your point. In fact, most Nuttx devices have DEBUG_ASSERTIONS enabled by default, including those already on the market, because this is very helpful for locating and resolving certain issues. 
   
   Therefore, performance is also very important in the enable assertion mode.
   
   > Also I very much doubt that all architectures support null pointer detection, the first thing that comes to my mind is STM32F0 (cortex-m0). For all STM32 0x0000:0000 is the correct address, which means that by default there will be no exception even for chips with MPU. This can lead to bugs that are difficult to detect and debug.
   
   @raiden00pl Have you actually seen the changes in #17300 reviewed? This commit removed the check for rtcb validity. If, as you claim, some hardware lacks 0-address protection, then #17300 needs to be reverted.


-- 
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/sched_lock: remove null pointer check of rtcb [nuttx]

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

   What's the point of fighting for performance in debug code? It's normal for debug code to have no performance.
   Null pointer debug assertions are useful because they sometimes allow you to find bugs that are hard to find, like stack/buffers overflows. I remember that this type of assertions helped me to find bugs in completely unrelated parts of the kernel.
   
   Also I very much doubt that all architectures support null pointer detection, the first thing that comes to my mind is STM32F0 (cortex-m0). For all STM32 0x0000:0000 is the correct address, which means that by default there will be no exception even for chips with MPU. This can lead to bugs that are difficult to detect and debug.


-- 
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] Revert "sched_lock: remove the check for whether tcb is NULL" [nuttx]

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao closed pull request #17310: Revert "sched_lock: remove the check for whether tcb is NULL"
URL: https://github.com/apache/nuttx/pull/17310


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