Go to file
hujun5 ed78646798 signal: fix deadlock when sigdeliver call enter_critical_section
cpu0                                 cpu1:

user_main
signest_test
sched_unlock
nxsched_merge_pending
nxsched_add_readytorun
up_cpu_pause
			             arm_sigdeliver
				     enter_critical_section

Reason:
In the SMP, cpu0 is already in the critical section and waiting for cpu1 to enter the suspended state.
However, when cpu1 executes arm_sigdeliver, it is in the irq-disabled state but not in the critical section.
At this point, cpu1 is unable to respond to interrupts and
is continuously attempting to enter the critical section, resulting in a deadlock.

Resolve:
adjust the logic, do not entering the critical section when interrupt-disabled.

test:
We can use qemu for testing.

compiling
make distclean -j20; ./tools/configure.sh -l qemu-armv8a:nsh_smp ;make -j20
running
qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic -machine virt,virtualization=on,gic-version=3 -net none -chardev stdio,id=con,mux=on -serial chardev:con -mon chardev=con,mode=readline -kernel ./nuttx

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-06-22 19:35:28 -03:00
.github build(deps): bump github/super-linter from 5 to 6 2024-04-29 17:34:32 +08:00
arch signal: fix deadlock when sigdeliver call enter_critical_section 2024-06-22 19:35:28 -03:00
audio Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
binfmt Revert "sched: replace some global variables to macro" 2024-06-06 22:00:25 +08:00
boards arm64/qemu: add support poweroff/reboot command 2024-06-21 22:44:09 +08:00
cmake fix nxstyle 2024-05-13 22:24:36 +02:00
crypto fix(Kconfig): spellcheck "randon" to "random" 2024-06-15 17:40:18 +08:00
Documentation Documentation: Add docs for ipfilter 2024-06-20 09:43:05 +08:00
drivers video/v4l2_cap: fix no return after checked null 2024-06-22 11:50:25 -03:00
dummy build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs driver: add note when driver registers 2024-06-21 22:43:06 +08:00
graphics video/vnc: add vnc_fb_register 2024-04-12 17:42:49 +08:00
include arch/arm: add up_systempoweroff() 2024-06-21 22:44:09 +08:00
libs arch/risc-v: initial qemu-rv64ilp32 support 2024-06-14 19:50:00 +08:00
mm net/can: Add SO_RCVBUF option for can socket 2024-06-14 19:54:07 +08:00
net net/tcp: fix missing error code propagation 2024-06-22 19:26:14 -03:00
openamp openamp/libmetal.cmake: sync with libmetal.defs 2024-03-28 16:07:49 +08:00
pass1 passl: Author Gregory Nutt: update licenses to Apache 2021-02-09 01:21:53 -08:00
sched sched/signal: reclaim dynamic sigactions 2024-06-21 22:45:52 +08:00
syscall sem_open: return error code, sem returned by parameter 2024-06-06 02:40:50 +08:00
tools tools/ci/docker/linux/Dockerfile: add AVR32 GCC toolchain 2024-06-18 23:15:39 +08:00
video build: add initial cmake build system 2023-07-08 13:50:48 +08:00
wireless Remove the back slash from long literal string 2024-02-19 16:43:15 +01:00
.asf.yaml feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
.gitignore fs/vfat: Fix typo in the macro DIRSEC_BYTENDX 2024-02-03 12:46:08 -03:00
.yamllint feat: add a GitHub action to lint the YAML files 2020-12-15 09:52:04 -06:00
AUTHORS AUTHORS: add Tomek CEDRO to the list 2023-03-07 14:15:55 +01:00
CMakeLists.txt cmake:bugfix CMake compilation options settings should not use strings 2024-05-30 10:02:10 -03:00
CONTRIBUTING.md Remove the tail spaces from all files except Documentation 2023-02-26 13:24:24 -08:00
INVIOLABLES.md
Kconfig Kconfig: move LTO options to Build Setup menu 2024-06-02 09:26:35 -03:00
LICENSE RP2040: Implement board_uniqueid() 2024-03-17 10:00:25 -03:00
Makefile tools:fix some error use of shell command in Windows native build 2022-11-06 16:41:49 +08:00
NOTICE Remove the double blank line from source files 2022-02-20 20:10:14 +01:00
README.md Gathering community recommendations 2023-10-28 13:55:56 +08:00
ReleaseNotes Documentation: move ReleaseNotes 2023-09-26 20:41:00 +08:00

POSIX Badge License Issues Tracking Badge Contributors GitHub Build Badge Documentation Badge

Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).

For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.

Getting Started

First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.

Documentation

You can find the current NuttX documentation on the Documentation Page.

Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.

The old NuttX documentation is still available in the Apache wiki.

Supported Boards

NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.

Contributing

If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.

License

The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.