<feed xmlns='http://www.w3.org/2005/Atom'>
<title>threadx.git/ports/linux/gnu/src/tx_thread_stack_build.c, branch v6.4.1_cert</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/threadx.git/atom/ports/linux/gnu/src/tx_thread_stack_build.c?h=v6.4.1_cert</id>
<link rel='self' href='http://cgit.235523.xyz/threadx.git/atom/ports/linux/gnu/src/tx_thread_stack_build.c?h=v6.4.1_cert'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/'/>
<updated>2026-09-15T22:05:39Z</updated>
<entry>
<title>Aligned the simulator ports' fake stack pointer so ThreadX no longer performs misaligned ULONG accesses</title>
<updated>2026-09-15T22:05:39Z</updated>
<author>
<name>Frédéric Desbiens</name>
<email>frederic.desbiens@eclipse-foundation.org</email>
</author>
<published>2026-09-15T22:05:39Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=0980ea3df80bfc0eb269561793c8f0d26bbc8918'/>
<id>urn:sha1:0980ea3df80bfc0eb269561793c8f0d26bbc8918</id>
<content type='text'>
The Linux, Win32 and SMP Linux simulation ports build a fake initial stack pointer
by subtracting a fixed 8 bytes from tx_thread_stack_end. That field addresses the
last byte of the thread's stack area, so it is one less than an aligned address and
the resulting pointer is misaligned by construction, however well aligned the stack
the application supplied was.

Two ULONG accesses then use that pointer. _tx_thread_stack_build() itself clears the
word below it, and _tx_thread_create() copies it into tx_thread_stack_highest_ptr,
which TX_THREAD_STACK_CHECK dereferences on every suspend and resume when
TX_ENABLE_STACK_CHECKING is defined. Both are undefined behaviour. They happen to
work on x86 and are reported by GCC's undefined behaviour sanitizer.

The fake stack pointer is now rounded down to a ULONG boundary, which leaves it
inside the stack area and makes both accesses aligned.

This is a backport of the same fix from the development branch. It differs from that
version in one respect: the conversions are written inline rather than through
TX_POINTER_TO_ALIGN_TYPE_CONVERT and TX_ALIGN_TYPE_TO_POINTER_CONVERT, because
tx_api.h defines those two macros only in its non-MISRA branch and the port therefore
does not compile with TX_MISRA_ENABLE defined. That defect is reported upstream as
issue #741. Substituting the ULONG conversion pair would not be equivalent: ALIGN_TYPE
is 64-bit on __x86_64__ while ULONG is 32-bit, so a ULONG round trip would truncate
the pointer.

No certified source is touched, and coverage is unchanged: 4314/4339 lines and
4546/4627 branches merged over the six build configurations, identical line for line
and branch for branch to the measurement before this change. 107 of 107 tests pass in
each of the six.

Assisted-by: Claude Code (Opus 5) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Update copyright.</title>
<updated>2024-01-29T05:51:15Z</updated>
<author>
<name>Bo Chen (from Dev Box)</name>
<email>boche@microsoft.com</email>
</author>
<published>2024-01-29T05:51:15Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=8276bcf71142197e09551e29f1779299fa591ec7'/>
<id>urn:sha1:8276bcf71142197e09551e29f1779299fa591ec7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>6.1 minor release</title>
<updated>2020-09-30T22:42:41Z</updated>
<author>
<name>Scott Larson</name>
<email>sclarson@microsoft.com</email>
</author>
<published>2020-09-30T22:42:41Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=1b5816a206016d06128bd5e9afa7fbf8f09b0847'/>
<id>urn:sha1:1b5816a206016d06128bd5e9afa7fbf8f09b0847</id>
<content type='text'>
</content>
</entry>
<entry>
<title>updated to 6.0.1 and added additional processors/toolchains</title>
<updated>2020-07-16T21:32:40Z</updated>
<author>
<name>tameraw</name>
<email>9868777+tameraw@users.noreply.github.com</email>
</author>
<published>2020-07-16T21:32:40Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=2c35570dc9ced8690ea269d1efab201c361fea98'/>
<id>urn:sha1:2c35570dc9ced8690ea269d1efab201c361fea98</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Removed linux and win32 ports for now</title>
<updated>2020-05-12T20:53:18Z</updated>
<author>
<name>PProvost</name>
<email>peter@provost.org</email>
</author>
<published>2020-05-12T20:53:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=d9164e7bc6dac55bbc0248fce25859fa9194c198'/>
<id>urn:sha1:d9164e7bc6dac55bbc0248fce25859fa9194c198</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Initial commit</title>
<updated>2020-05-11T14:55:07Z</updated>
<author>
<name>PProvost</name>
<email>peter@provost.org</email>
</author>
<published>2020-05-11T14:55:07Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/threadx.git/commit/?id=852421fda03a7722d7adb45b187235cd66fa264e'/>
<id>urn:sha1:852421fda03a7722d7adb45b187235cd66fa264e</id>
<content type='text'>
</content>
</entry>
</feed>
