Skip to content

Commit 059165f

Browse files
authored
Fix crash on Ubuntu 24.04 ARM64 (FreeRTOS#1253)
On Ubuntu 24.04 ARM64, PTHREAD_STACK_MIN is 0x20000 which does not fit in unsigned short, size of which is 2 bytes. Casting PTHREAD_STACK_MIN to unsigned short in FreeRTOSConfig.h results in configMINIMAL_STACK_SIZE getting defined to 0 which leads to SIGSEV. This change removes the not needed casting of PTHREAD_STACK_MIN to unsigned short. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
1 parent c304913 commit 059165f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

FreeRTOS/Demo/Posix_GCC/FreeRTOSConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define configUSE_TICK_HOOK 1
4444
#define configUSE_DAEMON_TASK_STARTUP_HOOK 1
4545
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
46-
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) PTHREAD_STACK_MIN ) /* The stack size being passed is equal to the minimum stack size needed by pthread_create(). */
46+
#define configMINIMAL_STACK_SIZE ( PTHREAD_STACK_MIN ) /* The stack size being passed is equal to the minimum stack size needed by pthread_create(). */
4747
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 65 * 1024 ) )
4848
#define configMAX_TASK_NAME_LEN ( 12 )
4949
#define configUSE_TRACE_FACILITY 1

FreeRTOS/Demo/Posix_GCC/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask,
114114
void vApplicationTickHook( void );
115115
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
116116
StackType_t ** ppxIdleTaskStackBuffer,
117-
uint32_t * pulIdleTaskStackSize );
117+
configSTACK_DEPTH_TYPE * pulIdleTaskStackSize );
118118
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
119119
StackType_t ** ppxTimerTaskStackBuffer,
120-
uint32_t * pulTimerTaskStackSize );
120+
configSTACK_DEPTH_TYPE * pulTimerTaskStackSize );
121121

122122
#if ( projENABLE_TRACING == 1 )
123123

@@ -392,7 +392,7 @@ void vAssertCalled( const char * const pcFileName,
392392
* used by the Idle task. */
393393
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
394394
StackType_t ** ppxIdleTaskStackBuffer,
395-
uint32_t * pulIdleTaskStackSize )
395+
configSTACK_DEPTH_TYPE * pulIdleTaskStackSize )
396396
{
397397
/* If the buffers to be provided to the Idle task are declared inside this
398398
* function then they must be declared static - otherwise they will be allocated on
@@ -420,7 +420,7 @@ void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
420420
* to provide the memory that is used by the Timer service task. */
421421
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
422422
StackType_t ** ppxTimerTaskStackBuffer,
423-
uint32_t * pulTimerTaskStackSize )
423+
configSTACK_DEPTH_TYPE * pulTimerTaskStackSize )
424424
{
425425
/* If the buffers to be provided to the Timer task are declared inside this
426426
* function then they must be declared static - otherwise they will be allocated on

0 commit comments

Comments
 (0)