<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'> Hi,<BR> <BR>I have a simple program that uses real-time signals on Linux Ubuntu 14.04:<BR> <BR><blockquote style="margin-right: 0px;" dir="ltr"><font face="Courier New,sans-serif" size="2">$ cat rt.cpp<br>#include <iostream><br>#include <sys/mman.h><br>#include <signal.h><br>#include <assert.h><br>#include <sys/types.h><br>#include <unistd.h></font><BR><br><font face="Courier New,sans-serif" size="2">void handler(int sig, siginfo_t* info, void* context)<br>{<br> std::cout << "signal " << sig << " received with value " << info->si_value.sival_in << "\n";<br>}</font><BR><font face="Courier New,sans-serif" size="2">int main()<br>{<br> int signo = SIGRTMIN + 1;</font><BR><font face="Courier New,sans-serif" size="2"> if (SIGRTMAX > SIGRTMIN)<br> {<br> struct sigaction action;<br> action.sa_sigaction = handler;<br> action.sa_flags = SA_SIGINFO;</font><BR><font face="Courier New,sans-serif" size="2"> sigaction(signo, &action, NULL);</font><BR><font face="Courier New,sans-serif" size="2"> for (int i = 0; i < 3; ++i)<br> {<br> sigval value;<br> value.sival_int = i + 10;<br> sigqueue(getpid(), signo, value);<br> }<br> }<br> else<br> {<br> std::cerr << "real-time signals not supported";<br> }<br>}</font><br><BR></blockquote>This program works correctly standalone. GDB is capable of intercepting this signal and continue. LLDB-3.6 that I installed using apt-get does not intercept the signal but the program still receives it. But LLDB 3.7 that I built from sources from <font face="Courier New">http://llvm.org/svn/llvm-project/lldb/trunk </font> simply swallows the signals. I think GDB behavior is the best option, but I could live with 3.6 behavior.<BR> <BR>Is this a known problem? Is there a workaround or fix I can apply locally?<BR> <BR>Thanks,<BR>Eugene<BR> <BR><font face="Courier New,sans-serif" size="2">$ cat rt.cpp<br>#include <iostream><br>#include <sys/mman.h><br>#include <signal.h><br>#include <assert.h><br>#include <sys/types.h><br>#include <unistd.h></font><BR><br><font face="Courier New,sans-serif" size="2">void handler(int sig, siginfo_t* info, void* context)<br>{<br> std::cout << "signal " << sig << " received with value " << info->si_value.sival_in << "\n";<br>}</font><BR><font face="Courier New" size="2"></font> <BR><font face="Courier New,sans-serif" size="2">int main()<br>{<br> int signo = SIGRTMIN + 1;</font><BR><font face="Courier New,sans-serif" size="2"> if (SIGRTMAX > SIGRTMIN)<br> {<br> struct sigaction action;<br> action.sa_sigaction = handler;<br> action.sa_flags = SA_SIGINFO;</font><BR><font face="Courier New,sans-serif" size="2"> sigaction(signo, &action, NULL);</font><BR><font face="Courier New,sans-serif" size="2"> for (int i = 0; i < 3; ++i)<br> {<br> sigval value;<br> value.sival_int = i + 10;<br> sigqueue(getpid(), signo, value);<br> }<br> }<br> else<br> {<br> std::cerr << "real-time signals are not supported";<br> }<br>}</font><BR> <BR><font face="Courier New,sans-serif" size="2">$ ./rt<br>signal 35 received with value 10<br>signal 35 received with value 11<br>signal 35 received with value 12</font><BR><font face="Courier New,sans-serif" size="2"></font> <BR><font face="Courier New,sans-serif" size="2">$ ~/llvm/bin/lldb ./rt<br>(lldb) target create "./rt"<br>Current executable set to './rt' (x86_64).<br>(lldb) pr lau<br><font style="background-color: rgb(255, 255, 0);">Process 18697 launched: './rt' (x86_64)<br>Process 18697 exited with status = 0 (0x00000000)</font><br>(lldb) q<br><br>$ lldb-3.6 ./rt<br>(lldb) target create "./rt"<br>Current executable set to './rt' (x86_64).<br>(lldb) pr lau<br>Process 18674 launching<br>Process 18674 launched: './rt' (x86_64)<br>signal 35 received with value 10<br>signal 35 received with value 11<br>signal 35 received with value 12<br>Process 18674 exited with status = 0 (0x00000000)<br>(lldb) q</font><BR><font face="Courier New,sans-serif" size="2"></font> <BR><font face="Courier New,sans-serif" size="2">$ gdb --quiet ./rt<br>Reading symbols from ./rt...done.<br>(gdb) r<br>Starting program: /home/eugene/Z/tmp/rt</font><BR><font face="Courier New,sans-serif" size="2">Program received signal SIG35, Real-time event 35.<br>0x00007ffff722cfc4 in __sigqueue (pid=18662, sig=35, val=...) at ../sysdeps/unix/sysv/linux/sigqueue.c:46<br>46 ../sysdeps/unix/sysv/linux/sigqueue.c: No such file or directory.<br>(gdb) c<br>Continuing.<br>signal 35 received with value 10</font><BR><font face="Courier New,sans-serif" size="2">Program received signal SIG35, Real-time event 35.<br>0x00007ffff722cfc4 in __sigqueue (pid=18662, sig=35, val=...) at ../sysdeps/unix/sysv/linux/sigqueue.c:46<br>46 in ../sysdeps/unix/sysv/linux/sigqueue.c<br>(gdb) c<br>Continuing.<br>signal 35 received with value 11</font><BR><font face="Courier New,sans-serif" size="2">Program received signal SIG35, Real-time event 35.<br>0x00007ffff722cfc4 in __sigqueue (pid=18662, sig=35, val=...) at ../sysdeps/unix/sysv/linux/sigqueue.c:46<br>46 in ../sysdeps/unix/sysv/linux/sigqueue.c<br>(gdb) c<br>Continuing.<br>signal 35 received with value 12<br>[Inferior 1 (process 18662) exited normally]<br>(gdb) q<br></font><BR> </div></body>
</html>