[issue33329] sigaddset() can fail on some signal numbers
Adhemerval Zanella <zatr...@gmail.com> added the comment: What I mean is for master glibc, which contains BZ#22391, 'sigaddset' will fail do add signal 32 and 33. But since you are now ignoring 'sigaddset' return code, it does not matter. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33329> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33329] sigaddset() can fail on some signal numbers
Adhemerval Zanella <zatr...@gmail.com> added the comment: Yes, this is the issue I referred in previous comment [1]. Unfortunately it is only fixed on master (which will become 2.28). [1] https://sourceware.org/bugzilla/show_bug.cgi?id=22391 -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33329> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33329] sigaddset() can fail on some signal numbers
Adhemerval Zanella <zatr...@gmail.com> added the comment: Yes I am aware, but I can't see a really portable way to provide the same functionality as 'sigfillset'. Ideally a libc implementation would return EINVAL on 'sigaddset' for invalid signals, but even for glibc this is not true (the very issue I fixed). -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33329> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33329] sigaddset() can fail on some signal numbers
Adhemerval Zanella <zatr...@gmail.com> added the comment: One option would be to create a list of possible defined signals and check if the signal is on the list. For realtime signals, it just a matter to check if SIGRTMIN <= signal <= SIGRTMAX. The glibc defined signals can be checked at tst-signal.c [1] or from main signal(7). It should cover usual ISO C, POSIX, and some linux arch-specific signals, but you will still need to check if other OS defined extra signals uses elsewhere (another option would to add this check only for Linux/glibc). [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=signal/tst-sigset.c;h=a2b764de5ad66ee960c94ec18df75a07fce4b9a6;hb=HEAD -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33329> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33329] sigaddset() can fail on some signal numbers
Adhemerval Zanella <zatr...@gmail.com> added the comment: Also keep in mind that POSIX [1] specifies that sigaddset *may* fail with EINVAL for not support signals, so a conforming implementation may not fail on sigaddset and still remove the internal signal in a sigprocmask (uclibc for instance). [1] http://pubs.opengroup.org/onlinepubs/9699919799/ -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33329> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33329] sigaddset() can fail on some signal numbers
Adhemerval Zanella <zatr...@gmail.com> added the comment: Why not export and use the canonical way of sigemptyset/sigfillset/sigaddset/sigdelset/sigismember instead of pushing for more potential non-conformant code? For glibc sigfillset will correctly fill all the signal set structure while removing the internal used signals. This is par what POSIX specifies [1] where it states that: 'either sigemptyset() or sigfillset() must be called prior to any other use of the signal set' And more importantly: 'For example, blocking or ignoring an implementation-defined signal may have undesirable side-effects, whereas the default action for that signal is harmless. In such a case, it would be preferable for such a signal to be excluded from the signal set returned by sigfillset().' Also keep that since is an implementation detail, different libcs can use different internal signals. UCLIBC, for instance, uses the same 2 signals as GLIBC, however MUSL allocates signal 32, 33, and 34 for internal usage (and excludes in sigfillset and warns with EINVAL on sigaddset). [1] http://pubs.opengroup.org/onlinepubs/9699919799/ -- nosy: +azanella ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33329> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com