Bug#319572: strace crashes pdnsd

2006-04-04 Thread Y Giridhar Appaji Nag
tags 319572 + patch
tags 319572 + confirmed
tags 319572 + fixed-upstream
thanks

On 05/07/29 18:26 +0100, Sanjoy Mahajan said ...
  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.
 
 Thanks, that patch fixes both problems.  Now pdnsd can be straced, and
 it is still running fine after a wakeup from S3.  I wonder if a

Tagging this bug since upstream version 1.2.4-par fixes this issue with
the patch suggested in one of the above exchanges.

Giridhar

-- 
Y Giridhar Appaji Nag | http://www.appaji.net/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#319572: strace crashes pdnsd

2005-07-29 Thread Paul A. Rombouts

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)



Bug#319572: strace crashes pdnsd

2005-07-29 Thread Sanjoy Mahajan
 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.

Thanks, that patch fixes both problems.  Now pdnsd can be straced, and
it is still running fine after a wakeup from S3.  I wonder if a
similar problem causes swsusp to interact badly with mysql (which many
hibernation scripts stop before hibernation).

I long for the days of APM, when the BIOS just pulled the rug out from
under the operating system, halting everything in mid-instruction!  On
my Thinkpad, with a bit of configuration, APM standy/sleep/hibernate
(ACPI's S1, S3, S4) worked perfectly and was snappy.

-Sanjoy


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]