This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b4ea7848c607787f2da4ffa9a74d23e3776364e3
Author: raiden00pl <[email protected]>
AuthorDate: Wed Aug 26 14:48:44 2026 +0200

    arch/x86_64: don't place the idle stack base below _ebss
    
    The -16 in g_idle_topstack put the derived CPU0 idle stack base at
    _ebss - 16, and tls_init_info() writes the TLS info there, corrupting
    the last 16 bytes of .bss. Start the stack at _ebss like other
    architectures.
    
    Assisted-by: Claude Code
    Signed-off-by: raiden00pl <[email protected]>
---
 arch/x86_64/src/common/x86_64_allocateheap.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/x86_64/src/common/x86_64_allocateheap.c 
b/arch/x86_64/src/common/x86_64_allocateheap.c
index f75aa4c6494..ce23491f77b 100644
--- a/arch/x86_64/src/common/x86_64_allocateheap.c
+++ b/arch/x86_64/src/common/x86_64_allocateheap.c
@@ -55,8 +55,10 @@
  * Public Functions
  ****************************************************************************/
 
+/* The CPU0 idle stack starts at _ebss */
+
 const uintptr_t g_idle_topstack = (uintptr_t)_ebss +
-                                  CONFIG_IDLETHREAD_STACKSIZE - 16;
+                                  CONFIG_IDLETHREAD_STACKSIZE;
 
 /****************************************************************************
  * Name: up_allocate_heap

Reply via email to