You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "casaroli (via GitHub)" <gi...@apache.org> on 2026/10/13 12:39:15 UTC
[PR] libs/libc/stdlib: Raise SIGABRT in abort(). [nuttx]
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] libs/libc/stdlib: Raise SIGABRT in abort(). [nuttx]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20634:
URL: https://github.com/apache/nuttx/pull/20634#issuecomment-6173326532
<!-- nuttx-depends-on-bot run-38551251861 -->
### 🔗 Cross-repo PR dependencies
The read-only Build run reported the following dependent PR(s) and fetched head SHA(s):
- https://github.com/apache/nuttx/pull/20654 @ 5585ef268c
CI run: https://github.com/apache/nuttx/actions/runs/38551251861
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] libs/libc/stdlib: Raise SIGABRT in abort(). [nuttx]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20634:
URL: https://github.com/apache/nuttx/pull/20634#issuecomment-6156488491
<!-- membrowse-pr-comment -->
## <img src="https://membrowse.com/membrowse-logo.svg" height="24" align="top"> MemBrowse Memory Report
### [esp32-devkitc](https://membrowse.com/public/apache/nuttx/target/esp32-devkitc/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- **ROM**: .flash.text +708 B (+0.6%, 125,860 B / 4,194,272 B, total: 3% used)
- **irom0_0_seg**: .flash.text +708 B (+0.8%, 90,064 B / 3,342,304 B, total: 3% used)
### [qemu-armv8a](https://membrowse.com/public/apache/nuttx/target/qemu-armv8a/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- **Code**: .text.abort +76 B (+0.0%, 347,664 B)
### [qemu-intel64](https://membrowse.com/public/apache/nuttx/target/qemu-intel64/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- **Code**: .text +176 B (+0.0%, 8,682,688 B)
### [rx65n-rsk2mb](https://membrowse.com/public/apache/nuttx/target/rx65n-rsk2mb/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- **ROM**: .text +176 B (+0.2%, 87,252 B / 2,097,152 B, total: 4% used)
### [s698pm-dkit](https://membrowse.com/public/apache/nuttx/target/s698pm-dkit/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- **Code**: .text +656 B (+0.2%, 375,328 B)
*No memory changes detected for:*
- [arduino-mega2560](https://membrowse.com/public/apache/nuttx/target/arduino-mega2560/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- [hifive1-revb](https://membrowse.com/public/apache/nuttx/target/hifive1-revb/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- [mirtoo](https://membrowse.com/public/apache/nuttx/target/mirtoo/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
- [stm32-nucleo-f103rb](https://membrowse.com/public/apache/nuttx/target/stm32-nucleo-f103rb/compare?head=5b2033af516cc24b115e4353b09ded36d9d9fc70&base=bb4d8691759e59aaab6f9fb604a29cf3e6d3705a)
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] libs/libc/stdlib: Raise SIGABRT in abort(). [nuttx]
Posted by "casaroli (via GitHub)" <gi...@apache.org>.
casaroli closed pull request #20634: libs/libc/stdlib: Raise SIGABRT in abort().
URL: https://github.com/apache/nuttx/pull/20634
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] libs/libc/stdlib: Raise SIGABRT in abort(). [nuttx]
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #20634:
URL: https://github.com/apache/nuttx/pull/20634
--
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: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org