From mboxrd@z Thu Jan 1 00:00:00 1970 From: pierre-marc.fournier@polymtl.ca (Pierre-Marc Fournier) Date: Thu, 27 May 2010 12:08:40 -0400 Subject: [ltt-dev] UST use case: Tracing QEMU/KVM In-Reply-To: <20100524084150.GA2447@stefan-thinkpad.transitives.com> References: <20100524084150.GA2447@stefan-thinkpad.transitives.com> Message-ID: <4BFE9908.7000500@polymtl.ca> Stefan Hajnoczi wrote: > /* > * This example demonstrates the UST listener thread receiving signals and > * returning from poll(). > * > * $ gcc -o poll_eintr poll_eintr.c -lust -lpthread > * $ ./poll_eintr > * main thread id=0x7f9c31a766a0 > * ^CSIGINT handled in thread id=0x7f9c30ed7910 > * libust[2615/2616]: Error: poll: Interrupted system call (in multipoll_poll() at ../libustcomm/multipoll.c:84) > * libust[2615/2616]: Error: error in multipoll_poll (in listener_main() at tracectl.c:1015) > * > * This happens because all other threads have SIGINT blocked, whereas libust > * does not block signals in the client thread. Therefore the signal is > * handled in the client thread, poll() is interrupted, and an error is > * printed. > * > * I think the correct behavior is to block signals in the client thread so it > * will not interfere with signal handling of the main program. > */ I completely agree. I just pushed a change that blocks all signals in the listener thread. Thanks!