RTEMS | sigtimedwait() only clear a signal when EINTR (!415)

yang zhang (@yang.zhang) gitlab at rtems.org
Tue Feb 11 08:00:37 UTC 2025



yang zhang created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/415

Project:Branches: yang.zhang/rtems:fix_sigtimedwait to rtems/rtos/rtems:main
Author:   yang zhang




## Summary

When a thread is unblocked from `sigtimedwait`, it maybe `ETIMEOUT` or
`EINTR`. If `ETIMEOUT`, there is no pending signals, never and is not
necessary to call `_POSIX_signals_Clear_signals` because of `the_info->si_signo`
is `-1`.

Should validate the signal passed into `_POSIX_signals_Clear_signals`.
For example, i test on `aarch64/zynqmp_qemu`, when `signo` is `-1`, after
`signo_to_mask(signo)` which using `lsl` instruction, the `mask` is `0x40000000`,
so the `signo` unexpectedly becomed `31` from `-1`.


<!-- Default settings, if it is a dropdown it will set after submission -->

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/415
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250211/ba01ab19/attachment.htm>


More information about the bugs mailing list