Hello all,
My issue is related to testing the SIGKILL in Nuttx and not making it work
correctly.
Description:
=========
I am using a ESP32 DevKitC Board using default NSH configuration.
1) Enabled CONFIG_SIG_DEFAULT=y and CONFIG_SCHED_HAVE_PARENT=y
2) After starting the board, type "sh" + <enter> 3 times. Run "ps":
nsh> sh
nsh> sh
nsh> sh
nsh> ps
PID PPID PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK
COMMAND
0 0 0 FIFO Kthread N-- Ready 00000000 003072
Idle Task
1 0 100 RR Task --- Waiting Signal 00000000 002096 init
4 1 100 RR Task --- Waiting Signal 00000000 002096 sh
5 4 100 RR Task --- Waiting Signal 00000000 002096 sh
6 5 100 RR Task --- Running 00000000 002096 sh
3) kill the parent "sh" and try to run "ps"
Result is a situation where it is very hard to type any command, as seen
below:
nsh> kill -9 4
nsh> nsh>
nsh>
nsh> ps
nsh: p: command not found
nsh> sp
nsh: ss: command not found
nsh> ps
nsh: pp: command not found
nsh> ss
nsh: ss: command not found
nsh> pps
nsh: p: command not found
nsh> ps
nsh: spsp: command not found
nsh> sp
nsh: ss: command not found
nsh> sp
PID PPID PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK
COMMAND
0 0 0 FIFO Kthread N-- Ready 00000000 003072
Idle Task
1 0 100 RR Task --- Ready 00000000 002096 init
5 4 100 RR Task --- Waiting Signal 00000000 002096 sh
6 5 100 RR Task --- Running 00000000 002096 sh
4) As above, none of the children were killed... and I think that init (pid
1) and sh (pid 6) are both reading the console input, generating all those
"sort of typing errors" above. I had to type "sp" to run "ps".
Question:
Do I need to set up some other option on menuconfig in order to kill the
pid of the parent and all its children all together?
Best Regards,
Rodrigo Garcia.