nuttx/sched
yushuailong 1b59375057 sched/sched: Fix uninitialized sporadic params returned by nxsched_get_param()
When querying the calling task itself (pid == 0 or the caller's own
pid), nxsched_get_param() only filled in sched_priority and never
touched the SCHED_SPORADIC related members (sched_ss_low_priority,
sched_ss_max_repl, sched_ss_repl_period and sched_ss_init_budget).
With CONFIG_SCHED_SPORADIC enabled, the caller received uninitialized
stack garbage in these fields, and a task running under the sporadic
policy could not retrieve its own sporadic parameters.

Fix this by factoring the sporadic parameter fill-in into a common
helper nxsched_get_sporadic_param() shared by both the self-query and
the lookup paths, so both paths now return identical information.

The self-query path keeps its original fast-path behavior: no TCB
lookup and a lock-free read of sched_priority.  Only the read of the
sporadic state is wrapped in a critical section, because tcb->sporadic
may be freed concurrently, e.g. by sched_setscheduler() from another
CPU switching the task away from SCHED_SPORADIC.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-08-04 09:34:23 +08:00
..
addrenv sched/addrenv: do not dereference a NULL address environment 2026-08-03 23:15:29 +08:00
clock sched/clock/clock_delay: added config flag to remove weak up_udelay 2026-06-17 17:10:02 +08:00
environ libc/environ: add interrupt context check to getenv 2026-01-21 10:37:55 +08:00
event sched/event: Fix uninitialized need_switch flag issue in event_post() 2025-11-04 21:43:59 +08:00
group sched/group: implement POSIX saved-set-UID/GID semantics 2026-06-17 17:13:57 +08:00
hrtimer sched/hrtimer: Simplify the hrtimer. 2026-02-02 13:26:22 +08:00
init arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y 2026-06-17 17:11:26 +08:00
instrument gprof: move gprof function from sched to libbuiltin/libgcc 2024-11-13 02:42:31 +08:00
irq !include/fcntl.h: align open flags with Linux values 2026-07-03 10:33:47 +08:00
misc sched: avoid dumping raw memory at address 0 for tasks without kstack 2026-08-03 21:29:04 +08:00
module !include/fcntl.h: align open flags with Linux values 2026-07-03 10:33:47 +08:00
mqueue !include/fcntl.h: align open flags with Linux values 2026-07-03 10:33:47 +08:00
paging include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pthread !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
sched sched/sched: Fix uninitialized sporadic params returned by nxsched_get_param() 2026-08-04 09:34:23 +08:00
semaphore arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y 2026-06-17 17:11:26 +08:00
signal arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y 2026-06-17 17:11:26 +08:00
task arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y 2026-06-17 17:11:26 +08:00
timer !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
tls include/fcntl.h: remove O_RDOK/O_WROK aliases 2026-07-03 10:33:47 +08:00
wdog !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
wqueue include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
CMakeLists.txt
Kconfig Documentation/sched: Add POSIX user identity transition docs 2026-06-17 17:13:57 +08:00
Makefile tools: fix stale archive members surviving a Kconfig-driven CSRCS change 2026-08-04 00:36:32 +08:00