<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'>Hello,<BR> <BR>I debugged signal processing a bit, and I think that the right solution would be just to add these signals to the list of known signals. I.e. in LinuxSignals.cpp:<BR> <BR><font face="Courier New,sans-serif" size="2">void<br>LinuxSignals::Reset()<br>{<br> m_signals.clear();</font><BR><font face="Courier New,sans-serif" size="2"> AddSignal (1, "SIGHUP", "HUP", false, true , true , "hangup");<br> AddSignal (2, "SIGINT", "INT", true , true , true , "interrupt");<br> AddSignal (3, "SIGQUIT", "QUIT", false, true , true , "quit");<br> AddSignal (4, "SIGILL", "ILL", false, true , true , "illegal instruction");<br> AddSignal (5, "SIGTRAP", "TRAP", true , true , true , "trace trap (not reset when caught)");<br> AddSignal (6, "SIGABRT", "ABRT", false, true , true , "abort()");<br> AddSignal (6, "SIGIOT", "IOT", false, true , true , "IOT trap");<br> AddSignal (7, "SIGBUS", "BUS", false, true , true , "bus error");<br> AddSignal (8, "SIGFPE", "FPE", false, true , true , "floating point exception");<br> AddSignal (9, "SIGKILL", "KILL", false, true , true , "kill");<br> AddSignal (10, "SIGUSR1", "USR1", false, true , true , "user defined signal 1");<br> AddSignal (11, "SIGSEGV", "SEGV", false, true , true , "segmentation violation");<br> AddSignal (12, "SIGUSR2", "USR2", false, true , true , "user defined signal 2");<br> AddSignal (13, "SIGPIPE", "PIPE", false, true , true , "write to pipe with reading end closed");<br> AddSignal (14, "SIGALRM", "ALRM", false, false, false, "alarm");<br> AddSignal (15, "SIGTERM", "TERM", false, true , true , "termination requested");<br> AddSignal (16, "SIGSTKFLT", "STKFLT", false, true , true , "stack fault");<br> AddSignal (16, "SIGCLD", "CLD", false, false, true , "same as SIGCHLD");<br> AddSignal (17, "SIGCHLD", "CHLD", false, false, true , "child status has changed");<br> AddSignal (18, "SIGCONT", "CONT", false, true , true , "process continue");<br> AddSignal (19, "SIGSTOP", "STOP", true , true , true , "process stop");<br> AddSignal (20, "SIGTSTP", "TSTP", false, true , true , "tty stop");<br> AddSignal (21, "SIGTTIN", "TTIN", false, true , true , "background tty read");<br> AddSignal (22, "SIGTTOU", "TTOU", false, true , true , "background tty write");<br> AddSignal (23, "SIGURG", "URG", false, true , true , "urgent data on socket");<br> AddSignal (24, "SIGXCPU", "XCPU", false, true , true , "CPU resource exceeded");<br> AddSignal (25, "SIGXFSZ", "XFSZ", false, true , true , "file size limit exceeded");<br> AddSignal (26, "SIGVTALRM", "VTALRM", false, true , true , "virtual time alarm");<br> AddSignal (27, "SIGPROF", "PROF", false, false, false, "profiling time alarm");<br> AddSignal (28, "SIGWINCH", "WINCH", false, true , true , "window size changes");<br> AddSignal (29, "SIGPOLL", "POLL", false, true , true , "pollable event");<br> AddSignal (29, "SIGIO", "IO", false, true , true , "input/output ready");<br> AddSignal (30, "SIGPWR", "PWR", false, true , true , "power failure");<br> AddSignal (31, "SIGSYS", "SYS", false, true , true , "invalid system call");</font><BR><font face="Courier New" size="2"></font> <BR><font face="Courier New,sans-serif" size="2"><font style="background-color: rgb(255, 255, 0);"> // Add real-time signals<br> for (int rtsig = SIGRTMIN + 1; rtsig < SIGRTMAX; ++rtsig)<br> {<br> char signame[16];<br> char sigdescr[64];<br> ::snprintf(signame, sizeof(signame), "SIG%d", rtsig);<br> ::snprintf(sigdescr, sizeof(sigdescr), "Real-time event %d", rtsig);<br> AddSignal (rtsig, signame, signame, false, true, true, sigdescr);<br> }</font><br>}</font><br><BR>Thanks,<BR>Eugene <BR><div><hr id="stopSpelling">From: eugenebi@hotmail.com<br>To: lldb-dev@cs.uiuc.edu<br>Date: Tue, 19 May 2015 10:22:14 -0700<br>Subject: [lldb-dev] LLDB 3.7 swallows real-time signals<br><br>
<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style>
<div dir="ltr"> Hi,<br> <br>I have a simple program that uses real-time signals on Linux Ubuntu 14.04:<br> <br><blockquote 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>
<br>_______________________________________________
lldb-dev mailing list
lldb-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</div> </div></body>
</html>