signal

MultithreadingMultiprocessing with STOP and Continue Signals

Hello ALL, I am working on a project, where i need to get native stack of the Java Application. i am able to achieve this partially. thanks to ptrace/multiprocessing and signals. on Linux normal java application has minimum 14 number of threads. out of these 14 i am interested in only main thread of which i have to get native stack. co...

How to reset SIGINT to default after pointing it some user-defined handler for some time?

I use signal(SIGINT,my_handler) to point SIGINT to my_handler. After some time I want to reset it to whatever default handler it points to in general. How can I do that? ...

c++ Qt SIGNAL and SLOT not firing

Hi All I am new to C++ Qt programming. Having difficulty with hooking up buttons to signals and events. Not sure what i'm doing wrong, please see code below. Main.cpp #include <QtGui/QApplication> #include "MainWidget.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWidget mainWidget; mainWidget.s...

Program received signal: "0".

Hi Alls, I am getting following error on my application: Program received signal:"0". Data Formatters temporarily unavaliable, will re-try after a "continue". (Unknown error loading shared library "/Developer/usr/lib'libXcodeDebuggerSuppot.dylib"). Above words appeared when I ran the application on a ipad connecting with the compiter. ...

How can I know the current state of signals

Hi, Is there a way in C to know the following information about signals: Is certain signal is blocked now? Are we inside a signal handling function chanin (i.e, was the current code called from function which was called as signal handler for certain signal)? If so, can I know what is the current signal? Thanks ...

Python - signal.alarm function

Dear All, I'm trying to build a python timeout exception that runs in milliseconds. The python signal.alarm function has a 1 second resolution. How would one get an equivalent function that requests a SIGALRM signal to a given process in, say milliseconds, as opposed to seconds? I've found no simple solutions as of yet. Thanks in ad...

Trouble sending signal to child process in C

I've been trying to figure out if this is possible the way I've done it or not. This program should fork a child process that loops printing to STDOUT, and the parent should exit to return the terminal prompt. The child should then be waiting for SIGINT to tell it when to close down. However I remember reading that SIGINT is only send...

What happens when the controlling terminal's cable is pulled out?

I am trying to handle a signal(if it exists/is sent) when an application's controlling terminal's network cable is pulled out. I tried with these signals, but I guess they aren't: SIGHUP SIGINT SIGTERM I guess in such a case, the server treats the termianl(who's cable was pulled out) just to be in an inactive state. Please su...

What's the best way to signal threads that sleep or block to stop?

I've got a service that I need to shut down and update. I'm having difficulties with this in two different cases: I have some threads that sleep for large amounts of time. Obviously I can't wait for them to wake up to finish shutting down the service. I had a thought to use an AutoResetEvent that gets set by some controller thread when...

Can't build sigqueue example with gcc but g++ is ok?

Hi I have a strange build problem. I have a simple test program that sends a sigqueue to another process. This little code example builds and runs when I build it as a c++ program (compiled with g++) but when I compile it as a c program (with gcc) I get a error that he can't find the sigval struct. The short example: #include <std...

Accurate signal delay calculation in Python

Hi, I'm trying to calculate the lag between two signals in Python using cross correlation. The two signals are almost identical except for a very small timelag. I've tried numpy.correlate and scipy.convolve (alot faster) and both works relatively well but gives a small error. I'm starting to suspect that the error is the result of Pytho...

Handled signal in Python causes FTP connection to interrupt

This scripts checks an FTP and download files at scheduled intervals. Sending to it the right signal (SIGUSR1) should make it close gracefully, waiting checkAll to complete, if running. class ScheduledFtpCheck(FtpCheck, Scheduler): def __init__(self): ... self.aborted, self.checking = False, False def abort(s...

PyBluez - How can I find the signal strength between me and a device?

I'm looking into making a Python app that utilizes the PyBluez module to scan for devices and log their MAC address and signal strength. From looking at (code.google.com/p/pybluez/source/browse/trunk/examples/simple/asynchronous-inquiry.py), it seems very easy to scan for the devices and get their MAC address. What I can't find how to d...

How do I get signal details in debugger while ptrace?

I have a debugger that I am porting over to *bsd from linux. Currently, I am working on the OpenBSD version. Under certain conditions I would like to know the details of the signal that was delivered. For example, suppose a SIGSEGV was delivered, I'd like to know what the faulting address was, and if possible, if it was a read or write....

PyQt (or just QT). How to get QComboBox to fire a signal whenever it is set to a value (even if unchanged)

I am using PyQt4, but this is general enough that it could just apply to QT. I have a series of QComboBoxes that I fill from left to right (i.e. selecting an item in the leftmost will populate the next one. Selecting an item in that one will populate the next, and so on) I am having difficulty getting my signals to fire under all situa...

How is catching SIGSEGV different on Win32 than on Unix?

I am writing code that needs to compile and run without error on both Unix/Mac (with GCC) and on Win32 (with mingw). The code has to run in a wide variety of different environments and it has loadable modules that I can't control, so I typically protect each module with a setjmp() and signal(). I see that WIN32 has both setjmp() and si...

Signal Dispositions in Pthreads

The man page for pthreads mentions: POSIX.1 also requires that threads share a range of other attributes (i.e., these attributes are process-wide rather than per-thread): ... - signal dispositions ... What do "signal dispositions" mean? ...

Guitar Chord Recognition Algorithm?

Hi! Whats a good digital signal processing algorithm that is good on guitar chords? Since Fast Fourier Transform I think only is accurate on single notes played on the guitar but not notes that are played simultaenously (i.e. chords). Thanks! ...

Keyboard signal handling, adding parameters to callback handler function (Ubuntu, intel)

I have this code: #include <stdio.h> #include <stdlib.h> #include <signal.h> // Define the function to be called when ctrl-c (SIGINT) signal is sent to process void signal_callback_handler(int signum) { printf("Caught signal %d\n",signum); // Cleanup and close up stuff here // Terminate program exit(signum); } int main() ...

How to release the reference of bind arguments boost::signals2::signal keeps?

I found some objects in my C++ program can't be released due to the Signal2 of boost won't release those arguments in object created by boost::bind. Here is the code to reproduce the problem: #include <iostream> #include <string> #include <boost/bind.hpp> #include <boost/signals2.hpp> #include <boost/shared_ptr.hpp> using namespace s...