From 191ffe272b8fb81924814b95504313a5d9f63526 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 4 Apr 2020 23:27:27 -0400 Subject: Threading: Use 'size_t' for stack size in core threading code For some reason it was defined as 'unsigned short' but all arguments to the threading functions and other structs used size_t. The SDL plugin tried to allocate a 2MB stack and this resulted in much badness. This is a _very_ old bug, and might be responsible for countless subtle bugs! Change-Id: I8b7fd79a10c21e3ab524a89b4d40d9afa4fab638 --- firmware/kernel/thread-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/kernel/thread-internal.h b/firmware/kernel/thread-internal.h index fe053fa070..e47a37dfd7 100644 --- a/firmware/kernel/thread-internal.h +++ b/firmware/kernel/thread-internal.h @@ -128,7 +128,7 @@ struct thread_entry all threads blocked by this one) */ #endif #ifndef HAVE_SDL_THREADS - unsigned short stack_size; /* Size of stack in bytes */ + size_t stack_size; /* Size of stack in bytes */ #endif unsigned char state; /* Thread slot state (STATE_*) */ #ifdef HAVE_SCHEDULER_BOOSTCTRL -- cgit v1.2.3