Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 May 2003 00:09:40 -0400 (EDT)
From:      Daniel Eischen <eischen@pcnet1.pcnet.com>
To:        Alexander Kabaev <kabaev@mail.ru>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: konsole triggers infinite SIGABRT loop in libkse
Message-ID:  <Pine.GSO.4.10.10305262356550.22455-100000@pcnet1.pcnet.com>
In-Reply-To: <20030526204634.4c0cfee6.kabaev@mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 26 May 2003, Alexander Kabaev wrote:

> There is a simple way to trigger an infinite loop in konsole with
> libkse. Sometimes konsole tries to chown the pty is has created and
> fails with the following message:
> 
> konsole: cannot chown /dev/ttyp9.
> Reason: Operation not permitted
> 
> It tries to abort() itself afterwards, entering the infinite loop, see
> backtrace below. Apparently, _thr_sig_handler simply calls itself over
> and over again.

Hmm, I think I can see how this could occur after a fork.  Does this
solve the problem for you:

Index: thread/thr_sig.c
===================================================================
RCS file: /home/ncvs/src/lib/libpthread/thread/thr_sig.c,v
retrieving revision 1.51
diff -u -r1.51 thr_sig.c
--- thread/thr_sig.c	24 May 2003 02:29:25 -0000	1.51
+++ thread/thr_sig.c	27 May 2003 04:06:52 -0000
@@ -175,7 +175,7 @@
 void
 _thr_sig_handler(int sig, siginfo_t *info, ucontext_t *ucp)
 {
-	void (*sigfunc)(int, siginfo_t *, void *);
+	__siginfohandler_t *sigfunc;
 	struct kse *curkse;
 
 	curkse = _get_curkse();
@@ -184,7 +184,8 @@
 		sigfunc = _thread_sigact[sig - 1].sa_sigaction;
 		ucp->uc_sigmask = _thr_proc_sigmask;
 		if (((__sighandler_t *)sigfunc != SIG_DFL) &&
-		    ((__sighandler_t *)sigfunc != SIG_IGN)) {
+		    ((__sighandler_t *)sigfunc != SIG_IGN) &&
+		    (sigfunc != (__siginfohandler_t *)_thr_sig_handler)) {
 			if (((_thread_sigact[sig - 1].sa_flags & SA_SIGINFO)
 			    != 0) || (info == NULL))
 				(*(sigfunc))(sig, info, ucp);


-- 
Dan Eischen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10305262356550.22455-100000>