A real time signal is frequently sent as a SIGIO signal instead of its assigned real-time signal number.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
New
|
Undecided
|
Unassigned |
Bug Description
I use real-time signals on several network sockets(accepts and receives.) I recently updated from Stretch to Bullseye via Buster and noticed that Bullseye's and Buster's kernels do not process real-time signals the same as stretch. It appears the kernel will frequently replace the real-time signals with a SIGIO signal. This should only occur when the kernel real-time signal queue is full. These signal are only generated a few at a time in slow intervals of more than a few seconds between socket stream accept/receive event pairs. I have increased the process real-time queue size by 1000 successfully using "setrlimit(
Because the code was not changed between OS changes and the code has run almost continuously(except for power fails) since 2020 without a single signal problem I conclude that a kernel bug or restriction must have been introduced.
Tom
Hardware: RPI 2
uname -a
Linux garage 6.1.54-v7+ #1682 SMP Wed Sep 20 15:16:25 BST 2023 armv7l GNU/Linux
/etc/os-release
PRETTY_
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_
ID=raspbian
ID_LIKE=debian
HOME_URL="http://
SUPPORT_URL="http://
BUG_REPORT_URL="http://
My program is over 11,000+ lines of C++ code in 48 files so won't send it, but this routine show the essential signal setup:
-------
/******
/*This Function sets up a signal call back function '(*call_back)()' to be
called asynchronously when I/O is available on the file descriptor 'fd'.
The siganl system is set to restart if possible any system calls that are
interrupted and to send the signal information data with the call back
function 'call_back_func()'. (See sigaction() in Linux manuals.) This
signal is blocked until we return or use the signal masking functions
to change the signals blocking state. The signal call back function is
retained until specifically changed(unlike when using 'signal()'.)
Real Time signals are queued to a MAX depth set by the system. There are
approximtely 32 RT signals available SIGRTMIN to SIGRTMAX.
Input:
wait: 0 => Set I/O mode non-blocking on file descriptor 'fd'.
rt_sig_no: Real time signal number to use. If 'rt_sig_no' is
Return:
0 => Success.
-1 => Failure, global variable "errno" has error code.
*/
int set_io_async(int fd,void (*call_back)(int signum, siginfo_t *siginfo,
{
int flags;
struct rlimit rlim;
struct sigaction new_signal_handler;
struct sigaction org_signal_handler;
DBPRINTF(
{static bool first_time=TRUE;
if(first_time){
/*Show SIGPOLL real-time signal queue size.*/
if(
}
else{
" (soft=%
}
#if (NETIO_
if(
else
/*Set new RT signal queue size.*/
if(
LPRINTF(
DBPRINTF(
}
else{
LPRINTF(
DBPRINTF(
}
#endif
}
}
#ifdef NETIO_MONITOR_SIGIO
{
struct sigaction sigio_signal_
/*Setup new sigio signal handler struct.*/
sigio_
sigemptys
sigio_
/*Setup our sigio signal handler.*/
if(
}
}
#endif //NETIO_
/*Setup new signal handler struct.*/
new_
sigemptyset(
new_
/*Setup our signal handler.*/
if(sigaction
DBPRINTF(
return(-1);
}
-------
logged output from initial call to above routine:
[02/01/24 10:01:52]
Real-time signal queue length limits(
(soft=
}
[02/01/24 10:01:52]
setrlimit(
}