Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Sep 2010 03:00:54 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r212245 - head/lib/libthr/thread
Message-ID:  <201009060300.o8630sWI008822@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidxu
Date: Mon Sep  6 03:00:54 2010
New Revision: 212245
URL: http://svn.freebsd.org/changeset/base/212245

Log:
  Fix off-by-one error in function _thr_sigact_unload, also disable the
  function, it seems some gnome application tends to crash if we
  unregister sigaction automatically.

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c	Sun Sep  5 21:44:50 2010	(r212244)
+++ head/lib/libthr/thread/thr_sig.c	Mon Sep  6 03:00:54 2010	(r212245)
@@ -418,6 +418,7 @@ _thr_signal_init(void)
 void
 _thr_sigact_unload(struct dl_phdr_info *phdr_info)
 {
+#if 0
 	struct pthread *curthread = _get_curthread();
 	struct urwlock *rwlp;
 	struct sigaction *actp;
@@ -426,13 +427,13 @@ _thr_sigact_unload(struct dl_phdr_info *
 	int sig;
  
 	_thr_signal_block(curthread);
-	for (sig = 1; sig < _SIG_MAXSIG; sig++) {
-		actp = &_thr_sigact[sig].sigact;
+	for (sig = 1; sig <= _SIG_MAXSIG; sig++) {
+		actp = &_thr_sigact[sig-1].sigact;
 retry:
 		handler = actp->sa_handler;
 		if (handler != SIG_DFL && handler != SIG_IGN &&
 		    __elf_phdr_match_addr(phdr_info, handler)) {
-			rwlp = &_thr_sigact[sig].lock;
+			rwlp = &_thr_sigact[sig-1].lock;
 			_thr_rwl_wrlock(rwlp);
 			if (handler != actp->sa_handler) {
 				_thr_rwl_unlock(rwlp);
@@ -449,6 +450,7 @@ retry:
 		}
 	}
 	_thr_signal_unblock(curthread);
+#endif
 }
 
 void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009060300.o8630sWI008822>