casaroli opened a new pull request, #20634:
URL: https://github.com/apache/nuttx/pull/20634

   ## Summary
   
   `abort()` calls `_exit()` at once. A handler of SIGABRT never runs, and the 
comment above the function, which describes the POSIX behavior, is not true.
   
   With `CONFIG_ENABLE_ALL_SIGNALS`, this PR unblocks and raises SIGABRT. If a 
handler returns, or SIGABRT is ignored, it restores the default action and 
raises SIGABRT again. `_exit()` stays as the last step, so `abort()` never 
returns.
   
   ## Impact
   
   `abort()` with `CONFIG_ENABLE_ALL_SIGNALS`. A SIGABRT handler now runs. The 
default action of SIGABRT ends the process, as before. Without 
`CONFIG_ENABLE_ALL_SIGNALS` there is no change.
   
   ## Testing
   
   `qemu-armv8a:knsh`, with this commit on a larger local branch. A test 
program sets the action of SIGABRT and calls `abort()`. Results after this PR:
   
   - a handler that writes a message and calls `_exit(7)`: the message comes 
out, and the exit status is 7;
   - a handler that writes a message and returns: the message comes out, and 
the process ends;
   - `SIG_IGN`: the process ends.
   
   In no case does `abort()` return. Before this PR, the handlers did not run, 
and the process exited with status 1 in all three cases.
   
   Build: `qemu-armv8a:nsh`, `qemu-armv8a:knsh` and `lm3s6965-ek:qemu-flat`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to