Sanjoy Mahajan wrote:
I don't know whether the Debian maintainer forward this report to you.
It still puzzles me how strace can crash a process (in this case by
generating bizarre signals), so I'm not 100% sure it's a pdnsd bug.
-Sanjoy
Thank you for bringing this problem to my attention. I have been able to
reproduce the problem with strace on a Fedora Core 4 system.
Apparently strace causes sigwait to return EINTR, which is inconsistent
with the documentation I could find on sigwait.
I have written a patch which allows sigwait to be retried if it returns
EINTR. This allows strace to attach to pdnsd without causing it to exit.
You wont get much useful information this way, because strace only
attaches to the main thread which normally doesn't do much except wait
for a signal.
Please try the patch (made against pdnsd version 1.2.3) in the
attachment and let me know if it solves your problem with putting your
system to sleep as well as strace.
--
Paul Rombouts
--- src/main.c~ 2005-07-08 20:13:14.0 +0200
+++ src/main.c 2005-07-29 16:16:12.0 +0200
@@ -659,11 +659,20 @@
pthread_sigmask(SIG_BLOCK,sigs_msk,NULL);
waiting=1;
#endif
- sigwait(sigs_msk,sig);
- DEBUG_MSG(Signal %i caught.\n,sig);
+ {
+ int err;
+ while ((err=sigwait(sigs_msk,sig))) {
+ if(err!=EINTR) {
+log_warn(sigwait failed: %s,strerror(err));
+sig=0;
+break;
+ }
+ }
+ }
+ if(sig) DEBUG_MSG(Signal %i caught.\n,sig);
write_disk_cache();
destroy_cache();
- log_warn(Caught signal %i. Exiting.,sig);
+ if(sig) log_warn(Caught signal %i. Exiting.,sig);
if (sig==SIGSEGV || sig==SIGILL || sig==SIGBUS)
crash_msg(This is a fatal signal probably triggered by a bug.);
if (ping_isocket!=-1)