signals

what does “exited abnormally with signal 9: Killed: 9” mean

徘徊边缘 提交于 2019-12-10 12:44:01
问题 How to read error codes which appear in the console? <Warning>: ....... -exited abnormally with signal 9: Killed: 9 <Warning>: ....... -1 err = Bad file descriptor (0x00000009) Here what does signal 9 mean, are there any more signals apart from it. Any documentation available for it. I get this kind of error, when a App. launched from Xcode is terminated by "Stop" button in Xcode toolbar. (Another way to get this error is , to press home button, then double tap home button and close the app.)

SIGCHLD not caught in epoll_wait?

空扰寡人 提交于 2019-12-10 12:19:17
问题 I wanted to understand the behavior of signals on fork. I wrote a small program to catch SIGCHLD with epoll_wait but when I do a "kill -9" on the forked child, I am not getting any signal and the child is in defunct state (I have a handler that does a wait()). Here is the code. //.... sigemptyset(&mask); sigaddset(&mask, SIGCHLD); pthread_sigmask(SIG_BLOCK, &mask, NULL); signal_fd = signalfd(-1, &mask, 0); memset(&tev, 0, sizeof(tev)); tev.events = EPOLLIN | EPOLLONESHOT; tev.data.fd = signal

launchd: sleep in GCD managed signal handler

那年仲夏 提交于 2019-12-10 11:39:34
问题 I encounter a strange situation in a launchd managed daemon when I try to sleep in the SIGTERM handler that is managed with Grand Central Dispatch as described here. Everything works fine and I do get a SIGTERM signal handler before receiving a SIGKILL when I do not sleep in the SIGTERM handler. But as soon as I do sleep -- even for extremly short amounts of time like a usleep(1); -- I do not get a SIGTERM handler at all but instead my daemon is SIGKILLed instantly by launchd. Btw I am using

What does signal(SIGCHLD, SIG_DFL); mean?

走远了吗. 提交于 2019-12-10 11:28:17
问题 I am not handling SIGCHLD in my code. Still my process is removed immediately after termination. I want it to become zombie process. If I set SIGCHLD to SIGDFT then, will it work? How do I set SIGCHLD to SIGDFT? I want process to become zombie, so I can read the child status in parent after waitpid. 回答1: From your question history you seem to be tying yourself in knots over this. Here is the outline on how this works: The default disposition of SIGCHLD is ignore. In other words, if you do

multiple signals for one slot

折月煮酒 提交于 2019-12-10 11:04:19
问题 For my GUI i would like to have two pairs of buttons that scroll up and down a scrollarea. The first set of buttons should work on say scrollarea1 and the second set of buttons should work on a scrollarea2. The widgets that I put in the scrollarea are called viewport1 and viewport2. Since both both set of buttons should do the same (scrolling up and down) I thought I would make two slots called scrollUp and scrollDown that would handle the scrolling for both sets of buttons. Unfortunately I

QNetworkConfigurationManager::configurationChanged signal not getting called for ETHERNET config changes

偶尔善良 提交于 2019-12-10 10:42:28
问题 QNetworkConfigurationManager::configurationChanged() signal is not getting called by the system when I am inserting a LAN cable with a valid IP(Ethernet interface). It is getting called for WLAN and USB interface but not for ETHERNET config changes Hope to get some pointers on this. 来源: https://stackoverflow.com/questions/14359657/qnetworkconfigurationmanagerconfigurationchanged-signal-not-getting-called-for

Qt - How to disable QCheckBox while retaining checked state?

拈花ヽ惹草 提交于 2019-12-10 10:15:31
问题 I have a dialog with two checkboxes, let's call them A and B. When A is NOT checked, B should be able to be toggled as the user desires. When A IS checked, B should not be able to be toggled. Right now I have the following in my constructor function for the dialog: connect(ui->A, SIGNAL(toggled(bool)), this, SLOT(setBCheckable(bool))); ...and then I have that function as this: void MyClass::setBCheckable(bool AChecked) { if(AChecked) { ui->B->setCheckable(false); } else { ui->B->setCheckable

Signal handler won't see global variable

北城以北 提交于 2019-12-10 05:45:11
问题 Here's the problem: this program should receive input from stdin and count the bytes inserted; the SIGUSR1 signal whill stop the main program and will print on file standard error how many bytes have been copied when I send the SIGUSR1. That's how my teacher wants me to do this: in one terminal type cat /dev/zero | ./cpinout | cat >/dev/null while from a second terminal send signals with kill -USR1 xxxx where xxxx is the pid of cpinout. I updated my previous code: /* cpinout.c */ #include

Setting an alarm in milliseconds in C

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 04:26:53
问题 I currently have some C code that uses sigaction to associate a handler to the SIGALRM signal. Then I do alarm(TIME_OUT_IN_SECONDS). Problem is, I need milliseconds, not seconds and alarm takes an integer. How can I set the signal to fire off in milliseconds? 回答1: How about using setitimer()? 来源: https://stackoverflow.com/questions/601012/setting-an-alarm-in-milliseconds-in-c

Handling CPU exceptions in C++

你说的曾经没有我的故事 提交于 2019-12-10 04:17:14
问题 is there a cross-platform way to handle the CPU exceptions like segmentation faults, or division by zero? Lets say, I need to call some potentially unsafe functions (for example from a plug-in file), that can cause a segfault, or some other problems that I cannot test before I execute it. I know, that the C standard library has signal handling functions, but I don't know how to use them to handle the problem to avoid the program termination (I guess, I can't just jump to the location before