Skip to content

Conversation

@extinguish
Copy link

@extinguish extinguish commented Nov 20, 2025

Summary

Depencies: apache/nuttx#17352.

Added support for signal decoupling, primarily involving modifications to the following modules in the apps: ostest, nsh/tools, netutils, and the cu tool.

  1. ostest: When CONFIG_DISABLE_SIGNALS=y, certain tests that rely on signal functionality need to be disabled.
  2. nsh/tools: Functionalities dependent on the signal module have been made configurable, allowing most parts of nsh to remain usable even when CONFIG_DISABLE_SIGNALS=y.
  3. netutils: Ensures basic usability of certain network functionalities when signals are disabled.
  4. cu tool: Refactored portions of the cu module implementation to maintain its usability under signal-disabled conditions.

Impact

No adjustments were made to the functional logic; support was only added for when CONFIG_DISABLE_SIGNALS=y.

Testing

  1. has passed the ostest

1. sigprocmask_test/sighand_test/signest_test/suspend_test: these testcases are using to test the signal api
2. sigev_thread_test: this testcase need to access signal related function
3. timer_test: this testcase need to access signal related function

Signed-off-by: guoshichao <[email protected]>
make the nsh tools can work with SIGNAL disabled

Signed-off-by: guoshichao <[email protected]>
using pthread_cancel to implement the exit logic, thus to make the
netutils tools can work when signal disabled

Signed-off-by: guoshichao <[email protected]>
using the local cu_globals_s instance to manange the cu exit procedure

Signed-off-by: guoshichao <[email protected]>
merge the cu.h to cu_main.c, to make the cu tools code more cleaner

Signed-off-by: guoshichao <[email protected]>
The core functionality of the cu tool does not rely on
signal features. Therefore, we can isolate the signal-related
implementations to ensure that most functions of the
cu tool remain operational even when signals are disabled.

Signed-off-by: guoshichao <[email protected]>
The commit 'add support for CONFIG_DISABLE_SIGNALS' led to:

undefined reference to `signal'
undefined reference to `sigaction'

Signed-off-by: v-tangmeng <[email protected]>
…GNALS

The commit 'add support for CONFIG_DISABLE_SIGNALS' led to:

undefined reference to `sigaction'

Signed-off-by: v-tangmeng <[email protected]>
Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @extinguish great work!

This PR is a prototype for testing and goes in pair with apache/nuttx#17352. Needs careful review and testing. When parent PR is merged this one goes in pair :-)

I am just marking RC here not to merge by accident :-)

@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Nov 24, 2025

Thank you @extinguish great work!

This PR is a prototype for testing and goes in pair with apache/nuttx#17352. Needs careful review and testing. When parent PR is merged this one goes in pair :-)

I am just marking RC here not to merge by accident :-)

@cederom this patch need be merged first to unlock ci error on apache/nuttx#17352. If the community accept to add DISABLE_SIGNALS option, it's better to merge this simple pr first, so we can ensure the kernel side change don't break any build.

@acassis
Copy link
Contributor

acassis commented Nov 24, 2025

@xiaoxiang781216 Do you know if @extinguish is doing it coordinated with @wangchdo ? Otherwise we will have many issues.

@xiaoxiang781216
Copy link
Contributor

@xiaoxiang781216 Do you know if @extinguish is doing it coordinated with @wangchdo ? Otherwise we will have many issues.

@extinguish 's userspace change is the subset of @wangchdo 's since @wangchdo disable the full signal feature.

@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Nov 25, 2025

If the community agree to disable signal with option, it's better to merge this pr first, so both @extinguish and @wangchdo 's change can move forward and verify with ci. @cederom @acassis

@jerpelea jerpelea changed the title add signal decouple support apps: decouple signal support Nov 25, 2025
jerpelea
jerpelea previously approved these changes Nov 25, 2025
@acassis
Copy link
Contributor

acassis commented Nov 25, 2025

@extinguish there are some errors, i.e.:

Configuration/Tool: lm3s6965-ek/qemu-protected,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2025-11-25 09:18:02
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
arm-none-eabi-ld: /github/workspace/sources/nuttx/staging//libapps.a(test_symtab.o):(.rodata.g_elf_exports+0xe4): undefined reference to `register_driver'
arm-none-eabi-ld: /github/workspace/sources/nuttx/staging//libapps.a(test_symtab.o):(.rodata.g_elf_exports+0x15c): undefined reference to `unregister_driver'
make[1]: *** [Makefile:61: nuttx_user.elf] Error 1
make[1]: Target 'all' not remade because of errors.
make: *** [tools/Unix.mk:541: nuttx] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory

@extinguish
Copy link
Author

@extinguish there are some errors, i.e.:

Configuration/Tool: lm3s6965-ek/qemu-protected,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2025-11-25 09:18:02
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
arm-none-eabi-ld: /github/workspace/sources/nuttx/staging//libapps.a(test_symtab.o):(.rodata.g_elf_exports+0xe4): undefined reference to `register_driver'
arm-none-eabi-ld: /github/workspace/sources/nuttx/staging//libapps.a(test_symtab.o):(.rodata.g_elf_exports+0x15c): undefined reference to `unregister_driver'
make[1]: *** [Makefile:61: nuttx_user.elf] Error 1
make[1]: Target 'all' not remade because of errors.
make: *** [tools/Unix.mk:541: nuttx] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory

this is fixed in updated pull request

@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Nov 25, 2025

@extinguish but the same error still report.

@extinguish
Copy link
Author

@extinguish but the same error still report.

Got it, I'm fixing it now, this is a new issue introduced by supporting the protect build process for mksym_tab.c.

@extinguish
Copy link
Author

@extinguish but the same error still report.

the "examples/elf project refactor and disable signal procedure" is separate to a new pull request, and the new pull request is based on #3223, after #3223 is review passed and merged, the examples/elf refactor pull request will upstreaming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants